@zeniai/client-epic-state 5.1.60-beta0ND → 5.1.60-betaDI0
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/lib/coreEpics.js +3 -2
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/notificationRegistry/notificationRegistryPayload.d.ts +18 -0
- package/lib/entity/notificationRegistry/notificationRegistryPayload.js +28 -0
- package/lib/entity/notificationRegistry/notificationRegistryReducer.d.ts +6 -0
- package/lib/entity/notificationRegistry/notificationRegistryReducer.js +26 -0
- package/lib/entity/notificationRegistry/notificationRegistrySelector.d.ts +2 -0
- package/lib/entity/notificationRegistry/notificationRegistrySelector.js +10 -0
- package/lib/entity/notificationRegistry/notificationRegistryState.d.ts +31 -0
- package/lib/entity/notificationRegistry/notificationRegistryState.js +10 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/epic.d.ts +2 -2
- package/lib/epic.js +2 -2
- package/lib/esm/coreEpics.js +3 -2
- package/lib/esm/entity/notificationRegistry/notificationRegistryPayload.js +24 -0
- package/lib/esm/entity/notificationRegistry/notificationRegistryReducer.js +22 -0
- package/lib/esm/entity/notificationRegistry/notificationRegistrySelector.js +6 -0
- package/lib/esm/entity/notificationRegistry/notificationRegistryState.js +5 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +4 -0
- package/lib/esm/epic.js +2 -2
- package/lib/esm/index.js +7 -2
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.js +116 -0
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesEndpoint.js +5 -0
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewPayload.js +36 -0
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewReducer.js +222 -0
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewSelector.js +25 -0
- package/lib/esm/view/notificationPreferencesView/notificationPreferencesViewState.js +4 -0
- package/lib/esm/view/recommendation/recommendationReducer.js +1 -17
- package/lib/esm/view/settingsView/epic/fetchNotificationSettingsEpic.js +21 -2
- package/lib/esm/view/settingsView/epic/saveNotificationSettingsEpic.js +2 -1
- package/lib/esm/view/settingsView/settingsViewHelpers.js +3 -2
- package/lib/index.d.ts +9 -3
- package/lib/index.js +32 -18
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/common/recurringViewHelper.d.ts +2 -2
- package/lib/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.d.ts +40 -0
- package/lib/view/notificationPreferencesView/epics/saveNotificationPreferencesEpic.js +120 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesEndpoint.d.ts +2 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesEndpoint.js +9 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewPayload.d.ts +7 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewPayload.js +41 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewReducer.d.ts +30 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewReducer.js +226 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewSelector.d.ts +7 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewSelector.js +32 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewState.d.ts +14 -0
- package/lib/view/notificationPreferencesView/notificationPreferencesViewState.js +8 -0
- package/lib/view/recommendation/recommendationPayload.d.ts +0 -33
- package/lib/view/recommendation/recommendationReducer.d.ts +1 -2
- package/lib/view/recommendation/recommendationReducer.js +2 -18
- package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +9 -1
- package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +21 -2
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +2 -1
- package/lib/view/settingsView/settingsViewHelpers.d.ts +1 -1
- package/lib/view/settingsView/settingsViewHelpers.js +3 -2
- package/lib/view/settingsView/settingsViewPayload.d.ts +4 -0
- package/lib/view/settingsView/settingsViewState.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/recommendation/submitRecommendationFeedbackEpic.js +0 -51
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.d.ts +0 -7
- package/lib/view/recommendation/submitRecommendationFeedbackEpic.js +0 -55
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.submitRecommendationFeedbackEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../responsePayload");
|
|
7
|
-
const recommendationReducer_1 = require("./recommendationReducer");
|
|
8
|
-
const toRequestBody = (payload) => ({
|
|
9
|
-
line_id: payload.lineId ?? null,
|
|
10
|
-
dimension: payload.dimension,
|
|
11
|
-
recommendation_set_id: payload.recommendationSetId ?? null,
|
|
12
|
-
top_pick_source: payload.topPickSource ?? null,
|
|
13
|
-
shown_recommendations: (payload.shownRecommendations ?? []).map((recommendation) => ({
|
|
14
|
-
source: recommendation.source,
|
|
15
|
-
rank: recommendation.rank,
|
|
16
|
-
value: {
|
|
17
|
-
name: recommendation.value.name,
|
|
18
|
-
id: recommendation.value.id ?? null,
|
|
19
|
-
integration_id: recommendation.value.integrationId ?? null,
|
|
20
|
-
},
|
|
21
|
-
confidence: recommendation.confidence ?? null,
|
|
22
|
-
reasoning: recommendation.reasoning ?? null,
|
|
23
|
-
cot: recommendation.cot ?? [],
|
|
24
|
-
})),
|
|
25
|
-
selected: {
|
|
26
|
-
name: payload.selected.name,
|
|
27
|
-
id: payload.selected.id ?? null,
|
|
28
|
-
integration_id: payload.selected.integrationId ?? null,
|
|
29
|
-
is_new_entity: payload.selected.isNewEntity ?? false,
|
|
30
|
-
},
|
|
31
|
-
matched_source: payload.matchedSource ?? null,
|
|
32
|
-
matched_rank: payload.matchedRank ?? null,
|
|
33
|
-
outcome: payload.outcome,
|
|
34
|
-
reason_text: payload.reasonText ?? null,
|
|
35
|
-
skipped: payload.skipped ?? false,
|
|
36
|
-
features: payload.features ?? null,
|
|
37
|
-
});
|
|
38
|
-
// Fire-and-forget: the epic never re-emits an action. Feedback delivery is a
|
|
39
|
-
// side-effect that must not disrupt the categorization UX, so both the
|
|
40
|
-
// success and error paths complete silently (errors are logged for debugging).
|
|
41
|
-
const submitRecommendationFeedbackEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(recommendationReducer_1.submitRecommendationFeedback.match), (0, operators_1.mergeMap)((action) => {
|
|
42
|
-
const { transactionId } = action.payload;
|
|
43
|
-
return zeniAPI
|
|
44
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/${transactionId}/recommendation-feedback`, toRequestBody(action.payload))
|
|
45
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
46
|
-
if (!(0, responsePayload_1.isSuccessStatus)(response)) {
|
|
47
|
-
console.error('submitRecommendationFeedbackEpic: recommendation feedback was not recorded', response.status);
|
|
48
|
-
}
|
|
49
|
-
return rxjs_1.EMPTY;
|
|
50
|
-
}), (0, operators_1.catchError)((error) => {
|
|
51
|
-
console.error('submitRecommendationFeedbackEpic: failed to submit recommendation feedback', error);
|
|
52
|
-
return rxjs_1.EMPTY;
|
|
53
|
-
}));
|
|
54
|
-
}));
|
|
55
|
-
exports.submitRecommendationFeedbackEpic = submitRecommendationFeedbackEpic;
|