@daffodil/core 0.54.0 → 0.56.1
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/esm2020/routing/reducers/clear-errors/navigated-entity-reducer-factory.mjs +2 -2
- package/esm2020/routing/reducers/clear-errors/navigated.reducer.mjs +2 -2
- package/esm2020/state/errors/errorable.type.mjs +1 -1
- package/esm2020/state/operation/adapter.mjs +8 -8
- package/esm2020/state/operation/entity/type.mjs +1 -1
- package/esm2020/state/operation/facade.type.mjs +1 -1
- package/esm2020/state/operation/selectors.mjs +3 -3
- package/esm2020/state/operation/state.mjs +3 -3
- package/fesm2015/daffodil-core-routing.mjs +2 -2
- package/fesm2015/daffodil-core-routing.mjs.map +1 -1
- package/fesm2015/daffodil-core-state.mjs +9 -9
- package/fesm2015/daffodil-core-state.mjs.map +1 -1
- package/fesm2020/daffodil-core-routing.mjs +2 -2
- package/fesm2020/daffodil-core-routing.mjs.map +1 -1
- package/fesm2020/daffodil-core-state.mjs +11 -11
- package/fesm2020/daffodil-core-state.mjs.map +1 -1
- package/package.json +1 -1
- package/state/errors/errorable.type.d.ts +4 -1
- package/state/operation/adapter.d.ts +1 -1
- package/state/operation/entity/type.d.ts +3 -6
- package/state/operation/facade.type.d.ts +2 -2
- package/state/operation/selectors.d.ts +2 -2
- package/state/operation/state.d.ts +3 -11
|
@@ -9,11 +9,11 @@ export function daffRouterStateNavigatedClearEntityErrorsReducerFactory(adapter
|
|
|
9
9
|
case ROUTER_NAVIGATED:
|
|
10
10
|
return adapter.map((entity) => ({
|
|
11
11
|
...entity,
|
|
12
|
-
|
|
12
|
+
daffErrors: [],
|
|
13
13
|
}), state);
|
|
14
14
|
default:
|
|
15
15
|
return state;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF2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Sc7XG5cbmltcG9ydCB7IERhZmZFcnJvcmFibGUgfSBmcm9tICdAZGFmZm9kaWwvY29yZS9zdGF0ZSc7XG5cbi8qKlxuICogQ3JlYXRlcyBhIHJlZHVjZXIgdGhhdCB3aWxsIGNsZWFyIGFsbCBjb250ZXh0dWFsIGVycm9ycyBmcm9tIGVudGl0aWVzIGluIHN0YXRlIHdoZW4gYFJPVVRFUl9OQVZJR0FURURgIGlzIGRpc3BhdGNoZWQuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBkYWZmUm91dGVyU3RhdGVOYXZpZ2F0ZWRDbGVhckVudGl0eUVycm9yc1JlZHVjZXJGYWN0b3J5PFQgZXh0ZW5kcyBEYWZmRXJyb3JhYmxlID0gRGFmZkVycm9yYWJsZT4oYWRhcHRlcjogRW50aXR5QWRhcHRlcjxUPiA9IGNyZWF0ZUVudGl0eUFkYXB0ZXI8VD4oKSkge1xuICByZXR1cm4gKHN0YXRlOiBFbnRpdHlTdGF0ZTxUPiwgYWN0aW9uOiBSb3V0ZXJBY3Rpb248dW5rbm93bj4pOiBFbnRpdHlTdGF0ZTxUPiA9PiB7XG4gICAgc3dpdGNoIChhY3Rpb24udHlwZSkge1xuICAgICAgY2FzZSBST1VURVJfTkFWSUdBVEVEOlxuICAgICAgICByZXR1cm4gYWRhcHRlci5tYXAoXG4gICAgICAgICAgKGVudGl0eSkgPT4gKHtcbiAgICAgICAgICAgIC4uLmVudGl0eSxcbiAgICAgICAgICAgIGRhZmZFcnJvcnM6IFtdLFxuICAgICAgICAgIH0pLFxuICAgICAgICAgIHN0YXRlLFxuICAgICAgICApO1xuXG4gICAgICBkZWZhdWx0OlxuICAgICAgICByZXR1cm4gc3RhdGU7XG4gICAgfVxuICB9O1xufVxuIl19
|
|
@@ -7,10 +7,10 @@ export function daffRouterStateNavigatedClearErrorsReducer(state, action) {
|
|
|
7
7
|
case ROUTER_NAVIGATED:
|
|
8
8
|
return {
|
|
9
9
|
...state,
|
|
10
|
-
|
|
10
|
+
daffErrors: [],
|
|
11
11
|
};
|
|
12
12
|
default:
|
|
13
13
|
return state;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF2aWdhdGVkLnJlZHVjZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvcm91dGluZy9zcmMvcmVkdWNlcnMvY2xlYXItZXJyb3JzL25hdmlnYXRlZC5yZWR1Y2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxnQkFBZ0IsR0FDakIsTUFBTSxvQkFBb0IsQ0FBQztBQUk1Qjs7R0FFRztBQUNILE1BQU0sVUFBVSwwQ0FBMEMsQ0FBMEMsS0FBUSxFQUFFLE1BQTZCO0lBQ3pJLFFBQVEsTUFBTSxDQUFDLElBQUksRUFBRTtRQUNuQixLQUFLLGdCQUFnQjtZQUNuQixPQUFPO2dCQUNMLEdBQUcsS0FBSztnQkFDUixVQUFVLEVBQUUsRUFBRTthQUNmLENBQUM7UUFFSjtZQUNFLE9BQU8sS0FBSyxDQUFDO0tBQ2hCO0FBQ0gsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIFJvdXRlckFjdGlvbixcbiAgUk9VVEVSX05BVklHQVRFRCxcbn0gZnJvbSAnQG5ncngvcm91dGVyLXN0b3JlJztcblxuaW1wb3J0IHsgRGFmZkVycm9yYWJsZSB9IGZyb20gJ0BkYWZmb2RpbC9jb3JlL3N0YXRlJztcblxuLyoqXG4gKiBBIHJlZHVjZXIgdGhhdCB3aWxsIGNsZWFyIGFsbCBlcnJvcnMgZnJvbSBzdGF0ZSB3aGVuIGBST1VURVJfTkFWSUdBVEVEYCBpcyBkaXNwYXRjaGVkLlxuICovXG5leHBvcnQgZnVuY3Rpb24gZGFmZlJvdXRlclN0YXRlTmF2aWdhdGVkQ2xlYXJFcnJvcnNSZWR1Y2VyPFQgZXh0ZW5kcyBEYWZmRXJyb3JhYmxlID0gRGFmZkVycm9yYWJsZT4oc3RhdGU6IFQsIGFjdGlvbjogUm91dGVyQWN0aW9uPHVua25vd24+KTogVCB7XG4gIHN3aXRjaCAoYWN0aW9uLnR5cGUpIHtcbiAgICBjYXNlIFJPVVRFUl9OQVZJR0FURUQ6XG4gICAgICByZXR1cm4ge1xuICAgICAgICAuLi5zdGF0ZSxcbiAgICAgICAgZGFmZkVycm9yczogW10sXG4gICAgICB9O1xuXG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiBzdGF0ZTtcbiAgfVxufVxuIl19
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JhYmxlLnR5cGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3RhdGUvc3JjL2Vycm9ycy9lcnJvcmFibGUudHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRGFmZlN0YXRlRXJyb3IgfSBmcm9tICcuL3N0YXRlLWVycm9yLmludGVyZmFjZSc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgRGFmZkVycm9yYWJsZSB7XG4gIC8qKlxuICAgKiBBIGxpc3Qgb2YgZXJyb3JzIGFwcGxpY2FibGUgb25seSB0byB0aGlzIGVudGl0eS5cbiAgICovXG4gIGRhZmZFcnJvcnM6IERhZmZTdGF0ZUVycm9yW107XG59XG4iXX0=
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export function daffStartResolution(state) {
|
|
6
6
|
return {
|
|
7
7
|
...state,
|
|
8
|
-
|
|
8
|
+
daffState: "Resolving" /* Resolving */,
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
;
|
|
@@ -15,7 +15,7 @@ export function daffStartResolution(state) {
|
|
|
15
15
|
export function daffStartMutation(state) {
|
|
16
16
|
return {
|
|
17
17
|
...state,
|
|
18
|
-
|
|
18
|
+
daffState: "Mutating" /* Mutating */,
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
;
|
|
@@ -26,8 +26,8 @@ export function daffStartMutation(state) {
|
|
|
26
26
|
export function daffCompleteOperation(state) {
|
|
27
27
|
return {
|
|
28
28
|
...state,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
daffState: "Stable" /* Stable */,
|
|
30
|
+
daffErrors: [],
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
;
|
|
@@ -38,8 +38,8 @@ export function daffCompleteOperation(state) {
|
|
|
38
38
|
export function daffOperationFailed(errors, state) {
|
|
39
39
|
return {
|
|
40
40
|
...state,
|
|
41
|
-
|
|
42
|
-
errors,
|
|
41
|
+
daffState: "Stable" /* Stable */,
|
|
42
|
+
daffErrors: errors,
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
;
|
|
@@ -49,8 +49,8 @@ export function daffOperationFailed(errors, state) {
|
|
|
49
49
|
export function daffClearErrors(state) {
|
|
50
50
|
return {
|
|
51
51
|
...state,
|
|
52
|
-
|
|
52
|
+
daffErrors: [],
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
;
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRhcHRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9zdGF0ZS9zcmMvb3BlcmF0aW9uL2FkYXB0ZXIudHMiXSwibmFt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wZXJhdGlvblN0YXRlID0gRGFmZk9wZXJhdGlvblN0YXRlPihzdGF0ZTogVCk6IFQge1xuICByZXR1cm4ge1xuICAgIC4uLnN0YXRlLFxuICAgIGRhZmZTdGF0ZTogRGFmZlN0YXRlLlN0YWJsZSxcbiAgICBkYWZmRXJyb3JzOiBbXSxcbiAgfTtcbn07XG5cbi8qKlxuICogSW5kaWNhdGVzIGEgZmFpbGVkIG9wZXJhdGlvbi5cbiAqIFNldHMgbG9hZGluZyB0byBzdGFibGUgYW5kIHN0b3JlcyBlcnJvcnMuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBkYWZmT3BlcmF0aW9uRmFpbGVkIDxUIGV4dGVuZHMgRGFmZk9wZXJhdGlvblN0YXRlID0gRGFmZk9wZXJhdGlvblN0YXRlPihlcnJvcnM6IFRbJ2RhZmZFcnJvcnMnXSwgc3RhdGU6IFQpOiBUIHtcbiAgcmV0dXJuIHtcbiAgICAuLi5zdGF0ZSxcbiAgICBkYWZmU3RhdGU6IERhZmZTdGF0ZS5TdGFibGUsXG4gICAgZGFmZkVycm9yczogZXJyb3JzLFxuICB9O1xufTtcblxuLyoqXG4gKiBSZXNldHMgZXJyb3JzLlxuICovXG5leHBvcnQgZnVuY3Rpb24gZGFmZkNsZWFyRXJyb3JzIDxUIGV4dGVuZHMgRGFmZk9wZXJhdGlvblN0YXRlID0gRGFmZk9wZXJhdGlvblN0YXRlPihzdGF0ZTogVCk6IFQge1xuICByZXR1cm4ge1xuICAgIC4uLnN0YXRlLFxuICAgIGRhZmZFcnJvcnM6IFtdLFxuICB9O1xufTtcbiJdfQ==
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy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iBPYnNlcnZhYmxlPGJvb2xlYW4+O1xuICAvKipcbiAgICogVGhlIGVycm9ycyBpbiB0aGUgb3BlcmF0aW9uIHN0YXRlLlxuICAgKi9cbiAgZXJyb3JzJDogT2JzZXJ2YWJsZTxUU3RhdGVbJ2RhZmZFcnJvcnMnXT47XG4gIC8qKlxuICAgKiBXaGV0aGVyIHRoZSBvcGVyYXRpb24gc3RhdGUgaGFzIGFueSBlcnJvcnMuXG4gICAqIElmIHNvLCBpdCBzaG91bGQgYmUgY29uc2lkZXJlZCB0byBiZSBpbiBhbiBcImVycm9yXCIgc3RhdGUuXG4gICAqL1xuICBoYXNFcnJvcnMkOiBPYnNlcnZhYmxlPGJvb2xlYW4+O1xufVxuIl19
|
|
@@ -5,11 +5,11 @@ import { createSelector, } from '@ngrx/store';
|
|
|
5
5
|
* @param selectState The feature selector for the operation state.
|
|
6
6
|
*/
|
|
7
7
|
export function daffOperationStateSelectorFactory(selectState) {
|
|
8
|
-
const selectLoadingState = createSelector(selectState, state => state.
|
|
8
|
+
const selectLoadingState = createSelector(selectState, state => state.daffState);
|
|
9
9
|
const selectLoading = createSelector(selectLoadingState, loadingState => loadingState !== "Stable" /* Stable */);
|
|
10
10
|
const selectResolving = createSelector(selectLoadingState, loadingState => loadingState === "Resolving" /* Resolving */);
|
|
11
11
|
const selectMutating = createSelector(selectLoadingState, loadingState => loadingState === "Mutating" /* Mutating */);
|
|
12
|
-
const selectErrors = createSelector(selectState, state => state.
|
|
12
|
+
const selectErrors = createSelector(selectState, state => state.daffErrors);
|
|
13
13
|
const selectHasErrors = createSelector(selectErrors, errors => errors.length > 0);
|
|
14
14
|
return {
|
|
15
15
|
selectLoadingState,
|
|
@@ -21,4 +21,4 @@ export function daffOperationStateSelectorFactory(selectState) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
;
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uI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5cbiAgcmV0dXJuIHtcbiAgICBzZWxlY3RMb2FkaW5nU3RhdGUsXG4gICAgc2VsZWN0TG9hZGluZyxcbiAgICBzZWxlY3RSZXNvbHZpbmcsXG4gICAgc2VsZWN0TXV0YXRpbmcsXG4gICAgc2VsZWN0RXJyb3JzLFxuICAgIHNlbGVjdEhhc0Vycm9ycyxcbiAgfTtcbn07XG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const daffOperationInitialState = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
daffState: "Stable" /* Stable */,
|
|
3
|
+
daffErrors: [],
|
|
4
4
|
};
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvc3RhdGUvc3JjL29wZXJhdGlvbi9zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZQSxNQUFNLENBQUMsTUFBTSx5QkFBeUIsR0FBdUI7SUFDM0QsU0FBUyx1QkFBa0I7SUFDM0IsVUFBVSxFQUFFLEVBQUU7Q0FDZixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRGFmZkVycm9yYWJsZSB9IGZyb20gJy4uL2Vycm9ycy9wdWJsaWNfYXBpJztcbmltcG9ydCB7XG4gIERhZmZTdGF0ZSxcbiAgRGFmZlN0YXRlYWJsZSxcbn0gZnJvbSAnLi4vc3RhdGVzL3B1YmxpY19hcGknO1xuXG4vKipcbiAqIEEgYmFzaWMgb3BlcmF0aW9uIHN0YXRlLlxuICogUmVwcmVzZW50cyB0aGUgY3VycmVudCBzdGF0ZSBvZiBhbiBvcGVyYXRpb24gYW5kIGFueSBhc3NvY2lhdGVkIGVycm9ycy5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBEYWZmT3BlcmF0aW9uU3RhdGUgZXh0ZW5kcyBEYWZmRXJyb3JhYmxlLCBEYWZmU3RhdGVhYmxlIHt9XG5cbmV4cG9ydCBjb25zdCBkYWZmT3BlcmF0aW9uSW5pdGlhbFN0YXRlOiBEYWZmT3BlcmF0aW9uU3RhdGUgPSB7XG4gIGRhZmZTdGF0ZTogRGFmZlN0YXRlLlN0YWJsZSxcbiAgZGFmZkVycm9yczogW10sXG59O1xuIl19
|
|
@@ -85,7 +85,7 @@ function daffRouterStateNavigatedClearEntityErrorsReducerFactory(adapter = creat
|
|
|
85
85
|
return (state, action) => {
|
|
86
86
|
switch (action.type) {
|
|
87
87
|
case ROUTER_NAVIGATED:
|
|
88
|
-
return adapter.map((entity) => (Object.assign(Object.assign({}, entity), {
|
|
88
|
+
return adapter.map((entity) => (Object.assign(Object.assign({}, entity), { daffErrors: [] })), state);
|
|
89
89
|
default:
|
|
90
90
|
return state;
|
|
91
91
|
}
|
|
@@ -98,7 +98,7 @@ function daffRouterStateNavigatedClearEntityErrorsReducerFactory(adapter = creat
|
|
|
98
98
|
function daffRouterStateNavigatedClearErrorsReducer(state, action) {
|
|
99
99
|
switch (action.type) {
|
|
100
100
|
case ROUTER_NAVIGATED:
|
|
101
|
-
return Object.assign(Object.assign({}, state), {
|
|
101
|
+
return Object.assign(Object.assign({}, state), { daffErrors: [] });
|
|
102
102
|
default:
|
|
103
103
|
return state;
|
|
104
104
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-routing.mjs","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated-entity-reducer-factory.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated.reducer.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","import {\n createEntityAdapter,\n EntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * Creates a reducer that will clear all contextual errors from entities in state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearEntityErrorsReducerFactory<T extends DaffErrorable = DaffErrorable>(adapter: EntityAdapter<T> = createEntityAdapter<T>()) {\n return (state: EntityState<T>, action: RouterAction<unknown>): EntityState<T> => {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return adapter.map(\n (entity) => ({\n ...entity,\n
|
|
1
|
+
{"version":3,"file":"daffodil-core-routing.mjs","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated-entity-reducer-factory.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated.reducer.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","import {\n createEntityAdapter,\n EntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * Creates a reducer that will clear all contextual errors from entities in state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearEntityErrorsReducerFactory<T extends DaffErrorable = DaffErrorable>(adapter: EntityAdapter<T> = createEntityAdapter<T>()) {\n return (state: EntityState<T>, action: RouterAction<unknown>): EntityState<T> => {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return adapter.map(\n (entity) => ({\n ...entity,\n daffErrors: [],\n }),\n state,\n );\n\n default:\n return state;\n }\n };\n}\n","import {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * A reducer that will clear all errors from state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearErrorsReducer<T extends DaffErrorable = DaffErrorable>(state: T, action: RouterAction<unknown>): T {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return {\n ...state,\n daffErrors: [],\n };\n\n default:\n return state;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AACI,MAAM,kCAAkC,GAAG,aAAa;AAC/D;;AAEG;AACU,MAAA,4BAA4B,GAAG,CAAC,GAAW,KAAa,EAAA,IAAA,EAAA,CAAA,CAAA,OAAA,CAAA,CAAA,EAAA,GAAA,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,CAAC,CAAC,KAAI,GAAG,CAAA;;ACR9H;;;AAGG;AACU,MAAA,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAA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A,UAAA,EAAA,CAAA,CAAA;AAAxB,mBAAA,wBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFvB,MAAM,EAAA,CAAA,CAAA;2FAEP,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACAD;;AAEG;SACa,uDAAuD,CAA0C,OAAA,GAA4B,mBAAmB,EAAK,EAAA;AACnK,IAAA,OAAO,CAAC,KAAqB,EAAE,MAA6B,KAAoB;QAC9E,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,gBAAgB;AACnB,gBAAA,OAAO,OAAO,CAAC,GAAG,CAChB,CAAC,MAAM,sCACF,MAAM,CAAA,EAAA,EACT,UAAU,EAAE,EAAE,IACd,EACF,KAAK,CACN,CAAC;AAEJ,YAAA;AACE,gBAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AACH,KAAC,CAAC;AACJ;;ACxBA;;AAEG;AACa,SAAA,0CAA0C,CAA0C,KAAQ,EAAE,MAA6B,EAAA;IACzI,QAAQ,MAAM,CAAC,IAAI;AACjB,QAAA,KAAK,gBAAgB;AACnB,YAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EACK,KAAK,CAAA,EAAA,EACR,UAAU,EAAE,EAAE,EACd,CAAA,CAAA;AAEJ,QAAA;AACE,YAAA,OAAO,KAAK,CAAC;AAChB,KAAA;AACH;;ACrBA;;AAEG;;;;"}
|
|
@@ -203,14 +203,14 @@ class DaffCollectionFacade {
|
|
|
203
203
|
* Sets loading to `DaffState.Resolving`
|
|
204
204
|
*/
|
|
205
205
|
function daffStartResolution(state) {
|
|
206
|
-
return Object.assign(Object.assign({}, state), {
|
|
206
|
+
return Object.assign(Object.assign({}, state), { daffState: "Resolving" /* Resolving */ });
|
|
207
207
|
}
|
|
208
208
|
;
|
|
209
209
|
/**
|
|
210
210
|
* Puts the state in a "mutating" state that correspondes to loading platform data in a POST or PUT fashion.
|
|
211
211
|
*/
|
|
212
212
|
function daffStartMutation(state) {
|
|
213
|
-
return Object.assign(Object.assign({}, state), {
|
|
213
|
+
return Object.assign(Object.assign({}, state), { daffState: "Mutating" /* Mutating */ });
|
|
214
214
|
}
|
|
215
215
|
;
|
|
216
216
|
/**
|
|
@@ -218,7 +218,7 @@ function daffStartMutation(state) {
|
|
|
218
218
|
* Sets loading to stable and resets errors.
|
|
219
219
|
*/
|
|
220
220
|
function daffCompleteOperation(state) {
|
|
221
|
-
return Object.assign(Object.assign({}, state), {
|
|
221
|
+
return Object.assign(Object.assign({}, state), { daffState: "Stable" /* Stable */, daffErrors: [] });
|
|
222
222
|
}
|
|
223
223
|
;
|
|
224
224
|
/**
|
|
@@ -226,20 +226,20 @@ function daffCompleteOperation(state) {
|
|
|
226
226
|
* Sets loading to stable and stores errors.
|
|
227
227
|
*/
|
|
228
228
|
function daffOperationFailed(errors, state) {
|
|
229
|
-
return Object.assign(Object.assign({}, state), {
|
|
229
|
+
return Object.assign(Object.assign({}, state), { daffState: "Stable" /* Stable */, daffErrors: errors });
|
|
230
230
|
}
|
|
231
231
|
;
|
|
232
232
|
/**
|
|
233
233
|
* Resets errors.
|
|
234
234
|
*/
|
|
235
235
|
function daffClearErrors(state) {
|
|
236
|
-
return Object.assign(Object.assign({}, state), {
|
|
236
|
+
return Object.assign(Object.assign({}, state), { daffErrors: [] });
|
|
237
237
|
}
|
|
238
238
|
;
|
|
239
239
|
|
|
240
240
|
const daffOperationInitialState = {
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
daffState: "Stable" /* Stable */,
|
|
242
|
+
daffErrors: [],
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
/**
|
|
@@ -248,11 +248,11 @@ const daffOperationInitialState = {
|
|
|
248
248
|
* @param selectState The feature selector for the operation state.
|
|
249
249
|
*/
|
|
250
250
|
function daffOperationStateSelectorFactory(selectState) {
|
|
251
|
-
const selectLoadingState = createSelector(selectState, state => state.
|
|
251
|
+
const selectLoadingState = createSelector(selectState, state => state.daffState);
|
|
252
252
|
const selectLoading = createSelector(selectLoadingState, loadingState => loadingState !== "Stable" /* Stable */);
|
|
253
253
|
const selectResolving = createSelector(selectLoadingState, loadingState => loadingState === "Resolving" /* Resolving */);
|
|
254
254
|
const selectMutating = createSelector(selectLoadingState, loadingState => loadingState === "Mutating" /* Mutating */);
|
|
255
|
-
const selectErrors = createSelector(selectState, state => state.
|
|
255
|
+
const selectErrors = createSelector(selectState, state => state.daffErrors);
|
|
256
256
|
const selectHasErrors = createSelector(selectErrors, errors => errors.length > 0);
|
|
257
257
|
return {
|
|
258
258
|
selectLoadingState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-state.mjs","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/reducers/identity.ts","../../../libs/core/state/src/collection/adapter.class.ts","../../../libs/core/state/src/collection/initial-state.ts","../../../libs/core/state/src/collection/selector-factory.ts","../../../libs/core/state/src/collection/facade.ts","../../../libs/core/state/src/operation/adapter.ts","../../../libs/core/state/src/operation/state.ts","../../../libs/core/state/src/operation/selectors.ts","../../../libs/core/state/src/operation/entity/selectors.ts","../../../libs/core/state/src/operation/entity/adapter.ts","../../../libs/core/state/src/operation/entity/helpers.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","import { Action } from '@ngrx/store';\n\n/**\n * A simple reducer that simply returns the passed state.\n * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.\n */\nexport const daffIdentityReducer = <T = unknown>(state: T, action: Action): T => state;\n","import { defaultMemoize } from '@ngrx/store';\n\nimport {\n daffCollectionBuildMetadataFromRequest,\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * Provides an abstracted way to manage a collection state.\n */\nexport class DaffCollectionStateAdapter<T extends DaffCollectionMetadata = DaffCollectionMetadata> {\n /**\n * Stores a collection request in state.\n * This is useful when you want to preemptively reduce a request before waiting for a response.\n */\n storeRequest(request: DaffCollectionRequest, state: T): T {\n return {\n ...state,\n ...daffCollectionBuildMetadataFromRequest(request),\n };\n }\n\n /**\n * Sets the page size.\n */\n setPageSize(size: number, state: T): T {\n return {\n ...state,\n pageSize: size,\n currentPage: 1,\n };\n }\n\n /**\n * Sets the current page.\n */\n setCurrentPage(page: number, state: T): T {\n return {\n ...state,\n currentPage: page,\n };\n }\n\n /**\n * Sets the sorting option and direction.\n */\n setSort(option: string, direction: string, state: T): T {\n return {\n ...state,\n appliedSortOption: option,\n appliedSortDirection: direction,\n };\n }\n\n /**\n * Sets the collection filters.\n */\n setFilters(filters: DaffFilters, state: T): T {\n return {\n ...state,\n currentPage: 1,\n filters: filters || {},\n };\n }\n\n /**\n * Set the entire collection metadata at once.\n */\n setMetadata(metadata: DaffCollectionMetadata, state: T): T {\n return {\n ...state,\n ids: metadata.ids,\n count: metadata.count,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n sortOptions: metadata.sortOptions,\n totalPages: metadata.totalPages,\n appliedSortOption: metadata.appliedSortOption || state.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection || state.appliedSortDirection,\n filters: metadata.filters || {},\n };\n }\n}\n\n/**\n * Create the adapter for the collection state.\n */\nexport const getCollectionStateAdapter: <T extends DaffCollectionMetadata = DaffCollectionMetadata>() => DaffCollectionStateAdapter<T>\n = defaultMemoize(() => new DaffCollectionStateAdapter()).memoized;\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nexport const daffCollectionReducerInitialState: DaffCollectionMetadata = {\n count: 0,\n appliedSortOption: null,\n appliedSortDirection: null,\n currentPage: null,\n pageSize: null,\n totalPages: null,\n sortOptions: {\n default: null,\n options: [],\n },\n ids: [],\n filters: {},\n};\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n daffComputeAppliedFilters,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * An interface to describe all selectors related to the collection metadata.\n */\nexport interface DaffCollectionMemoizedSelectors<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> {\n /**\n * Selects the metadata for the collection.\n */\n selectCollectionMetadata: MemoizedSelector<TState, TMetadata>;\n /**\n * Builds a request that matches the current collection.\n */\n selectCollectionRequest: MemoizedSelector<TState, DaffCollectionRequest>;\n /**\n * Selects the total number of items of the collection.\n */\n selectCollectionCount: MemoizedSelector<TState, TMetadata['count']>;\n /**\n * Selects the current page of items of the collection.\n */\n selectCollectionCurrentPage: MemoizedSelector<TState, TMetadata['currentPage']>;\n /**\n * Selects the total number of pages of items that exist in the collection.\n */\n selectCollectionTotalPages: MemoizedSelector<TState, TMetadata['totalPages']>;\n /**\n * Selects the number of items on each collection.\n */\n selectCollectionPageSize: MemoizedSelector<TState, TMetadata['pageSize']>;\n /**\n * Selects the sort options that may be applied to the collection.\n */\n selectCollectionSortOptions: MemoizedSelector<TState, TMetadata['sortOptions']['options']>;\n /**\n * Selects the applied sorting option if one is applied.\n */\n selectCollectionAppliedSortOption: MemoizedSelector<TState, TMetadata['appliedSortOption']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionAppliedSortDirection: MemoizedSelector<TState, TMetadata['appliedSortDirection']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionIds: MemoizedSelector<TState, TMetadata['ids']>;\n /**\n * Selects the filters that may be applied to the collection.\n */\n selectCollectionFilters: MemoizedSelector<TState, TMetadata['filters']>;\n /**\n * Returns a dict of filters and only their applied options.\n * Filters with no applied options will be omitted.\n */\n selectCollectionAppliedFilters: MemoizedSelector<TState, DaffFilters>;\n}\n\n/**\n * Creates collection selectors.\n *\n * @param selectCollectionState A selector for the particular collection state upon which the returned selectors should operate.\n */\nexport const daffCollectionSelectorFactory = <\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n>(\n selectCollectionState: MemoizedSelector<TState, TMetadata>,\n): DaffCollectionMemoizedSelectors<TState, TMetadata> => {\n\n const selectCollectionMetadata = createSelector(\n selectCollectionState,\n state => state,\n );\n\n const selectCollectionRequest = createSelector(\n selectCollectionMetadata,\n metadata => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n }),\n );\n\n const selectCollectionCount = createSelector(\n selectCollectionMetadata,\n state => state.count,\n );\n\n const selectCollectionCurrentPage = createSelector(\n selectCollectionMetadata,\n state => state.currentPage,\n );\n\n const selectCollectionTotalPages = createSelector(\n selectCollectionMetadata,\n state => state.totalPages,\n );\n\n const selectCollectionPageSize = createSelector(\n selectCollectionMetadata,\n state => state.pageSize,\n );\n\n const selectCollectionSortOptions = createSelector(\n selectCollectionMetadata,\n state => state.sortOptions.options,\n );\n\n const selectCollectionAppliedSortOption = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortOption,\n );\n\n const selectCollectionAppliedSortDirection = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortDirection,\n );\n\n const selectCollectionIds = createSelector(\n selectCollectionMetadata,\n state => state.ids,\n );\n\n const selectCollectionFilters = createSelector(\n selectCollectionMetadata,\n state => state.filters,\n );\n\n const selectCollectionAppliedFilters = createSelector(\n selectCollectionFilters,\n filters => daffComputeAppliedFilters(filters),\n );\n\n return {\n selectCollectionMetadata,\n selectCollectionRequest,\n selectCollectionCount,\n selectCollectionCurrentPage,\n selectCollectionTotalPages,\n selectCollectionPageSize,\n selectCollectionSortOptions,\n selectCollectionAppliedSortOption,\n selectCollectionAppliedSortDirection,\n selectCollectionIds,\n selectCollectionFilters,\n selectCollectionAppliedFilters,\n };\n};\n","import {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\n\nimport { DaffCollectionFacadeInterface } from './facade.interface';\nimport { DaffCollectionMemoizedSelectors } from './selector-factory';\n\n/**\n * An abstract class for a collection facade.\n * It is configurable via its constructor parameters.\n * The particular collection state from which\n * this facade will read is determined by the selectors passed.\n *\n * @inheritdoc\n */\nexport abstract class DaffCollectionFacade<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> implements DaffCollectionFacadeInterface<TMetadata> {\n metadata$: Observable<TMetadata>;\n request$: Observable<DaffCollectionRequest>;\n count$: Observable<number>;\n currentPage$: Observable<number>;\n totalPages$: Observable<number>;\n pageSize$: Observable<number>;\n sortOptions$: Observable<DaffSortOption[]>;\n appliedSortOption$: Observable<string>;\n appliedSortDirection$: Observable<DaffSortDirectionEnum>;\n filters$: Observable<DaffFilters>;\n appliedFilters$: Observable<DaffFilters>;\n\n constructor(\n protected store: Store<TState>,\n selectors: DaffCollectionMemoizedSelectors<TState, TMetadata>,\n ) {\n\t this.metadata$ = this.store.pipe(select(selectors.selectCollectionMetadata));\n\t this.request$ = this.store.pipe(select(selectors.selectCollectionRequest));\n\t this.count$ = this.store.pipe(select(selectors.selectCollectionCount));\n\t this.currentPage$ = this.store.pipe(select(selectors.selectCollectionCurrentPage));\n\t this.totalPages$ = this.store.pipe(select(selectors.selectCollectionTotalPages));\n\t this.pageSize$ = this.store.pipe(select(selectors.selectCollectionPageSize));\n\t this.sortOptions$ = this.store.pipe(select(selectors.selectCollectionSortOptions));\n\t this.appliedSortOption$ = this.store.pipe(select(selectors.selectCollectionAppliedSortOption));\n\t this.appliedSortDirection$ = this.store.pipe(select(selectors.selectCollectionAppliedSortDirection));\n this.filters$ = this.store.pipe(select(selectors.selectCollectionFilters));\n\t this.appliedFilters$ = this.store.pipe(select(selectors.selectCollectionAppliedFilters));\n }\n\n /**\n * Dispatches the given action.\n *\n * @param action action to dispatch.\n */\n dispatch(action: Action) {\n\t this.store.dispatch(action);\n }\n}\n","import { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Puts the state in a \"resolving\" state that correspondes to loading platform data in a GET fashion.\n * Sets loading to `DaffState.Resolving`\n */\nexport function daffStartResolution <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n loading: DaffState.Resolving,\n };\n};\n\n/**\n * Puts the state in a \"mutating\" state that correspondes to loading platform data in a POST or PUT fashion.\n */\nexport function daffStartMutation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n loading: DaffState.Mutating,\n };\n};\n\n/**\n * Indicates a successfully completed operation.\n * Sets loading to stable and resets errors.\n */\nexport function daffCompleteOperation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n loading: DaffState.Stable,\n errors: [],\n };\n};\n\n/**\n * Indicates a failed operation.\n * Sets loading to stable and stores errors.\n */\nexport function daffOperationFailed <T extends DaffOperationState = DaffOperationState>(errors: T['errors'], state: T): T {\n return {\n ...state,\n loading: DaffState.Stable,\n errors,\n };\n};\n\n/**\n * Resets errors.\n */\nexport function daffClearErrors <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n errors: [],\n };\n};\n","import { DaffStateError } from '../errors/public_api';\nimport { DaffState } from '../states/public_api';\n\n/**\n * A basic operation state.\n * Represents the current state of an operation and any associated errors.\n */\nexport interface DaffOperationState {\n /**\n * The loading state of the operations backed by this state.\n */\n loading: DaffState;\n\n /**\n * The errors generated by the most recent operation.\n */\n errors: DaffStateError[];\n}\n\nexport const daffOperationInitialState: DaffOperationState = {\n loading: DaffState.Stable,\n errors: [],\n};\n","import {\n createSelector,\n MemoizedSelector,\n Selector,\n} from '@ngrx/store';\n\nimport { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationStateSelectors<\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n> {\n /**\n * Selects the loading state enum.\n */\n selectLoadingState: MemoizedSelector<TRootState, TState['loading']>;\n /**\n * Selects whether the operation state is in any of the loading states.\n */\n selectLoading: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is resolving.\n */\n selectResolving: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is mutating.\n */\n selectMutating: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects the errors in the operation state.\n */\n selectErrors: MemoizedSelector<TRootState, TState['errors']>;\n /**\n * Selects whether the operation state has any errors.\n * If so, it should be considered to be in an \"error\" state.\n */\n selectHasErrors: MemoizedSelector<TRootState, boolean>;\n}\n\n/**\n * Creates a set of selectors for an operation state.\n *\n * @param selectState The feature selector for the operation state.\n */\nexport function daffOperationStateSelectorFactory <\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n>(\n selectState: Selector<TRootState, TState>,\n): DaffOperationStateSelectors<TRootState, TState> {\n const selectLoadingState = createSelector(\n selectState,\n state => state.loading,\n );\n const selectLoading = createSelector(\n selectLoadingState,\n loadingState => loadingState !== DaffState.Stable,\n );\n const selectResolving = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Resolving,\n );\n const selectMutating = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Mutating,\n );\n const selectErrors = createSelector(\n selectState,\n state => state.errors,\n );\n const selectHasErrors = createSelector(\n selectErrors,\n errors => errors.length > 0,\n );\n\n return {\n selectLoadingState,\n selectLoading,\n selectResolving,\n selectMutating,\n selectErrors,\n selectHasErrors,\n };\n};\n","import type { EntitySelectors } from '@ngrx/entity/src/models';\nimport {\n createSelector,\n defaultMemoize,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffOperationEntity } from './type';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationEntityStateSelectors<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n> {\n /**\n * Selects an entity by ID.\n */\n selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;\n\n /**\n * Optimistically selects the list of entities.\n * This excludes temporary entities with errors.\n */\n selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;\n}\n\n/**\n * Creates a set of selectors for an entity operation state.\n *\n * @param selectState The feature selector for the entity operation state.\n */\nexport function daffOperationEntityStateSelectorFactory<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n>(\n entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>,\n): DaffOperationEntityStateSelectors<TRootState, T> {\n const selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>\n = defaultMemoize((id) => createSelector(\n entitySelectors.selectEntities,\n entities => entities[id],\n )).memoized;\n\n const selectOptimisticList = createSelector(\n entitySelectors.selectAll,\n (entities) => entities.filter(entity =>\n // ignore entities that are deleting\n // entity.daffState !== DaffState.Deleting &&\n // ignore placeholders with errors\n !(entity.daffTemp && entity.daffErrors.length > 0),\n ),\n );\n\n return {\n selectEntity,\n selectOptimisticList,\n };\n};\n","import {\n createEntityAdapter,\n EntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffStateError } from '../../errors/public_api';\nimport { DaffState } from '../../states/public_api';\nimport {\n daffOperationEntityStateSelectorFactory,\n DaffOperationEntityStateSelectors,\n} from './selectors';\nimport { DaffOperationEntityState } from './state.type';\nimport { DaffOperationEntity } from './type';\n\n/**\n * An entity state adapter that takes care of managing contextual operation and error state for entities.\n */\nexport interface DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> {\n /**\n * Stores a list of entities in state and resets them all to stable.\n */\n list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;\n /**\n * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.\n */\n preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;\n /**\n * Upserts the entity into state and resets operation state and errors.\n */\n load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;\n /**\n * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.\n */\n preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Adds the entity into state, sets operation state to added, and resets errors.\n */\n add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Sets the entity's operation state to mutating.\n */\n preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Upserts the entity into state, sets operation state to mutated, and resets errors.\n */\n update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Sets the entity's operation state to deleting.\n */\n preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Removes the entity from state.\n */\n remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Resets the entity's operation state and stores errors on the entity.\n */\n operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;\n /**\n * Resets the entity's operation state to stable.\n */\n resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Gets an empty entity state.\n */\n getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;\n /**\n * Gets entity selectors.\n */\n getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;\n}\n\nexport function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {\n return {\n list: (entities, state) => adapter.setAll(\n entities.map<DaffOperationEntity<T>>(entity => ({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n })),\n state,\n ),\n preload: (key, state) =>\n adapter.upsertOne(<DaffOperationEntity<T>>{\n // TODO: allow for non identifiable entities?\n id: key,\n daffState: DaffState.Resolving,\n daffErrors: [],\n daffTemp: !state.entities[key],\n }, state),\n load: (entity, state) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n }, state),\n preadd: (entity, state, placeholderId) =>\n placeholderId\n ? adapter.addOne({\n ...entity,\n // TODO: allow for non identifiable entities?\n id: placeholderId,\n daffState: DaffState.Adding,\n daffErrors: [],\n daffTemp: true,\n }, state)\n : state,\n add: (entity, state, placeholderId) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Added,\n daffErrors: [],\n daffTemp: false,\n }, placeholderId ? adapter.removeOne(placeholderId, state) : state),\n preupdate: (entity, state) =>\n adapter.upsertOne({\n ...state.entities[entity.id],\n daffState: DaffState.Mutating,\n daffErrors: [],\n }, state),\n update: (entity, state) =>\n adapter.updateOne({\n id: entity.id,\n changes: <Partial<DaffOperationEntity<T>>>{\n ...entity,\n daffState: DaffState.Mutated,\n daffErrors: [],\n daffTemp: false,\n },\n }, state),\n preremove: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffErrors: [],\n daffState: DaffState.Deleting,\n }, state),\n remove: adapter.removeOne,\n operationFailed: (key, errors, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n daffErrors: errors,\n }, state),\n resetState: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n }, state),\n getInitialState: adapter.getInitialState,\n getSelectors: <TRootState>(selectState) => daffOperationEntityStateSelectorFactory<TRootState, T>(adapter.getSelectors(selectState)),\n };\n}\n","import { DaffState } from '../../states/public_api';\n\n/**\n * Returns whether the state is one that represents an operation in progress.\n */\nexport function daffStateIsLoading(daffState: DaffState): boolean {\n return daffState === DaffState.Adding\n || daffState === DaffState.Mutating\n || daffState === DaffState.Resolving\n || daffState === DaffState.Deleting;\n}\n\n/**\n * Generate a fake ID for use with placeholder entities.\n *\n * @param key An optional key that can augment the randomly generated ID.\n * @returns A string cont\n */\nexport function daffOperationEntityCreateFakeId(key: string = ''): string {\n return `ε-${Date.now()}-${key}`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;AAChE,MAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACU,MAAA,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB,KAAI;AAClF,IAAA,M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AG,CAAC,CAAA,EAAA,EACtB,UAAU,EAAE,EAAE,EACd,SAAS,EAAoB,UAAA,iBAAA,CAAA,EAC5B,KAAK,CAAC;QACX,MAAM,EAAE,OAAO,CAAC,SAAS;AACzB,QAAA,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,KAClC,OAAO,CAAC,SAAS,iCACZ,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CACtB,EAAA,EAAA,SAAS,EAAkB,QAAA,eAC3B,UAAU,EAAE,MAAM,EAAA,CAAA,EACjB,KAAK,CAAC;QACX,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,KACrB,OAAO,CAAC,SAAS,CACZ,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAA,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CACtB,EAAA,EAAA,SAAS,EAAkB,QAAA,eAC1B,CAAA,EAAA,KAAK,CAAC;QACX,eAAe,EAAE,OAAO,CAAC,eAAe;AACxC,QAAA,YAAY,EAAE,CAAa,WAAW,KAAK,uCAAuC,CAAgB,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;KACrI,CAAC;AACJ;;ACzJA;;AAEG;AACG,SAAU,kBAAkB,CAAC,SAAoB,EAAA;AACrD,IAAA,OAAO,SAAS,KAAqB,QAAA;WAChC,SAAS,KAAuB,UAAA;WAChC,SAAS,KAAwB,WAAA;AACjC,WAAA,SAAS,+BAAwB;AACxC,CAAC;AAED;;;;;AAKG;AACa,SAAA,+BAA+B,CAAC,GAAA,GAAc,EAAE,EAAA;IAC9D,OAAO,CAAA,EAAA,EAAK,IAAI,CAAC,GAAG,EAAE,CAAI,CAAA,EAAA,GAAG,EAAE,CAAC;AAClC;;ACpBA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"daffodil-core-state.mjs","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/reducers/identity.ts","../../../libs/core/state/src/collection/adapter.class.ts","../../../libs/core/state/src/collection/initial-state.ts","../../../libs/core/state/src/collection/selector-factory.ts","../../../libs/core/state/src/collection/facade.ts","../../../libs/core/state/src/operation/adapter.ts","../../../libs/core/state/src/operation/state.ts","../../../libs/core/state/src/operation/selectors.ts","../../../libs/core/state/src/operation/entity/selectors.ts","../../../libs/core/state/src/operation/entity/adapter.ts","../../../libs/core/state/src/operation/entity/helpers.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","import { Action } from '@ngrx/store';\n\n/**\n * A simple reducer that simply returns the passed state.\n * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.\n */\nexport const daffIdentityReducer = <T = unknown>(state: T, action: Action): T => state;\n","import { defaultMemoize } from '@ngrx/store';\n\nimport {\n daffCollectionBuildMetadataFromRequest,\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * Provides an abstracted way to manage a collection state.\n */\nexport class DaffCollectionStateAdapter<T extends DaffCollectionMetadata = DaffCollectionMetadata> {\n /**\n * Stores a collection request in state.\n * This is useful when you want to preemptively reduce a request before waiting for a response.\n */\n storeRequest(request: DaffCollectionRequest, state: T): T {\n return {\n ...state,\n ...daffCollectionBuildMetadataFromRequest(request),\n };\n }\n\n /**\n * Sets the page size.\n */\n setPageSize(size: number, state: T): T {\n return {\n ...state,\n pageSize: size,\n currentPage: 1,\n };\n }\n\n /**\n * Sets the current page.\n */\n setCurrentPage(page: number, state: T): T {\n return {\n ...state,\n currentPage: page,\n };\n }\n\n /**\n * Sets the sorting option and direction.\n */\n setSort(option: string, direction: string, state: T): T {\n return {\n ...state,\n appliedSortOption: option,\n appliedSortDirection: direction,\n };\n }\n\n /**\n * Sets the collection filters.\n */\n setFilters(filters: DaffFilters, state: T): T {\n return {\n ...state,\n currentPage: 1,\n filters: filters || {},\n };\n }\n\n /**\n * Set the entire collection metadata at once.\n */\n setMetadata(metadata: DaffCollectionMetadata, state: T): T {\n return {\n ...state,\n ids: metadata.ids,\n count: metadata.count,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n sortOptions: metadata.sortOptions,\n totalPages: metadata.totalPages,\n appliedSortOption: metadata.appliedSortOption || state.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection || state.appliedSortDirection,\n filters: metadata.filters || {},\n };\n }\n}\n\n/**\n * Create the adapter for the collection state.\n */\nexport const getCollectionStateAdapter: <T extends DaffCollectionMetadata = DaffCollectionMetadata>() => DaffCollectionStateAdapter<T>\n = defaultMemoize(() => new DaffCollectionStateAdapter()).memoized;\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nexport const daffCollectionReducerInitialState: DaffCollectionMetadata = {\n count: 0,\n appliedSortOption: null,\n appliedSortDirection: null,\n currentPage: null,\n pageSize: null,\n totalPages: null,\n sortOptions: {\n default: null,\n options: [],\n },\n ids: [],\n filters: {},\n};\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n daffComputeAppliedFilters,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * An interface to describe all selectors related to the collection metadata.\n */\nexport interface DaffCollectionMemoizedSelectors<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> {\n /**\n * Selects the metadata for the collection.\n */\n selectCollectionMetadata: MemoizedSelector<TState, TMetadata>;\n /**\n * Builds a request that matches the current collection.\n */\n selectCollectionRequest: MemoizedSelector<TState, DaffCollectionRequest>;\n /**\n * Selects the total number of items of the collection.\n */\n selectCollectionCount: MemoizedSelector<TState, TMetadata['count']>;\n /**\n * Selects the current page of items of the collection.\n */\n selectCollectionCurrentPage: MemoizedSelector<TState, TMetadata['currentPage']>;\n /**\n * Selects the total number of pages of items that exist in the collection.\n */\n selectCollectionTotalPages: MemoizedSelector<TState, TMetadata['totalPages']>;\n /**\n * Selects the number of items on each collection.\n */\n selectCollectionPageSize: MemoizedSelector<TState, TMetadata['pageSize']>;\n /**\n * Selects the sort options that may be applied to the collection.\n */\n selectCollectionSortOptions: MemoizedSelector<TState, TMetadata['sortOptions']['options']>;\n /**\n * Selects the applied sorting option if one is applied.\n */\n selectCollectionAppliedSortOption: MemoizedSelector<TState, TMetadata['appliedSortOption']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionAppliedSortDirection: MemoizedSelector<TState, TMetadata['appliedSortDirection']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionIds: MemoizedSelector<TState, TMetadata['ids']>;\n /**\n * Selects the filters that may be applied to the collection.\n */\n selectCollectionFilters: MemoizedSelector<TState, TMetadata['filters']>;\n /**\n * Returns a dict of filters and only their applied options.\n * Filters with no applied options will be omitted.\n */\n selectCollectionAppliedFilters: MemoizedSelector<TState, DaffFilters>;\n}\n\n/**\n * Creates collection selectors.\n *\n * @param selectCollectionState A selector for the particular collection state upon which the returned selectors should operate.\n */\nexport const daffCollectionSelectorFactory = <\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n>(\n selectCollectionState: MemoizedSelector<TState, TMetadata>,\n): DaffCollectionMemoizedSelectors<TState, TMetadata> => {\n\n const selectCollectionMetadata = createSelector(\n selectCollectionState,\n state => state,\n );\n\n const selectCollectionRequest = createSelector(\n selectCollectionMetadata,\n metadata => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n }),\n );\n\n const selectCollectionCount = createSelector(\n selectCollectionMetadata,\n state => state.count,\n );\n\n const selectCollectionCurrentPage = createSelector(\n selectCollectionMetadata,\n state => state.currentPage,\n );\n\n const selectCollectionTotalPages = createSelector(\n selectCollectionMetadata,\n state => state.totalPages,\n );\n\n const selectCollectionPageSize = createSelector(\n selectCollectionMetadata,\n state => state.pageSize,\n );\n\n const selectCollectionSortOptions = createSelector(\n selectCollectionMetadata,\n state => state.sortOptions.options,\n );\n\n const selectCollectionAppliedSortOption = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortOption,\n );\n\n const selectCollectionAppliedSortDirection = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortDirection,\n );\n\n const selectCollectionIds = createSelector(\n selectCollectionMetadata,\n state => state.ids,\n );\n\n const selectCollectionFilters = createSelector(\n selectCollectionMetadata,\n state => state.filters,\n );\n\n const selectCollectionAppliedFilters = createSelector(\n selectCollectionFilters,\n filters => daffComputeAppliedFilters(filters),\n );\n\n return {\n selectCollectionMetadata,\n selectCollectionRequest,\n selectCollectionCount,\n selectCollectionCurrentPage,\n selectCollectionTotalPages,\n selectCollectionPageSize,\n selectCollectionSortOptions,\n selectCollectionAppliedSortOption,\n selectCollectionAppliedSortDirection,\n selectCollectionIds,\n selectCollectionFilters,\n selectCollectionAppliedFilters,\n };\n};\n","import {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\n\nimport { DaffCollectionFacadeInterface } from './facade.interface';\nimport { DaffCollectionMemoizedSelectors } from './selector-factory';\n\n/**\n * An abstract class for a collection facade.\n * It is configurable via its constructor parameters.\n * The particular collection state from which\n * this facade will read is determined by the selectors passed.\n *\n * @inheritdoc\n */\nexport abstract class DaffCollectionFacade<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> implements DaffCollectionFacadeInterface<TMetadata> {\n metadata$: Observable<TMetadata>;\n request$: Observable<DaffCollectionRequest>;\n count$: Observable<number>;\n currentPage$: Observable<number>;\n totalPages$: Observable<number>;\n pageSize$: Observable<number>;\n sortOptions$: Observable<DaffSortOption[]>;\n appliedSortOption$: Observable<string>;\n appliedSortDirection$: Observable<DaffSortDirectionEnum>;\n filters$: Observable<DaffFilters>;\n appliedFilters$: Observable<DaffFilters>;\n\n constructor(\n protected store: Store<TState>,\n selectors: DaffCollectionMemoizedSelectors<TState, TMetadata>,\n ) {\n\t this.metadata$ = this.store.pipe(select(selectors.selectCollectionMetadata));\n\t this.request$ = this.store.pipe(select(selectors.selectCollectionRequest));\n\t this.count$ = this.store.pipe(select(selectors.selectCollectionCount));\n\t this.currentPage$ = this.store.pipe(select(selectors.selectCollectionCurrentPage));\n\t this.totalPages$ = this.store.pipe(select(selectors.selectCollectionTotalPages));\n\t this.pageSize$ = this.store.pipe(select(selectors.selectCollectionPageSize));\n\t this.sortOptions$ = this.store.pipe(select(selectors.selectCollectionSortOptions));\n\t this.appliedSortOption$ = this.store.pipe(select(selectors.selectCollectionAppliedSortOption));\n\t this.appliedSortDirection$ = this.store.pipe(select(selectors.selectCollectionAppliedSortDirection));\n this.filters$ = this.store.pipe(select(selectors.selectCollectionFilters));\n\t this.appliedFilters$ = this.store.pipe(select(selectors.selectCollectionAppliedFilters));\n }\n\n /**\n * Dispatches the given action.\n *\n * @param action action to dispatch.\n */\n dispatch(action: Action) {\n\t this.store.dispatch(action);\n }\n}\n","import { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Puts the state in a \"resolving\" state that correspondes to loading platform data in a GET fashion.\n * Sets loading to `DaffState.Resolving`\n */\nexport function daffStartResolution <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Resolving,\n };\n};\n\n/**\n * Puts the state in a \"mutating\" state that correspondes to loading platform data in a POST or PUT fashion.\n */\nexport function daffStartMutation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Mutating,\n };\n};\n\n/**\n * Indicates a successfully completed operation.\n * Sets loading to stable and resets errors.\n */\nexport function daffCompleteOperation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: [],\n };\n};\n\n/**\n * Indicates a failed operation.\n * Sets loading to stable and stores errors.\n */\nexport function daffOperationFailed <T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: errors,\n };\n};\n\n/**\n * Resets errors.\n */\nexport function daffClearErrors <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffErrors: [],\n };\n};\n","import { DaffErrorable } from '../errors/public_api';\nimport {\n DaffState,\n DaffStateable,\n} from '../states/public_api';\n\n/**\n * A basic operation state.\n * Represents the current state of an operation and any associated errors.\n */\nexport interface DaffOperationState extends DaffErrorable, DaffStateable {}\n\nexport const daffOperationInitialState: DaffOperationState = {\n daffState: DaffState.Stable,\n daffErrors: [],\n};\n","import {\n createSelector,\n MemoizedSelector,\n Selector,\n} from '@ngrx/store';\n\nimport { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationStateSelectors<\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n> {\n /**\n * Selects the loading state enum.\n */\n selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;\n /**\n * Selects whether the operation state is in any of the loading states.\n */\n selectLoading: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is resolving.\n */\n selectResolving: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is mutating.\n */\n selectMutating: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects the errors in the operation state.\n */\n selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;\n /**\n * Selects whether the operation state has any errors.\n * If so, it should be considered to be in an \"error\" state.\n */\n selectHasErrors: MemoizedSelector<TRootState, boolean>;\n}\n\n/**\n * Creates a set of selectors for an operation state.\n *\n * @param selectState The feature selector for the operation state.\n */\nexport function daffOperationStateSelectorFactory <\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n>(\n selectState: Selector<TRootState, TState>,\n): DaffOperationStateSelectors<TRootState, TState> {\n const selectLoadingState = createSelector(\n selectState,\n state => state.daffState,\n );\n const selectLoading = createSelector(\n selectLoadingState,\n loadingState => loadingState !== DaffState.Stable,\n );\n const selectResolving = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Resolving,\n );\n const selectMutating = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Mutating,\n );\n const selectErrors = createSelector(\n selectState,\n state => state.daffErrors,\n );\n const selectHasErrors = createSelector(\n selectErrors,\n errors => errors.length > 0,\n );\n\n return {\n selectLoadingState,\n selectLoading,\n selectResolving,\n selectMutating,\n selectErrors,\n selectHasErrors,\n };\n};\n","import type { EntitySelectors } from '@ngrx/entity/src/models';\nimport {\n createSelector,\n defaultMemoize,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffOperationEntity } from './type';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationEntityStateSelectors<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n> {\n /**\n * Selects an entity by ID.\n */\n selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;\n\n /**\n * Optimistically selects the list of entities.\n * This excludes temporary entities with errors.\n */\n selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;\n}\n\n/**\n * Creates a set of selectors for an entity operation state.\n *\n * @param selectState The feature selector for the entity operation state.\n */\nexport function daffOperationEntityStateSelectorFactory<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n>(\n entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>,\n): DaffOperationEntityStateSelectors<TRootState, T> {\n const selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>\n = defaultMemoize((id) => createSelector(\n entitySelectors.selectEntities,\n entities => entities[id],\n )).memoized;\n\n const selectOptimisticList = createSelector(\n entitySelectors.selectAll,\n (entities) => entities.filter(entity =>\n // ignore entities that are deleting\n // entity.daffState !== DaffState.Deleting &&\n // ignore placeholders with errors\n !(entity.daffTemp && entity.daffErrors.length > 0),\n ),\n );\n\n return {\n selectEntity,\n selectOptimisticList,\n };\n};\n","import {\n createEntityAdapter,\n EntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffStateError } from '../../errors/public_api';\nimport { DaffState } from '../../states/public_api';\nimport {\n daffOperationEntityStateSelectorFactory,\n DaffOperationEntityStateSelectors,\n} from './selectors';\nimport { DaffOperationEntityState } from './state.type';\nimport { DaffOperationEntity } from './type';\n\n/**\n * An entity state adapter that takes care of managing contextual operation and error state for entities.\n */\nexport interface DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> {\n /**\n * Stores a list of entities in state and resets them all to stable.\n */\n list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;\n /**\n * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.\n */\n preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;\n /**\n * Upserts the entity into state and resets operation state and errors.\n */\n load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;\n /**\n * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.\n */\n preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Adds the entity into state, sets operation state to added, and resets errors.\n */\n add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Sets the entity's operation state to mutating.\n */\n preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Upserts the entity into state, sets operation state to mutated, and resets errors.\n */\n update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Sets the entity's operation state to deleting.\n */\n preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Removes the entity from state.\n */\n remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Resets the entity's operation state and stores errors on the entity.\n */\n operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;\n /**\n * Resets the entity's operation state to stable.\n */\n resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Gets an empty entity state.\n */\n getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;\n /**\n * Gets entity selectors.\n */\n getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;\n}\n\nexport function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {\n return {\n list: (entities, state) => adapter.setAll(\n entities.map<DaffOperationEntity<T>>(entity => ({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n })),\n state,\n ),\n preload: (key, state) =>\n adapter.upsertOne(<DaffOperationEntity<T>>{\n // TODO: allow for non identifiable entities?\n id: key,\n daffState: DaffState.Resolving,\n daffErrors: [],\n daffTemp: !state.entities[key],\n }, state),\n load: (entity, state) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n }, state),\n preadd: (entity, state, placeholderId) =>\n placeholderId\n ? adapter.addOne({\n ...entity,\n // TODO: allow for non identifiable entities?\n id: placeholderId,\n daffState: DaffState.Adding,\n daffErrors: [],\n daffTemp: true,\n }, state)\n : state,\n add: (entity, state, placeholderId) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Added,\n daffErrors: [],\n daffTemp: false,\n }, placeholderId ? adapter.removeOne(placeholderId, state) : state),\n preupdate: (entity, state) =>\n adapter.upsertOne({\n ...state.entities[entity.id],\n daffState: DaffState.Mutating,\n daffErrors: [],\n }, state),\n update: (entity, state) =>\n adapter.updateOne({\n id: entity.id,\n changes: <Partial<DaffOperationEntity<T>>>{\n ...entity,\n daffState: DaffState.Mutated,\n daffErrors: [],\n daffTemp: false,\n },\n }, state),\n preremove: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffErrors: [],\n daffState: DaffState.Deleting,\n }, state),\n remove: adapter.removeOne,\n operationFailed: (key, errors, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n daffErrors: errors,\n }, state),\n resetState: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n }, state),\n getInitialState: adapter.getInitialState,\n getSelectors: <TRootState>(selectState) => daffOperationEntityStateSelectorFactory<TRootState, T>(adapter.getSelectors(selectState)),\n };\n}\n","import { DaffState } from '../../states/public_api';\n\n/**\n * Returns whether the state is one that represents an operation in progress.\n */\nexport function daffStateIsLoading(daffState: DaffState): boolean {\n return daffState === DaffState.Adding\n || daffState === DaffState.Mutating\n || daffState === DaffState.Resolving\n || daffState === DaffState.Deleting;\n}\n\n/**\n * Generate a fake ID for use with placeholder entities.\n *\n * @param key An optional key that can augment the randomly generated ID.\n * @returns A string cont\n */\nexport function daffOperationEntityCreateFakeId(key: string = ''): string {\n return `ε-${Date.now()}-${key}`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;AAChE,MAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACU,MAAA,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB,KAAI;AAClF,IAAA,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;AACpF,IAAA,MAAM,0BAA0B,GAAG,CAAC,gBAAgB,EAAE,MAAM,KAC1D,yBAAyB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;AAClE,UAAE;AACA,YAAA,GAAG,gBAAgB;YACnB,MAAM;AACP,SAAA;UACC,gBAAgB,CAAC;IAEvB,OAAO,IAAI,CACT,IAAI,CAAmB,CAAC,gBAAgB,EAAE,MAAM,KAC9C,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;AAEnC,UAAE,EAAE;AACJ,UAAE,0BAA0B;;QAE1B,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,gBAAgB,EACrD,MAAM,CACP,EACL,EAAE,CAAC,EACH,MAAM,CAAC,WAAW,CAAC,CACpB,CAAC;AACJ;;ACrDA;;AAEG;AACG,SAAU,8BAA8B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAa,EAAA;AACtF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gB,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;KACrI,CAAC;AACJ;;ACzJA;;AAEG;AACG,SAAU,kBAAkB,CAAC,SAAoB,EAAA;AACrD,IAAA,OAAO,SAAS,KAAqB,QAAA;WAChC,SAAS,KAAuB,UAAA;WAChC,SAAS,KAAwB,WAAA;AACjC,WAAA,SAAS,+BAAwB;AACxC,CAAC;AAED;;;;;AAKG;AACa,SAAA,+BAA+B,CAAC,GAAA,GAAc,EAAE,EAAA;IAC9D,OAAO,CAAA,EAAA,EAAK,IAAI,CAAC,GAAG,EAAE,CAAI,CAAA,EAAA,GAAG,EAAE,CAAC;AAClC;;ACpBA;;AAEG;;;;"}
|
|
@@ -87,7 +87,7 @@ function daffRouterStateNavigatedClearEntityErrorsReducerFactory(adapter = creat
|
|
|
87
87
|
case ROUTER_NAVIGATED:
|
|
88
88
|
return adapter.map((entity) => ({
|
|
89
89
|
...entity,
|
|
90
|
-
|
|
90
|
+
daffErrors: [],
|
|
91
91
|
}), state);
|
|
92
92
|
default:
|
|
93
93
|
return state;
|
|
@@ -103,7 +103,7 @@ function daffRouterStateNavigatedClearErrorsReducer(state, action) {
|
|
|
103
103
|
case ROUTER_NAVIGATED:
|
|
104
104
|
return {
|
|
105
105
|
...state,
|
|
106
|
-
|
|
106
|
+
daffErrors: [],
|
|
107
107
|
};
|
|
108
108
|
default:
|
|
109
109
|
return state;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-routing.mjs","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated-entity-reducer-factory.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated.reducer.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","import {\n createEntityAdapter,\n EntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * Creates a reducer that will clear all contextual errors from entities in state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearEntityErrorsReducerFactory<T extends DaffErrorable = DaffErrorable>(adapter: EntityAdapter<T> = createEntityAdapter<T>()) {\n return (state: EntityState<T>, action: RouterAction<unknown>): EntityState<T> => {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return adapter.map(\n (entity) => ({\n ...entity,\n
|
|
1
|
+
{"version":3,"file":"daffodil-core-routing.mjs","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated-entity-reducer-factory.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated.reducer.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","import {\n createEntityAdapter,\n EntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * Creates a reducer that will clear all contextual errors from entities in state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearEntityErrorsReducerFactory<T extends DaffErrorable = DaffErrorable>(adapter: EntityAdapter<T> = createEntityAdapter<T>()) {\n return (state: EntityState<T>, action: RouterAction<unknown>): EntityState<T> => {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return adapter.map(\n (entity) => ({\n ...entity,\n daffErrors: [],\n }),\n state,\n );\n\n default:\n return state;\n }\n };\n}\n","import {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * A reducer that will clear all errors from state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearErrorsReducer<T extends DaffErrorable = DaffErrorable>(state: T, action: RouterAction<unknown>): T {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return {\n ...state,\n daffErrors: [],\n };\n\n default:\n return state;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AACI,MAAM,kCAAkC,GAAG,aAAa;AAC/D;;AAEG;MACU,4BAA4B,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,GAAG,CAAC,CAAC,IAAI;;ACR3H;;;AAGG;AACU,MAAA,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG,kBAAkB;AACnE;;;AAGG;MACU,2BAA2B,GAAG,CAAC,GAAW,KACrD,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC,GAAG,I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nB,iBAAA,CAAA;;;ACAD;;AAEG;AACa,SAAA,uDAAuD,CAA0C,OAAA,GAA4B,mBAAmB,EAAK,EAAA;AACnK,IAAA,OAAO,CAAC,KAAqB,EAAE,MAA6B,KAAoB;QAC9E,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,gBAAgB;gBACnB,OAAO,OAAO,CAAC,GAAG,CAChB,CAAC,MAAM,MAAM;AACX,oBAAA,GAAG,MAAM;AACT,oBAAA,UAAU,EAAE,EAAE;iBACf,CAAC,EACF,KAAK,CACN,CAAC;AAEJ,YAAA;AACE,gBAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AACH,KAAC,CAAC;AACJ;;ACxBA;;AAEG;AACa,SAAA,0CAA0C,CAA0C,KAAQ,EAAE,MAA6B,EAAA;IACzI,QAAQ,MAAM,CAAC,IAAI;AACjB,QAAA,KAAK,gBAAgB;YACnB,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,UAAU,EAAE,EAAE;aACf,CAAC;AAEJ,QAAA;AACE,YAAA,OAAO,KAAK,CAAC;AAChB,KAAA;AACH;;ACrBA;;AAEG;;;;"}
|
|
@@ -234,7 +234,7 @@ class DaffCollectionFacade {
|
|
|
234
234
|
function daffStartResolution(state) {
|
|
235
235
|
return {
|
|
236
236
|
...state,
|
|
237
|
-
|
|
237
|
+
daffState: "Resolving" /* Resolving */,
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
240
|
;
|
|
@@ -244,7 +244,7 @@ function daffStartResolution(state) {
|
|
|
244
244
|
function daffStartMutation(state) {
|
|
245
245
|
return {
|
|
246
246
|
...state,
|
|
247
|
-
|
|
247
|
+
daffState: "Mutating" /* Mutating */,
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
;
|
|
@@ -255,8 +255,8 @@ function daffStartMutation(state) {
|
|
|
255
255
|
function daffCompleteOperation(state) {
|
|
256
256
|
return {
|
|
257
257
|
...state,
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
daffState: "Stable" /* Stable */,
|
|
259
|
+
daffErrors: [],
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
;
|
|
@@ -267,8 +267,8 @@ function daffCompleteOperation(state) {
|
|
|
267
267
|
function daffOperationFailed(errors, state) {
|
|
268
268
|
return {
|
|
269
269
|
...state,
|
|
270
|
-
|
|
271
|
-
errors,
|
|
270
|
+
daffState: "Stable" /* Stable */,
|
|
271
|
+
daffErrors: errors,
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
;
|
|
@@ -278,14 +278,14 @@ function daffOperationFailed(errors, state) {
|
|
|
278
278
|
function daffClearErrors(state) {
|
|
279
279
|
return {
|
|
280
280
|
...state,
|
|
281
|
-
|
|
281
|
+
daffErrors: [],
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
;
|
|
285
285
|
|
|
286
286
|
const daffOperationInitialState = {
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
daffState: "Stable" /* Stable */,
|
|
288
|
+
daffErrors: [],
|
|
289
289
|
};
|
|
290
290
|
|
|
291
291
|
/**
|
|
@@ -294,11 +294,11 @@ const daffOperationInitialState = {
|
|
|
294
294
|
* @param selectState The feature selector for the operation state.
|
|
295
295
|
*/
|
|
296
296
|
function daffOperationStateSelectorFactory(selectState) {
|
|
297
|
-
const selectLoadingState = createSelector(selectState, state => state.
|
|
297
|
+
const selectLoadingState = createSelector(selectState, state => state.daffState);
|
|
298
298
|
const selectLoading = createSelector(selectLoadingState, loadingState => loadingState !== "Stable" /* Stable */);
|
|
299
299
|
const selectResolving = createSelector(selectLoadingState, loadingState => loadingState === "Resolving" /* Resolving */);
|
|
300
300
|
const selectMutating = createSelector(selectLoadingState, loadingState => loadingState === "Mutating" /* Mutating */);
|
|
301
|
-
const selectErrors = createSelector(selectState, state => state.
|
|
301
|
+
const selectErrors = createSelector(selectState, state => state.daffErrors);
|
|
302
302
|
const selectHasErrors = createSelector(selectErrors, errors => errors.length > 0);
|
|
303
303
|
return {
|
|
304
304
|
selectLoadingState,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daffodil-core-state.mjs","sources":["../../../libs/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/reducers/identity.ts","../../../libs/core/state/src/collection/adapter.class.ts","../../../libs/core/state/src/collection/initial-state.ts","../../../libs/core/state/src/collection/selector-factory.ts","../../../libs/core/state/src/collection/facade.ts","../../../libs/core/state/src/operation/adapter.ts","../../../libs/core/state/src/operation/state.ts","../../../libs/core/state/src/operation/selectors.ts","../../../libs/core/state/src/operation/entity/selectors.ts","../../../libs/core/state/src/operation/entity/adapter.ts","../../../libs/core/state/src/operation/entity/helpers.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","import { Action } from '@ngrx/store';\n\n/**\n * A simple reducer that simply returns the passed state.\n * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.\n */\nexport const daffIdentityReducer = <T = unknown>(state: T, action: Action): T => state;\n","import { defaultMemoize } from '@ngrx/store';\n\nimport {\n daffCollectionBuildMetadataFromRequest,\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * Provides an abstracted way to manage a collection state.\n */\nexport class DaffCollectionStateAdapter<T extends DaffCollectionMetadata = DaffCollectionMetadata> {\n /**\n * Stores a collection request in state.\n * This is useful when you want to preemptively reduce a request before waiting for a response.\n */\n storeRequest(request: DaffCollectionRequest, state: T): T {\n return {\n ...state,\n ...daffCollectionBuildMetadataFromRequest(request),\n };\n }\n\n /**\n * Sets the page size.\n */\n setPageSize(size: number, state: T): T {\n return {\n ...state,\n pageSize: size,\n currentPage: 1,\n };\n }\n\n /**\n * Sets the current page.\n */\n setCurrentPage(page: number, state: T): T {\n return {\n ...state,\n currentPage: page,\n };\n }\n\n /**\n * Sets the sorting option and direction.\n */\n setSort(option: string, direction: string, state: T): T {\n return {\n ...state,\n appliedSortOption: option,\n appliedSortDirection: direction,\n };\n }\n\n /**\n * Sets the collection filters.\n */\n setFilters(filters: DaffFilters, state: T): T {\n return {\n ...state,\n currentPage: 1,\n filters: filters || {},\n };\n }\n\n /**\n * Set the entire collection metadata at once.\n */\n setMetadata(metadata: DaffCollectionMetadata, state: T): T {\n return {\n ...state,\n ids: metadata.ids,\n count: metadata.count,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n sortOptions: metadata.sortOptions,\n totalPages: metadata.totalPages,\n appliedSortOption: metadata.appliedSortOption || state.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection || state.appliedSortDirection,\n filters: metadata.filters || {},\n };\n }\n}\n\n/**\n * Create the adapter for the collection state.\n */\nexport const getCollectionStateAdapter: <T extends DaffCollectionMetadata = DaffCollectionMetadata>() => DaffCollectionStateAdapter<T>\n = defaultMemoize(() => new DaffCollectionStateAdapter()).memoized;\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nexport const daffCollectionReducerInitialState: DaffCollectionMetadata = {\n count: 0,\n appliedSortOption: null,\n appliedSortDirection: null,\n currentPage: null,\n pageSize: null,\n totalPages: null,\n sortOptions: {\n default: null,\n options: [],\n },\n ids: [],\n filters: {},\n};\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n daffComputeAppliedFilters,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * An interface to describe all selectors related to the collection metadata.\n */\nexport interface DaffCollectionMemoizedSelectors<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> {\n /**\n * Selects the metadata for the collection.\n */\n selectCollectionMetadata: MemoizedSelector<TState, TMetadata>;\n /**\n * Builds a request that matches the current collection.\n */\n selectCollectionRequest: MemoizedSelector<TState, DaffCollectionRequest>;\n /**\n * Selects the total number of items of the collection.\n */\n selectCollectionCount: MemoizedSelector<TState, TMetadata['count']>;\n /**\n * Selects the current page of items of the collection.\n */\n selectCollectionCurrentPage: MemoizedSelector<TState, TMetadata['currentPage']>;\n /**\n * Selects the total number of pages of items that exist in the collection.\n */\n selectCollectionTotalPages: MemoizedSelector<TState, TMetadata['totalPages']>;\n /**\n * Selects the number of items on each collection.\n */\n selectCollectionPageSize: MemoizedSelector<TState, TMetadata['pageSize']>;\n /**\n * Selects the sort options that may be applied to the collection.\n */\n selectCollectionSortOptions: MemoizedSelector<TState, TMetadata['sortOptions']['options']>;\n /**\n * Selects the applied sorting option if one is applied.\n */\n selectCollectionAppliedSortOption: MemoizedSelector<TState, TMetadata['appliedSortOption']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionAppliedSortDirection: MemoizedSelector<TState, TMetadata['appliedSortDirection']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionIds: MemoizedSelector<TState, TMetadata['ids']>;\n /**\n * Selects the filters that may be applied to the collection.\n */\n selectCollectionFilters: MemoizedSelector<TState, TMetadata['filters']>;\n /**\n * Returns a dict of filters and only their applied options.\n * Filters with no applied options will be omitted.\n */\n selectCollectionAppliedFilters: MemoizedSelector<TState, DaffFilters>;\n}\n\n/**\n * Creates collection selectors.\n *\n * @param selectCollectionState A selector for the particular collection state upon which the returned selectors should operate.\n */\nexport const daffCollectionSelectorFactory = <\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n>(\n selectCollectionState: MemoizedSelector<TState, TMetadata>,\n): DaffCollectionMemoizedSelectors<TState, TMetadata> => {\n\n const selectCollectionMetadata = createSelector(\n selectCollectionState,\n state => state,\n );\n\n const selectCollectionRequest = createSelector(\n selectCollectionMetadata,\n metadata => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n }),\n );\n\n const selectCollectionCount = createSelector(\n selectCollectionMetadata,\n state => state.count,\n );\n\n const selectCollectionCurrentPage = createSelector(\n selectCollectionMetadata,\n state => state.currentPage,\n );\n\n const selectCollectionTotalPages = createSelector(\n selectCollectionMetadata,\n state => state.totalPages,\n );\n\n const selectCollectionPageSize = createSelector(\n selectCollectionMetadata,\n state => state.pageSize,\n );\n\n const selectCollectionSortOptions = createSelector(\n selectCollectionMetadata,\n state => state.sortOptions.options,\n );\n\n const selectCollectionAppliedSortOption = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortOption,\n );\n\n const selectCollectionAppliedSortDirection = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortDirection,\n );\n\n const selectCollectionIds = createSelector(\n selectCollectionMetadata,\n state => state.ids,\n );\n\n const selectCollectionFilters = createSelector(\n selectCollectionMetadata,\n state => state.filters,\n );\n\n const selectCollectionAppliedFilters = createSelector(\n selectCollectionFilters,\n filters => daffComputeAppliedFilters(filters),\n );\n\n return {\n selectCollectionMetadata,\n selectCollectionRequest,\n selectCollectionCount,\n selectCollectionCurrentPage,\n selectCollectionTotalPages,\n selectCollectionPageSize,\n selectCollectionSortOptions,\n selectCollectionAppliedSortOption,\n selectCollectionAppliedSortDirection,\n selectCollectionIds,\n selectCollectionFilters,\n selectCollectionAppliedFilters,\n };\n};\n","import {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\n\nimport { DaffCollectionFacadeInterface } from './facade.interface';\nimport { DaffCollectionMemoizedSelectors } from './selector-factory';\n\n/**\n * An abstract class for a collection facade.\n * It is configurable via its constructor parameters.\n * The particular collection state from which\n * this facade will read is determined by the selectors passed.\n *\n * @inheritdoc\n */\nexport abstract class DaffCollectionFacade<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> implements DaffCollectionFacadeInterface<TMetadata> {\n metadata$: Observable<TMetadata>;\n request$: Observable<DaffCollectionRequest>;\n count$: Observable<number>;\n currentPage$: Observable<number>;\n totalPages$: Observable<number>;\n pageSize$: Observable<number>;\n sortOptions$: Observable<DaffSortOption[]>;\n appliedSortOption$: Observable<string>;\n appliedSortDirection$: Observable<DaffSortDirectionEnum>;\n filters$: Observable<DaffFilters>;\n appliedFilters$: Observable<DaffFilters>;\n\n constructor(\n protected store: Store<TState>,\n selectors: DaffCollectionMemoizedSelectors<TState, TMetadata>,\n ) {\n\t this.metadata$ = this.store.pipe(select(selectors.selectCollectionMetadata));\n\t this.request$ = this.store.pipe(select(selectors.selectCollectionRequest));\n\t this.count$ = this.store.pipe(select(selectors.selectCollectionCount));\n\t this.currentPage$ = this.store.pipe(select(selectors.selectCollectionCurrentPage));\n\t this.totalPages$ = this.store.pipe(select(selectors.selectCollectionTotalPages));\n\t this.pageSize$ = this.store.pipe(select(selectors.selectCollectionPageSize));\n\t this.sortOptions$ = this.store.pipe(select(selectors.selectCollectionSortOptions));\n\t this.appliedSortOption$ = this.store.pipe(select(selectors.selectCollectionAppliedSortOption));\n\t this.appliedSortDirection$ = this.store.pipe(select(selectors.selectCollectionAppliedSortDirection));\n this.filters$ = this.store.pipe(select(selectors.selectCollectionFilters));\n\t this.appliedFilters$ = this.store.pipe(select(selectors.selectCollectionAppliedFilters));\n }\n\n /**\n * Dispatches the given action.\n *\n * @param action action to dispatch.\n */\n dispatch(action: Action) {\n\t this.store.dispatch(action);\n }\n}\n","import { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Puts the state in a \"resolving\" state that correspondes to loading platform data in a GET fashion.\n * Sets loading to `DaffState.Resolving`\n */\nexport function daffStartResolution <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n loading: DaffState.Resolving,\n };\n};\n\n/**\n * Puts the state in a \"mutating\" state that correspondes to loading platform data in a POST or PUT fashion.\n */\nexport function daffStartMutation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n loading: DaffState.Mutating,\n };\n};\n\n/**\n * Indicates a successfully completed operation.\n * Sets loading to stable and resets errors.\n */\nexport function daffCompleteOperation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n loading: DaffState.Stable,\n errors: [],\n };\n};\n\n/**\n * Indicates a failed operation.\n * Sets loading to stable and stores errors.\n */\nexport function daffOperationFailed <T extends DaffOperationState = DaffOperationState>(errors: T['errors'], state: T): T {\n return {\n ...state,\n loading: DaffState.Stable,\n errors,\n };\n};\n\n/**\n * Resets errors.\n */\nexport function daffClearErrors <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n errors: [],\n };\n};\n","import { DaffStateError } from '../errors/public_api';\nimport { DaffState } from '../states/public_api';\n\n/**\n * A basic operation state.\n * Represents the current state of an operation and any associated errors.\n */\nexport interface DaffOperationState {\n /**\n * The loading state of the operations backed by this state.\n */\n loading: DaffState;\n\n /**\n * The errors generated by the most recent operation.\n */\n errors: DaffStateError[];\n}\n\nexport const daffOperationInitialState: DaffOperationState = {\n loading: DaffState.Stable,\n errors: [],\n};\n","import {\n createSelector,\n MemoizedSelector,\n Selector,\n} from '@ngrx/store';\n\nimport { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationStateSelectors<\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n> {\n /**\n * Selects the loading state enum.\n */\n selectLoadingState: MemoizedSelector<TRootState, TState['loading']>;\n /**\n * Selects whether the operation state is in any of the loading states.\n */\n selectLoading: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is resolving.\n */\n selectResolving: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is mutating.\n */\n selectMutating: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects the errors in the operation state.\n */\n selectErrors: MemoizedSelector<TRootState, TState['errors']>;\n /**\n * Selects whether the operation state has any errors.\n * If so, it should be considered to be in an \"error\" state.\n */\n selectHasErrors: MemoizedSelector<TRootState, boolean>;\n}\n\n/**\n * Creates a set of selectors for an operation state.\n *\n * @param selectState The feature selector for the operation state.\n */\nexport function daffOperationStateSelectorFactory <\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n>(\n selectState: Selector<TRootState, TState>,\n): DaffOperationStateSelectors<TRootState, TState> {\n const selectLoadingState = createSelector(\n selectState,\n state => state.loading,\n );\n const selectLoading = createSelector(\n selectLoadingState,\n loadingState => loadingState !== DaffState.Stable,\n );\n const selectResolving = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Resolving,\n );\n const selectMutating = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Mutating,\n );\n const selectErrors = createSelector(\n selectState,\n state => state.errors,\n );\n const selectHasErrors = createSelector(\n selectErrors,\n errors => errors.length > 0,\n );\n\n return {\n selectLoadingState,\n selectLoading,\n selectResolving,\n selectMutating,\n selectErrors,\n selectHasErrors,\n };\n};\n","import type { EntitySelectors } from '@ngrx/entity/src/models';\nimport {\n createSelector,\n defaultMemoize,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffOperationEntity } from './type';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationEntityStateSelectors<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n> {\n /**\n * Selects an entity by ID.\n */\n selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;\n\n /**\n * Optimistically selects the list of entities.\n * This excludes temporary entities with errors.\n */\n selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;\n}\n\n/**\n * Creates a set of selectors for an entity operation state.\n *\n * @param selectState The feature selector for the entity operation state.\n */\nexport function daffOperationEntityStateSelectorFactory<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n>(\n entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>,\n): DaffOperationEntityStateSelectors<TRootState, T> {\n const selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>\n = defaultMemoize((id) => createSelector(\n entitySelectors.selectEntities,\n entities => entities[id],\n )).memoized;\n\n const selectOptimisticList = createSelector(\n entitySelectors.selectAll,\n (entities) => entities.filter(entity =>\n // ignore entities that are deleting\n // entity.daffState !== DaffState.Deleting &&\n // ignore placeholders with errors\n !(entity.daffTemp && entity.daffErrors.length > 0),\n ),\n );\n\n return {\n selectEntity,\n selectOptimisticList,\n };\n};\n","import {\n createEntityAdapter,\n EntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffStateError } from '../../errors/public_api';\nimport { DaffState } from '../../states/public_api';\nimport {\n daffOperationEntityStateSelectorFactory,\n DaffOperationEntityStateSelectors,\n} from './selectors';\nimport { DaffOperationEntityState } from './state.type';\nimport { DaffOperationEntity } from './type';\n\n/**\n * An entity state adapter that takes care of managing contextual operation and error state for entities.\n */\nexport interface DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> {\n /**\n * Stores a list of entities in state and resets them all to stable.\n */\n list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;\n /**\n * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.\n */\n preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;\n /**\n * Upserts the entity into state and resets operation state and errors.\n */\n load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;\n /**\n * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.\n */\n preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Adds the entity into state, sets operation state to added, and resets errors.\n */\n add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Sets the entity's operation state to mutating.\n */\n preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Upserts the entity into state, sets operation state to mutated, and resets errors.\n */\n update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Sets the entity's operation state to deleting.\n */\n preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Removes the entity from state.\n */\n remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Resets the entity's operation state and stores errors on the entity.\n */\n operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;\n /**\n * Resets the entity's operation state to stable.\n */\n resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Gets an empty entity state.\n */\n getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;\n /**\n * Gets entity selectors.\n */\n getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;\n}\n\nexport function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {\n return {\n list: (entities, state) => adapter.setAll(\n entities.map<DaffOperationEntity<T>>(entity => ({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n })),\n state,\n ),\n preload: (key, state) =>\n adapter.upsertOne(<DaffOperationEntity<T>>{\n // TODO: allow for non identifiable entities?\n id: key,\n daffState: DaffState.Resolving,\n daffErrors: [],\n daffTemp: !state.entities[key],\n }, state),\n load: (entity, state) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n }, state),\n preadd: (entity, state, placeholderId) =>\n placeholderId\n ? adapter.addOne({\n ...entity,\n // TODO: allow for non identifiable entities?\n id: placeholderId,\n daffState: DaffState.Adding,\n daffErrors: [],\n daffTemp: true,\n }, state)\n : state,\n add: (entity, state, placeholderId) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Added,\n daffErrors: [],\n daffTemp: false,\n }, placeholderId ? adapter.removeOne(placeholderId, state) : state),\n preupdate: (entity, state) =>\n adapter.upsertOne({\n ...state.entities[entity.id],\n daffState: DaffState.Mutating,\n daffErrors: [],\n }, state),\n update: (entity, state) =>\n adapter.updateOne({\n id: entity.id,\n changes: <Partial<DaffOperationEntity<T>>>{\n ...entity,\n daffState: DaffState.Mutated,\n daffErrors: [],\n daffTemp: false,\n },\n }, state),\n preremove: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffErrors: [],\n daffState: DaffState.Deleting,\n }, state),\n remove: adapter.removeOne,\n operationFailed: (key, errors, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n daffErrors: errors,\n }, state),\n resetState: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n }, state),\n getInitialState: adapter.getInitialState,\n getSelectors: <TRootState>(selectState) => daffOperationEntityStateSelectorFactory<TRootState, T>(adapter.getSelectors(selectState)),\n };\n}\n","import { DaffState } from '../../states/public_api';\n\n/**\n * Returns whether the state is one that represents an operation in progress.\n */\nexport function daffStateIsLoading(daffState: DaffState): boolean {\n return daffState === DaffState.Adding\n || daffState === DaffState.Mutating\n || daffState === DaffState.Resolving\n || daffState === DaffState.Deleting;\n}\n\n/**\n * Generate a fake ID for use with placeholder entities.\n *\n * @param key An optional key that can augment the randomly generated ID.\n * @returns A string cont\n */\nexport function daffOperationEntityCreateFakeId(key: string = ''): string {\n return `ε-${Date.now()}-${key}`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;AAChE,MAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACU,MAAA,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB,KAAI;AAClF,IAAA,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;AACpF,IAAA,MAAM,0BAA0B,GAAG,CAAC,gBAAgB,EAAE,MAAM,KAC1D,yBAAyB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;AAClE,UAAE;AACA,YAAA,GAAG,gBAAgB;YACnB,MAAM;AACP,SAAA;UACC,gBAAgB,CAAC;IAEvB,OAAO,IAAI,CACT,IAAI,CAAmB,CAAC,gBAAgB,EAAE,MAAM,KAC9C,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;AAEnC,UAAE,EAAE;AACJ,UAAE,0BAA0B;;QAE1B,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,gBA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s/core/state/src/operators/substream.pipe.ts","../../../libs/core/state/src/errors/transform-error-to-state-error.ts","../../../libs/core/state/src/reducers/create-meta.ts","../../../libs/core/state/src/reducers/identity.ts","../../../libs/core/state/src/collection/adapter.class.ts","../../../libs/core/state/src/collection/initial-state.ts","../../../libs/core/state/src/collection/selector-factory.ts","../../../libs/core/state/src/collection/facade.ts","../../../libs/core/state/src/operation/adapter.ts","../../../libs/core/state/src/operation/state.ts","../../../libs/core/state/src/operation/selectors.ts","../../../libs/core/state/src/operation/entity/selectors.ts","../../../libs/core/state/src/operation/entity/adapter.ts","../../../libs/core/state/src/operation/entity/helpers.ts","../../../libs/core/state/src/daffodil-core-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\nimport { pipe } from 'rxjs';\nimport {\n scan,\n filter,\n} from 'rxjs/operators';\n\nexport type ActionType = Action['type'];\nexport type ActionSequenceStep = ActionType | ActionType[];\nexport type ActionSequence = ActionSequenceStep[];\n\nconst compareActionSequenceStep = (step: ActionSequenceStep, action: Action): boolean => Array.isArray(step)\n ? step.reduce((acc, type) => acc || action.type === type, false)\n : action.type === step;\n\n/**\n * Watches for a particular stream of actions in the specified order and\n * emits a list of those actions once all sequence steps have been matched.\n *\n * This will find the first occurence of the substream and not necessarily the most concise or recent substream.\n * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].\n * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.\n *\n * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.\n * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).\n * An action stream of [A1, C1] would cause substream to emit [A1, C1].\n * An action stream of [B1, C1] would cause substream to emit [B1, C1].\n * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].\n *\n * You can optionally pass a list of terminators.\n * If a terminator is encountered in the action stream, any partially matched substream is reset.\n * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].\n *\n * @param sequence The sequence of action types that define the substream to listen for.\n * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.\n */\nexport const substream = (sequence: ActionSequence, ...terminators: ActionType[]) => {\n const isFullMatch = matchedSubstream => matchedSubstream.length === sequence.length;\n const accumulateMatchedSubstream = (matchedSubstream, action) =>\n compareActionSequenceStep(sequence[matchedSubstream.length], action)\n ? [\n ...matchedSubstream,\n action,\n ]\n : matchedSubstream;\n\n return pipe(\n scan<Action, Action[]>((matchedSubstream, action) =>\n terminators.indexOf(action.type) > -1\n // terminator found, reset the list\n ? []\n : accumulateMatchedSubstream(\n // reset the list if fully matched\n isFullMatch(matchedSubstream) ? [] : matchedSubstream,\n action,\n ),\n []),\n filter(isFullMatch),\n );\n};\n","import { DaffError } from '@daffodil/core';\n\nimport { DaffStateError } from './state-error.interface';\n\nexport type ErrorTransformer = (DaffError) => DaffStateError;\n\n/**\n * Transforms an error instance to a state error object.\n */\nexport function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError {\n return { code, message, recoverable };\n}\n","import {\n Action,\n ActionReducer,\n} from '@ngrx/store';\n\n/**\n * Creates and returns a composite reducer that invokes each of the passed reducers in turn.\n */\nexport function daffComposeReducers<\n T,\n V extends Action = Action\n>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V> {\n return (state: T, action: V): T =>\n reducers.reduce((nextState, reducer) => reducer(nextState, action), state);\n}\n","import { Action } from '@ngrx/store';\n\n/**\n * A simple reducer that simply returns the passed state.\n * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.\n */\nexport const daffIdentityReducer = <T = unknown>(state: T, action: Action): T => state;\n","import { defaultMemoize } from '@ngrx/store';\n\nimport {\n daffCollectionBuildMetadataFromRequest,\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * Provides an abstracted way to manage a collection state.\n */\nexport class DaffCollectionStateAdapter<T extends DaffCollectionMetadata = DaffCollectionMetadata> {\n /**\n * Stores a collection request in state.\n * This is useful when you want to preemptively reduce a request before waiting for a response.\n */\n storeRequest(request: DaffCollectionRequest, state: T): T {\n return {\n ...state,\n ...daffCollectionBuildMetadataFromRequest(request),\n };\n }\n\n /**\n * Sets the page size.\n */\n setPageSize(size: number, state: T): T {\n return {\n ...state,\n pageSize: size,\n currentPage: 1,\n };\n }\n\n /**\n * Sets the current page.\n */\n setCurrentPage(page: number, state: T): T {\n return {\n ...state,\n currentPage: page,\n };\n }\n\n /**\n * Sets the sorting option and direction.\n */\n setSort(option: string, direction: string, state: T): T {\n return {\n ...state,\n appliedSortOption: option,\n appliedSortDirection: direction,\n };\n }\n\n /**\n * Sets the collection filters.\n */\n setFilters(filters: DaffFilters, state: T): T {\n return {\n ...state,\n currentPage: 1,\n filters: filters || {},\n };\n }\n\n /**\n * Set the entire collection metadata at once.\n */\n setMetadata(metadata: DaffCollectionMetadata, state: T): T {\n return {\n ...state,\n ids: metadata.ids,\n count: metadata.count,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n sortOptions: metadata.sortOptions,\n totalPages: metadata.totalPages,\n appliedSortOption: metadata.appliedSortOption || state.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection || state.appliedSortDirection,\n filters: metadata.filters || {},\n };\n }\n}\n\n/**\n * Create the adapter for the collection state.\n */\nexport const getCollectionStateAdapter: <T extends DaffCollectionMetadata = DaffCollectionMetadata>() => DaffCollectionStateAdapter<T>\n = defaultMemoize(() => new DaffCollectionStateAdapter()).memoized;\n","import { DaffCollectionMetadata } from '@daffodil/core';\n\nexport const daffCollectionReducerInitialState: DaffCollectionMetadata = {\n count: 0,\n appliedSortOption: null,\n appliedSortDirection: null,\n currentPage: null,\n pageSize: null,\n totalPages: null,\n sortOptions: {\n default: null,\n options: [],\n },\n ids: [],\n filters: {},\n};\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n daffComputeAppliedFilters,\n DaffFilters,\n} from '@daffodil/core';\n\n/**\n * An interface to describe all selectors related to the collection metadata.\n */\nexport interface DaffCollectionMemoizedSelectors<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> {\n /**\n * Selects the metadata for the collection.\n */\n selectCollectionMetadata: MemoizedSelector<TState, TMetadata>;\n /**\n * Builds a request that matches the current collection.\n */\n selectCollectionRequest: MemoizedSelector<TState, DaffCollectionRequest>;\n /**\n * Selects the total number of items of the collection.\n */\n selectCollectionCount: MemoizedSelector<TState, TMetadata['count']>;\n /**\n * Selects the current page of items of the collection.\n */\n selectCollectionCurrentPage: MemoizedSelector<TState, TMetadata['currentPage']>;\n /**\n * Selects the total number of pages of items that exist in the collection.\n */\n selectCollectionTotalPages: MemoizedSelector<TState, TMetadata['totalPages']>;\n /**\n * Selects the number of items on each collection.\n */\n selectCollectionPageSize: MemoizedSelector<TState, TMetadata['pageSize']>;\n /**\n * Selects the sort options that may be applied to the collection.\n */\n selectCollectionSortOptions: MemoizedSelector<TState, TMetadata['sortOptions']['options']>;\n /**\n * Selects the applied sorting option if one is applied.\n */\n selectCollectionAppliedSortOption: MemoizedSelector<TState, TMetadata['appliedSortOption']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionAppliedSortDirection: MemoizedSelector<TState, TMetadata['appliedSortDirection']>;\n /**\n * Selects the applied sorting direction if a sorting option is applied.\n */\n selectCollectionIds: MemoizedSelector<TState, TMetadata['ids']>;\n /**\n * Selects the filters that may be applied to the collection.\n */\n selectCollectionFilters: MemoizedSelector<TState, TMetadata['filters']>;\n /**\n * Returns a dict of filters and only their applied options.\n * Filters with no applied options will be omitted.\n */\n selectCollectionAppliedFilters: MemoizedSelector<TState, DaffFilters>;\n}\n\n/**\n * Creates collection selectors.\n *\n * @param selectCollectionState A selector for the particular collection state upon which the returned selectors should operate.\n */\nexport const daffCollectionSelectorFactory = <\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n>(\n selectCollectionState: MemoizedSelector<TState, TMetadata>,\n): DaffCollectionMemoizedSelectors<TState, TMetadata> => {\n\n const selectCollectionMetadata = createSelector(\n selectCollectionState,\n state => state,\n );\n\n const selectCollectionRequest = createSelector(\n selectCollectionMetadata,\n metadata => ({\n appliedSortOption: metadata.appliedSortOption,\n appliedSortDirection: metadata.appliedSortDirection,\n currentPage: metadata.currentPage,\n pageSize: metadata.pageSize,\n }),\n );\n\n const selectCollectionCount = createSelector(\n selectCollectionMetadata,\n state => state.count,\n );\n\n const selectCollectionCurrentPage = createSelector(\n selectCollectionMetadata,\n state => state.currentPage,\n );\n\n const selectCollectionTotalPages = createSelector(\n selectCollectionMetadata,\n state => state.totalPages,\n );\n\n const selectCollectionPageSize = createSelector(\n selectCollectionMetadata,\n state => state.pageSize,\n );\n\n const selectCollectionSortOptions = createSelector(\n selectCollectionMetadata,\n state => state.sortOptions.options,\n );\n\n const selectCollectionAppliedSortOption = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortOption,\n );\n\n const selectCollectionAppliedSortDirection = createSelector(\n selectCollectionMetadata,\n state => state.appliedSortDirection,\n );\n\n const selectCollectionIds = createSelector(\n selectCollectionMetadata,\n state => state.ids,\n );\n\n const selectCollectionFilters = createSelector(\n selectCollectionMetadata,\n state => state.filters,\n );\n\n const selectCollectionAppliedFilters = createSelector(\n selectCollectionFilters,\n filters => daffComputeAppliedFilters(filters),\n );\n\n return {\n selectCollectionMetadata,\n selectCollectionRequest,\n selectCollectionCount,\n selectCollectionCurrentPage,\n selectCollectionTotalPages,\n selectCollectionPageSize,\n selectCollectionSortOptions,\n selectCollectionAppliedSortOption,\n selectCollectionAppliedSortDirection,\n selectCollectionIds,\n selectCollectionFilters,\n selectCollectionAppliedFilters,\n };\n};\n","import {\n Store,\n select,\n Action,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\n\nimport { DaffCollectionFacadeInterface } from './facade.interface';\nimport { DaffCollectionMemoizedSelectors } from './selector-factory';\n\n/**\n * An abstract class for a collection facade.\n * It is configurable via its constructor parameters.\n * The particular collection state from which\n * this facade will read is determined by the selectors passed.\n *\n * @inheritdoc\n */\nexport abstract class DaffCollectionFacade<\n TState,\n TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata\n> implements DaffCollectionFacadeInterface<TMetadata> {\n metadata$: Observable<TMetadata>;\n request$: Observable<DaffCollectionRequest>;\n count$: Observable<number>;\n currentPage$: Observable<number>;\n totalPages$: Observable<number>;\n pageSize$: Observable<number>;\n sortOptions$: Observable<DaffSortOption[]>;\n appliedSortOption$: Observable<string>;\n appliedSortDirection$: Observable<DaffSortDirectionEnum>;\n filters$: Observable<DaffFilters>;\n appliedFilters$: Observable<DaffFilters>;\n\n constructor(\n protected store: Store<TState>,\n selectors: DaffCollectionMemoizedSelectors<TState, TMetadata>,\n ) {\n\t this.metadata$ = this.store.pipe(select(selectors.selectCollectionMetadata));\n\t this.request$ = this.store.pipe(select(selectors.selectCollectionRequest));\n\t this.count$ = this.store.pipe(select(selectors.selectCollectionCount));\n\t this.currentPage$ = this.store.pipe(select(selectors.selectCollectionCurrentPage));\n\t this.totalPages$ = this.store.pipe(select(selectors.selectCollectionTotalPages));\n\t this.pageSize$ = this.store.pipe(select(selectors.selectCollectionPageSize));\n\t this.sortOptions$ = this.store.pipe(select(selectors.selectCollectionSortOptions));\n\t this.appliedSortOption$ = this.store.pipe(select(selectors.selectCollectionAppliedSortOption));\n\t this.appliedSortDirection$ = this.store.pipe(select(selectors.selectCollectionAppliedSortDirection));\n this.filters$ = this.store.pipe(select(selectors.selectCollectionFilters));\n\t this.appliedFilters$ = this.store.pipe(select(selectors.selectCollectionAppliedFilters));\n }\n\n /**\n * Dispatches the given action.\n *\n * @param action action to dispatch.\n */\n dispatch(action: Action) {\n\t this.store.dispatch(action);\n }\n}\n","import { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Puts the state in a \"resolving\" state that correspondes to loading platform data in a GET fashion.\n * Sets loading to `DaffState.Resolving`\n */\nexport function daffStartResolution <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Resolving,\n };\n};\n\n/**\n * Puts the state in a \"mutating\" state that correspondes to loading platform data in a POST or PUT fashion.\n */\nexport function daffStartMutation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Mutating,\n };\n};\n\n/**\n * Indicates a successfully completed operation.\n * Sets loading to stable and resets errors.\n */\nexport function daffCompleteOperation <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: [],\n };\n};\n\n/**\n * Indicates a failed operation.\n * Sets loading to stable and stores errors.\n */\nexport function daffOperationFailed <T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T {\n return {\n ...state,\n daffState: DaffState.Stable,\n daffErrors: errors,\n };\n};\n\n/**\n * Resets errors.\n */\nexport function daffClearErrors <T extends DaffOperationState = DaffOperationState>(state: T): T {\n return {\n ...state,\n daffErrors: [],\n };\n};\n","import { DaffErrorable } from '../errors/public_api';\nimport {\n DaffState,\n DaffStateable,\n} from '../states/public_api';\n\n/**\n * A basic operation state.\n * Represents the current state of an operation and any associated errors.\n */\nexport interface DaffOperationState extends DaffErrorable, DaffStateable {}\n\nexport const daffOperationInitialState: DaffOperationState = {\n daffState: DaffState.Stable,\n daffErrors: [],\n};\n","import {\n createSelector,\n MemoizedSelector,\n Selector,\n} from '@ngrx/store';\n\nimport { DaffState } from '../states/public_api';\nimport { DaffOperationState } from './state';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationStateSelectors<\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n> {\n /**\n * Selects the loading state enum.\n */\n selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;\n /**\n * Selects whether the operation state is in any of the loading states.\n */\n selectLoading: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is resolving.\n */\n selectResolving: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects whether the operation state is mutating.\n */\n selectMutating: MemoizedSelector<TRootState, boolean>;\n /**\n * Selects the errors in the operation state.\n */\n selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;\n /**\n * Selects whether the operation state has any errors.\n * If so, it should be considered to be in an \"error\" state.\n */\n selectHasErrors: MemoizedSelector<TRootState, boolean>;\n}\n\n/**\n * Creates a set of selectors for an operation state.\n *\n * @param selectState The feature selector for the operation state.\n */\nexport function daffOperationStateSelectorFactory <\n TRootState,\n TState extends DaffOperationState = DaffOperationState\n>(\n selectState: Selector<TRootState, TState>,\n): DaffOperationStateSelectors<TRootState, TState> {\n const selectLoadingState = createSelector(\n selectState,\n state => state.daffState,\n );\n const selectLoading = createSelector(\n selectLoadingState,\n loadingState => loadingState !== DaffState.Stable,\n );\n const selectResolving = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Resolving,\n );\n const selectMutating = createSelector(\n selectLoadingState,\n loadingState => loadingState === DaffState.Mutating,\n );\n const selectErrors = createSelector(\n selectState,\n state => state.daffErrors,\n );\n const selectHasErrors = createSelector(\n selectErrors,\n errors => errors.length > 0,\n );\n\n return {\n selectLoadingState,\n selectLoading,\n selectResolving,\n selectMutating,\n selectErrors,\n selectHasErrors,\n };\n};\n","import type { EntitySelectors } from '@ngrx/entity/src/models';\nimport {\n createSelector,\n defaultMemoize,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffOperationEntity } from './type';\n\n/**\n * Selectors for an operation state.\n */\nexport interface DaffOperationEntityStateSelectors<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n> {\n /**\n * Selects an entity by ID.\n */\n selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;\n\n /**\n * Optimistically selects the list of entities.\n * This excludes temporary entities with errors.\n */\n selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;\n}\n\n/**\n * Creates a set of selectors for an entity operation state.\n *\n * @param selectState The feature selector for the entity operation state.\n */\nexport function daffOperationEntityStateSelectorFactory<\n TRootState,\n T extends DaffIdentifiable = DaffIdentifiable\n>(\n entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>,\n): DaffOperationEntityStateSelectors<TRootState, T> {\n const selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>\n = defaultMemoize((id) => createSelector(\n entitySelectors.selectEntities,\n entities => entities[id],\n )).memoized;\n\n const selectOptimisticList = createSelector(\n entitySelectors.selectAll,\n (entities) => entities.filter(entity =>\n // ignore entities that are deleting\n // entity.daffState !== DaffState.Deleting &&\n // ignore placeholders with errors\n !(entity.daffTemp && entity.daffErrors.length > 0),\n ),\n );\n\n return {\n selectEntity,\n selectOptimisticList,\n };\n};\n","import {\n createEntityAdapter,\n EntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffIdentifiable } from '@daffodil/core';\n\nimport { DaffStateError } from '../../errors/public_api';\nimport { DaffState } from '../../states/public_api';\nimport {\n daffOperationEntityStateSelectorFactory,\n DaffOperationEntityStateSelectors,\n} from './selectors';\nimport { DaffOperationEntityState } from './state.type';\nimport { DaffOperationEntity } from './type';\n\n/**\n * An entity state adapter that takes care of managing contextual operation and error state for entities.\n */\nexport interface DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> {\n /**\n * Stores a list of entities in state and resets them all to stable.\n */\n list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;\n /**\n * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.\n */\n preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;\n /**\n * Upserts the entity into state and resets operation state and errors.\n */\n load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;\n /**\n * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.\n */\n preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Adds the entity into state, sets operation state to added, and resets errors.\n */\n add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;\n /**\n * Sets the entity's operation state to mutating.\n */\n preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Upserts the entity into state, sets operation state to mutated, and resets errors.\n */\n update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;\n /**\n * Sets the entity's operation state to deleting.\n */\n preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Removes the entity from state.\n */\n remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Resets the entity's operation state and stores errors on the entity.\n */\n operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;\n /**\n * Resets the entity's operation state to stable.\n */\n resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;\n /**\n * Gets an empty entity state.\n */\n getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;\n /**\n * Gets entity selectors.\n */\n getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;\n}\n\nexport function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter: EntityAdapter<DaffOperationEntity<T>> = createEntityAdapter<DaffOperationEntity<T>>()): DaffOperationEntityStateAdapter<T> {\n return {\n list: (entities, state) => adapter.setAll(\n entities.map<DaffOperationEntity<T>>(entity => ({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n })),\n state,\n ),\n preload: (key, state) =>\n adapter.upsertOne(<DaffOperationEntity<T>>{\n // TODO: allow for non identifiable entities?\n id: key,\n daffState: DaffState.Resolving,\n daffErrors: [],\n daffTemp: !state.entities[key],\n }, state),\n load: (entity, state) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Stable,\n daffErrors: [],\n daffTemp: false,\n }, state),\n preadd: (entity, state, placeholderId) =>\n placeholderId\n ? adapter.addOne({\n ...entity,\n // TODO: allow for non identifiable entities?\n id: placeholderId,\n daffState: DaffState.Adding,\n daffErrors: [],\n daffTemp: true,\n }, state)\n : state,\n add: (entity, state, placeholderId) =>\n adapter.upsertOne({\n ...entity,\n daffState: DaffState.Added,\n daffErrors: [],\n daffTemp: false,\n }, placeholderId ? adapter.removeOne(placeholderId, state) : state),\n preupdate: (entity, state) =>\n adapter.upsertOne({\n ...state.entities[entity.id],\n daffState: DaffState.Mutating,\n daffErrors: [],\n }, state),\n update: (entity, state) =>\n adapter.updateOne({\n id: entity.id,\n changes: <Partial<DaffOperationEntity<T>>>{\n ...entity,\n daffState: DaffState.Mutated,\n daffErrors: [],\n daffTemp: false,\n },\n }, state),\n preremove: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffErrors: [],\n daffState: DaffState.Deleting,\n }, state),\n remove: adapter.removeOne,\n operationFailed: (key, errors, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n daffErrors: errors,\n }, state),\n resetState: (key, state) =>\n adapter.upsertOne({\n ...state.entities[key],\n daffState: DaffState.Stable,\n }, state),\n getInitialState: adapter.getInitialState,\n getSelectors: <TRootState>(selectState) => daffOperationEntityStateSelectorFactory<TRootState, T>(adapter.getSelectors(selectState)),\n };\n}\n","import { DaffState } from '../../states/public_api';\n\n/**\n * Returns whether the state is one that represents an operation in progress.\n */\nexport function daffStateIsLoading(daffState: DaffState): boolean {\n return daffState === DaffState.Adding\n || daffState === DaffState.Mutating\n || daffState === DaffState.Resolving\n || daffState === DaffState.Deleting;\n}\n\n/**\n * Generate a fake ID for use with placeholder entities.\n *\n * @param key An optional key that can augment the randomly generated ID.\n * @returns A string cont\n */\nexport function daffOperationEntityCreateFakeId(key: string = ''): string {\n return `ε-${Date.now()}-${key}`;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,yBAAyB,GAAG,CAAC,IAAwB,EAAE,MAAc,KAAc,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;MACxG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,KAAK,CAAC;AAChE,MAAE,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;AAoBG;AACU,MAAA,SAAS,GAAG,CAAC,QAAwB,EAAE,GAAG,WAAyB,KAAI;AAClF,IAAA,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC;AACpF,IAAA,MAAM,0BAA0B,GAAG,CAAC,gBAAgB,EAAE,MAAM,KAC1D,yBAAyB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;AAClE,UAAE;AACA,YAAA,GAAG,gBAAgB;YACnB,MAAM;AACP,SAAA;UACC,gBAAgB,CAAC;IAEvB,OAAO,IAAI,CACT,IAAI,CAAmB,CAAC,gBAAgB,EAAE,MAAM,KAC9C,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;AAEnC,UAAE,EAAE;AACJ,UAAE,0BAA0B;;QAE1B,WAAW,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,gBAAgB,EACrD,MAAM,CACP,EACL,EAAE,CAAC,EACH,MAAM,CAAC,WAAW,CAAC,CACpB,CAAC;AACJ;;ACrDA;;AAEG;AACG,SAAU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GAAG,CAAC;AACtB,YAAA,UAAU,EAAE,EAAE;AACd,YAAA,SAAS,EAAoB,UAAA;AAC9B,SAAA,EAAE,KAAK,CAAC;QACX,MAAM,EAAE,OAAO,CAAC,SAAS;AACzB,QAAA,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,KAClC,OAAO,CAAC,SAAS,CAAC;AAChB,YAAA,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;AACtB,YAAA,SAAS,EAAkB,QAAA;AAC3B,YAAA,UAAU,EAAE,MAAM;AACnB,SAAA,EAAE,KAAK,CAAC;QACX,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,KACrB,OAAO,CAAC,SAAS,CAAC;AAChB,YAAA,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;AACtB,YAAA,SAAS,EAAkB,QAAA;AAC5B,SAAA,EAAE,KAAK,CAAC;QACX,eAAe,EAAE,OAAO,CAAC,eAAe;AACxC,QAAA,YAAY,EAAE,CAAa,WAAW,KAAK,uCAAuC,CAAgB,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;KACrI,CAAC;AACJ;;ACzJA;;AAEG;AACG,SAAU,kBAAkB,CAAC,SAAoB,EAAA;AACrD,IAAA,OAAO,SAAS,KAAqB,QAAA;AAChC,WAAA,SAAS,KAAuB,UAAA;AAChC,WAAA,SAAS,KAAwB,WAAA;AACjC,WAAA,SAAS,+BAAwB;AACxC,CAAC;AAED;;;;;AAKG;AACa,SAAA,+BAA+B,CAAC,GAAA,GAAc,EAAE,EAAA;IAC9D,OAAO,CAAA,EAAA,EAAK,IAAI,CAAC,GAAG,EAAE,CAAI,CAAA,EAAA,GAAG,EAAE,CAAC;AAClC;;ACpBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ export declare function daffCompleteOperation<T extends DaffOperationState = Daf
|
|
|
17
17
|
* Indicates a failed operation.
|
|
18
18
|
* Sets loading to stable and stores errors.
|
|
19
19
|
*/
|
|
20
|
-
export declare function daffOperationFailed<T extends DaffOperationState = DaffOperationState>(errors: T['
|
|
20
|
+
export declare function daffOperationFailed<T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T;
|
|
21
21
|
/**
|
|
22
22
|
* Resets errors.
|
|
23
23
|
*/
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { DaffIdentifiable } from '@daffodil/core';
|
|
2
|
-
import {
|
|
2
|
+
import { DaffErrorable } from '../../errors/public_api';
|
|
3
3
|
import { DaffStateable } from '../../states/public_api';
|
|
4
4
|
/**
|
|
5
5
|
* An entity that is responsible for storing its own errors and loading state.
|
|
6
|
+
* Its possible to be an "optimistic" entity, i.e. only temporary while the real entity is in some loading state.
|
|
6
7
|
*/
|
|
7
|
-
export declare type DaffOperationEntity<T extends DaffIdentifiable = DaffIdentifiable> = DaffStateable & T & {
|
|
8
|
-
/**
|
|
9
|
-
* A list of errors applicable only to this entity.
|
|
10
|
-
*/
|
|
11
|
-
daffErrors: DaffStateError[];
|
|
8
|
+
export declare type DaffOperationEntity<T extends DaffIdentifiable = DaffIdentifiable> = DaffStateable & DaffErrorable & T & {
|
|
12
9
|
/**
|
|
13
10
|
* Whether this entity is temporary.
|
|
14
11
|
* A temporary entity is a placeholder for the optimistic success of an entity operation
|
|
@@ -9,7 +9,7 @@ export interface DaffOperationStateFacadeInterface<TState extends DaffOperationS
|
|
|
9
9
|
/**
|
|
10
10
|
* The loading state enum.
|
|
11
11
|
*/
|
|
12
|
-
loadingState$: Observable<TState['
|
|
12
|
+
loadingState$: Observable<TState['daffState']>;
|
|
13
13
|
/**
|
|
14
14
|
* Whether the operation state is in any of the loading states.
|
|
15
15
|
*/
|
|
@@ -25,7 +25,7 @@ export interface DaffOperationStateFacadeInterface<TState extends DaffOperationS
|
|
|
25
25
|
/**
|
|
26
26
|
* The errors in the operation state.
|
|
27
27
|
*/
|
|
28
|
-
errors$: Observable<TState['
|
|
28
|
+
errors$: Observable<TState['daffErrors']>;
|
|
29
29
|
/**
|
|
30
30
|
* Whether the operation state has any errors.
|
|
31
31
|
* If so, it should be considered to be in an "error" state.
|
|
@@ -7,7 +7,7 @@ export interface DaffOperationStateSelectors<TRootState, TState extends DaffOper
|
|
|
7
7
|
/**
|
|
8
8
|
* Selects the loading state enum.
|
|
9
9
|
*/
|
|
10
|
-
selectLoadingState: MemoizedSelector<TRootState, TState['
|
|
10
|
+
selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;
|
|
11
11
|
/**
|
|
12
12
|
* Selects whether the operation state is in any of the loading states.
|
|
13
13
|
*/
|
|
@@ -23,7 +23,7 @@ export interface DaffOperationStateSelectors<TRootState, TState extends DaffOper
|
|
|
23
23
|
/**
|
|
24
24
|
* Selects the errors in the operation state.
|
|
25
25
|
*/
|
|
26
|
-
selectErrors: MemoizedSelector<TRootState, TState['
|
|
26
|
+
selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;
|
|
27
27
|
/**
|
|
28
28
|
* Selects whether the operation state has any errors.
|
|
29
29
|
* If so, it should be considered to be in an "error" state.
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DaffErrorable } from '../errors/public_api';
|
|
2
|
+
import { DaffStateable } from '../states/public_api';
|
|
3
3
|
/**
|
|
4
4
|
* A basic operation state.
|
|
5
5
|
* Represents the current state of an operation and any associated errors.
|
|
6
6
|
*/
|
|
7
|
-
export interface DaffOperationState {
|
|
8
|
-
/**
|
|
9
|
-
* The loading state of the operations backed by this state.
|
|
10
|
-
*/
|
|
11
|
-
loading: DaffState;
|
|
12
|
-
/**
|
|
13
|
-
* The errors generated by the most recent operation.
|
|
14
|
-
*/
|
|
15
|
-
errors: DaffStateError[];
|
|
7
|
+
export interface DaffOperationState extends DaffErrorable, DaffStateable {
|
|
16
8
|
}
|
|
17
9
|
export declare const daffOperationInitialState: DaffOperationState;
|