@zeniai/client-epic-state 5.0.36 → 5.0.37
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/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +0 -1
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -2
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +0 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/entity/task/taskPayload.d.ts +0 -3
- package/lib/entity/task/taskPayload.js +0 -5
- package/lib/entity/task/taskState.d.ts +0 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
- package/lib/entity/tenant/clearAllEpic.js +0 -4
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +1 -7
- package/lib/epic.js +1 -7
- package/lib/esm/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +0 -1
- package/lib/esm/entity/file/fileState.js +0 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/esm/entity/task/taskPayload.js +0 -5
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -4
- package/lib/esm/epic.js +1 -7
- package/lib/esm/index.js +4 -10
- package/lib/esm/init.js +16 -71
- package/lib/esm/reducer.js +0 -6
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +7 -60
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +0 -12
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +21 -56
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +4 -13
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -7
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -106
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/lib/index.d.ts +4 -12
- package/lib/index.js +5 -28
- package/lib/init.d.ts +3 -5
- package/lib/init.js +16 -71
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -2
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +8 -61
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +0 -12
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +7 -6
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +22 -56
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +4 -13
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskList.js +1 -8
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +0 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +6 -9
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -107
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +3 -9
- package/lib/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/package.json +1 -1
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponses.js +0 -1
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +0 -12
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +0 -64
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +0 -3
- package/lib/esm/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +0 -17
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +0 -21
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +0 -29
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -66
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -57
- package/lib/esm/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +0 -65
- package/lib/esm/view/zeniOAuthView/zeniOAuthParamsParser.js +0 -41
- package/lib/esm/view/zeniOAuthView/zeniOAuthReducer.js +0 -49
- package/lib/esm/view/zeniOAuthView/zeniOAuthSelector.js +0 -3
- package/lib/esm/view/zeniOAuthView/zeniOAuthState.js +0 -1
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.d.ts +0 -19
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.js +0 -2
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.d.ts +0 -21
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +0 -15
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.d.ts +0 -30
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +0 -68
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.d.ts +0 -3
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +0 -6
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +0 -21
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +0 -25
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +0 -33
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -70
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -61
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.d.ts +0 -27
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +0 -69
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.d.ts +0 -16
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.js +0 -44
- package/lib/view/zeniOAuthView/zeniOAuthReducer.d.ts +0 -29
- package/lib/view/zeniOAuthView/zeniOAuthReducer.js +0 -53
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +0 -5
- package/lib/view/zeniOAuthView/zeniOAuthSelector.js +0 -9
- package/lib/view/zeniOAuthView/zeniOAuthState.d.ts +0 -4
- package/lib/view/zeniOAuthView/zeniOAuthState.js +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
2
3
|
import orderBy from 'lodash/orderBy';
|
|
3
4
|
import { getSortOrder, } from '../../../commonPayloadTypes/sortOrderPayload';
|
|
4
5
|
import { reduceAnyFetchState } from '../../../commonStateTypes/reduceFetchState';
|
|
@@ -14,6 +15,11 @@ import { getUserGroupList } from '../../userGroupListView/userGroupListViewSelec
|
|
|
14
15
|
import { getUserList, } from '../../userListView/userListViewSelector';
|
|
15
16
|
import { allTaskPriority, allTaskStatus, } from '../taskDetailView/taskDetailSelector';
|
|
16
17
|
import { DUE_DATE_GROUP_KEYS, } from './taskList';
|
|
18
|
+
import { initialState } from './taskListReducer';
|
|
19
|
+
const isDefaultFilters = (taskListState) => {
|
|
20
|
+
return (isEqual(taskListState.filters, initialState.filters) &&
|
|
21
|
+
initialState.uiState.searchText === taskListState.uiState.searchText);
|
|
22
|
+
};
|
|
17
23
|
const sortTasksList = (tagState, tasksList, sortKey, sortOrder) => {
|
|
18
24
|
const tasksInOrder = orderBy(tasksList, (task) => {
|
|
19
25
|
const tagsByIds = getTagsByIds(tagState, task.tagIds);
|
|
@@ -28,12 +34,8 @@ const sortTasksList = (tagState, tasksList, sortKey, sortOrder) => {
|
|
|
28
34
|
return task.status.name;
|
|
29
35
|
case 'priority':
|
|
30
36
|
return ALL_PRIORITY_CODE.indexOf(task.priority.code);
|
|
31
|
-
case 'assignee':
|
|
32
|
-
return task.firstAssigneeSortName;
|
|
33
37
|
case 'timeSpent':
|
|
34
38
|
return task.timeSpent;
|
|
35
|
-
case 'visibility':
|
|
36
|
-
return task.isPrivate === true ? 1 : 0;
|
|
37
39
|
case 'name':
|
|
38
40
|
default:
|
|
39
41
|
return task.name.toLowerCase();
|
|
@@ -41,7 +43,7 @@ const sortTasksList = (tagState, tasksList, sortKey, sortOrder) => {
|
|
|
41
43
|
}, sortOrder);
|
|
42
44
|
return tasksInOrder;
|
|
43
45
|
};
|
|
44
|
-
const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRoleState, addressState, taskIds, tagState,
|
|
46
|
+
const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRoleState, addressState, taskIds, tagState, }) => {
|
|
45
47
|
const { sortKey, searchText } = taskListState.uiState;
|
|
46
48
|
const sortOrder = getSortOrder(taskListState.uiState.sortOrder);
|
|
47
49
|
const tasks = taskIds
|
|
@@ -51,15 +53,7 @@ const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRole
|
|
|
51
53
|
const assigneeUsers = task.assignees
|
|
52
54
|
.map((userId) => getUserAndUserRole(userState, userRoleState, addressState, userId))
|
|
53
55
|
.filter((value) => value != null);
|
|
54
|
-
|
|
55
|
-
const firstUserName = (firstUser != null ? getUserName(firstUser) : '') ||
|
|
56
|
-
firstUser?.email ||
|
|
57
|
-
'';
|
|
58
|
-
const firstGroupName = task.groupAssignees
|
|
59
|
-
.map((gId) => userGroupsState.userGroupByUserGroupId[gId]?.name)
|
|
60
|
-
.find((name) => name != null && name !== '');
|
|
61
|
-
const firstAssigneeSortName = (firstUserName !== '' ? firstUserName : (firstGroupName ?? '')).toLowerCase();
|
|
62
|
-
return { ...task, assigneeUsers, firstAssigneeSortName };
|
|
56
|
+
return { ...task, assigneeUsers };
|
|
63
57
|
}
|
|
64
58
|
return undefined;
|
|
65
59
|
})
|
|
@@ -68,7 +62,7 @@ const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRole
|
|
|
68
62
|
const sortedTaskList = sortTasksList(tagState, filteredTaskList, sortKey, sortOrder);
|
|
69
63
|
return sortedTaskList;
|
|
70
64
|
};
|
|
71
|
-
const getTaskListGroupedByGroupName = ({ taskListState, taskState, taskGroupState, taskGroupViewState, userState, userRoleState, addressState, tagState,
|
|
65
|
+
const getTaskListGroupedByGroupName = ({ taskListState, taskState, taskGroupState, taskGroupViewState, userState, userRoleState, addressState, tagState, }) => {
|
|
72
66
|
const { taskGroupsIds } = taskGroupViewState;
|
|
73
67
|
const taskGroupsWithTasksList = taskGroupsIds
|
|
74
68
|
.map((taskGroupId) => {
|
|
@@ -82,7 +76,6 @@ const getTaskListGroupedByGroupName = ({ taskListState, taskState, taskGroupStat
|
|
|
82
76
|
addressState,
|
|
83
77
|
taskIds,
|
|
84
78
|
tagState,
|
|
85
|
-
userGroupsState,
|
|
86
79
|
});
|
|
87
80
|
if (taskGroup != null) {
|
|
88
81
|
return {
|
|
@@ -111,9 +104,12 @@ const getTaskListGroupedByGroupName = ({ taskListState, taskState, taskGroupStat
|
|
|
111
104
|
if (defaultTaskGroup != null) {
|
|
112
105
|
sortedTaskGroupsWithTasksList.push(defaultTaskGroup);
|
|
113
106
|
}
|
|
114
|
-
|
|
107
|
+
if (isDefaultFilters(taskListState) === false) {
|
|
108
|
+
return sortedTaskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
|
|
109
|
+
}
|
|
110
|
+
return sortedTaskGroupsWithTasksList;
|
|
115
111
|
};
|
|
116
|
-
export const getTaskListGroupedByAssignees = ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
112
|
+
export const getTaskListGroupedByAssignees = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }) => {
|
|
117
113
|
const assigneeGroups = Object.keys(taskListState.taskIdsByAssignees);
|
|
118
114
|
const taskGroupsWithTasksList = assigneeGroups.map((groupKey) => {
|
|
119
115
|
const taskIds = taskListState.taskIdsByAssignees[groupKey];
|
|
@@ -125,7 +121,6 @@ export const getTaskListGroupedByAssignees = ({ taskListState, taskState, userSt
|
|
|
125
121
|
addressState,
|
|
126
122
|
taskIds,
|
|
127
123
|
tagState,
|
|
128
|
-
userGroupsState,
|
|
129
124
|
});
|
|
130
125
|
const assigneeIds = groupKey.split(',');
|
|
131
126
|
const groupName = getUsersByUserIds(userState, assigneeIds)
|
|
@@ -141,9 +136,12 @@ export const getTaskListGroupedByAssignees = ({ taskListState, taskState, userSt
|
|
|
141
136
|
tasks: tasksWithUserDetails,
|
|
142
137
|
};
|
|
143
138
|
});
|
|
144
|
-
|
|
139
|
+
if (isDefaultFilters(taskListState) === false) {
|
|
140
|
+
return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
|
|
141
|
+
}
|
|
142
|
+
return taskGroupsWithTasksList;
|
|
145
143
|
};
|
|
146
|
-
export const getTaskListGroupedByPriority = ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
144
|
+
export const getTaskListGroupedByPriority = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }) => {
|
|
147
145
|
const taskGroupsWithTasksList = ALL_PRIORITY_CODE.map((groupKey) => {
|
|
148
146
|
const taskIds = taskListState.taskIdsByPriority[groupKey] ?? [];
|
|
149
147
|
const tasksWithUserDetails = getTasksWithUserDetails({
|
|
@@ -154,7 +152,6 @@ export const getTaskListGroupedByPriority = ({ taskListState, taskState, userSta
|
|
|
154
152
|
addressState,
|
|
155
153
|
taskIds,
|
|
156
154
|
tagState,
|
|
157
|
-
userGroupsState,
|
|
158
155
|
});
|
|
159
156
|
return {
|
|
160
157
|
groupName: allTaskPriority.find((priority) => priority.code === groupKey)?.name ??
|
|
@@ -164,9 +161,12 @@ export const getTaskListGroupedByPriority = ({ taskListState, taskState, userSta
|
|
|
164
161
|
tasks: tasksWithUserDetails,
|
|
165
162
|
};
|
|
166
163
|
});
|
|
167
|
-
|
|
164
|
+
if (isDefaultFilters(taskListState) === false) {
|
|
165
|
+
return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
|
|
166
|
+
}
|
|
167
|
+
return taskGroupsWithTasksList;
|
|
168
168
|
};
|
|
169
|
-
const getTaskListGroupedByStatus = ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
169
|
+
const getTaskListGroupedByStatus = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }) => {
|
|
170
170
|
const taskGroupsWithTasksList = ALL_TASK_STATUS_CODE.map((groupKey) => {
|
|
171
171
|
const taskIds = taskListState.taskIdsByStatus[groupKey] ?? [];
|
|
172
172
|
const tasksWithUserDetails = getTasksWithUserDetails({
|
|
@@ -177,7 +177,6 @@ const getTaskListGroupedByStatus = ({ taskListState, taskState, userState, userR
|
|
|
177
177
|
addressState,
|
|
178
178
|
taskIds,
|
|
179
179
|
tagState,
|
|
180
|
-
userGroupsState,
|
|
181
180
|
});
|
|
182
181
|
return {
|
|
183
182
|
groupName: allTaskStatus.find((taskStatus) => taskStatus.code === groupKey)
|
|
@@ -187,9 +186,12 @@ const getTaskListGroupedByStatus = ({ taskListState, taskState, userState, userR
|
|
|
187
186
|
tasks: tasksWithUserDetails,
|
|
188
187
|
};
|
|
189
188
|
});
|
|
190
|
-
|
|
189
|
+
if (isDefaultFilters(taskListState) === false) {
|
|
190
|
+
return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
|
|
191
|
+
}
|
|
192
|
+
return taskGroupsWithTasksList;
|
|
191
193
|
};
|
|
192
|
-
const getTaskListGroupedByTags = ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
194
|
+
const getTaskListGroupedByTags = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }) => {
|
|
193
195
|
const tagGroups = Object.keys(taskListState.taskIdsByTags);
|
|
194
196
|
const taskGroupsWithTasksList = tagGroups.map((groupKey) => {
|
|
195
197
|
const taskIds = taskListState.taskIdsByTags[groupKey];
|
|
@@ -201,7 +203,6 @@ const getTaskListGroupedByTags = ({ taskListState, taskState, userState, userRol
|
|
|
201
203
|
addressState,
|
|
202
204
|
taskIds,
|
|
203
205
|
tagState,
|
|
204
|
-
userGroupsState,
|
|
205
206
|
});
|
|
206
207
|
const tagIds = groupKey.split(',');
|
|
207
208
|
const groupName = getTagsByIds(tagState, tagIds)
|
|
@@ -216,9 +217,12 @@ const getTaskListGroupedByTags = ({ taskListState, taskState, userState, userRol
|
|
|
216
217
|
tasks: tasksWithUserDetails,
|
|
217
218
|
};
|
|
218
219
|
});
|
|
219
|
-
|
|
220
|
+
if (isDefaultFilters(taskListState) === false) {
|
|
221
|
+
return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
|
|
222
|
+
}
|
|
223
|
+
return taskGroupsWithTasksList;
|
|
220
224
|
};
|
|
221
|
-
const getTaskListGroupedByDueDate = ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
225
|
+
const getTaskListGroupedByDueDate = ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }) => {
|
|
222
226
|
const taskGroupsWithTasksList = DUE_DATE_GROUP_KEYS.map((groupKey) => {
|
|
223
227
|
const taskIds = taskListState.taskIdsByDueDate[groupKey];
|
|
224
228
|
const tasksWithUserDetails = getTasksWithUserDetails({
|
|
@@ -229,7 +233,6 @@ const getTaskListGroupedByDueDate = ({ taskListState, taskState, userState, user
|
|
|
229
233
|
addressState,
|
|
230
234
|
taskIds,
|
|
231
235
|
tagState,
|
|
232
|
-
userGroupsState,
|
|
233
236
|
});
|
|
234
237
|
return {
|
|
235
238
|
groupName: groupKey,
|
|
@@ -238,9 +241,12 @@ const getTaskListGroupedByDueDate = ({ taskListState, taskState, userState, user
|
|
|
238
241
|
tasks: tasksWithUserDetails,
|
|
239
242
|
};
|
|
240
243
|
});
|
|
241
|
-
|
|
244
|
+
if (isDefaultFilters(taskListState) === false) {
|
|
245
|
+
return taskGroupsWithTasksList.filter((group) => group.tasks.length > 0);
|
|
246
|
+
}
|
|
247
|
+
return taskGroupsWithTasksList;
|
|
242
248
|
};
|
|
243
|
-
const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRoleState, addressState, taskGroupState, taskGroupViewState, tagState,
|
|
249
|
+
const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRoleState, addressState, taskGroupState, taskGroupViewState, tagState, }) => {
|
|
244
250
|
const { groupByKey } = taskListState.uiState;
|
|
245
251
|
if (groupByKey === 'groupName') {
|
|
246
252
|
return getTaskListGroupedByGroupName({
|
|
@@ -252,7 +258,6 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
252
258
|
taskGroupState,
|
|
253
259
|
taskGroupViewState,
|
|
254
260
|
tagState,
|
|
255
|
-
userGroupsState,
|
|
256
261
|
});
|
|
257
262
|
}
|
|
258
263
|
if (groupByKey === 'assignee') {
|
|
@@ -263,7 +268,6 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
263
268
|
userRoleState,
|
|
264
269
|
addressState,
|
|
265
270
|
tagState,
|
|
266
|
-
userGroupsState,
|
|
267
271
|
});
|
|
268
272
|
}
|
|
269
273
|
if (groupByKey === 'priority') {
|
|
@@ -274,7 +278,6 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
274
278
|
userRoleState,
|
|
275
279
|
addressState,
|
|
276
280
|
tagState,
|
|
277
|
-
userGroupsState,
|
|
278
281
|
});
|
|
279
282
|
}
|
|
280
283
|
if (groupByKey === 'status') {
|
|
@@ -285,7 +288,6 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
285
288
|
userRoleState,
|
|
286
289
|
addressState,
|
|
287
290
|
tagState,
|
|
288
|
-
userGroupsState,
|
|
289
291
|
});
|
|
290
292
|
}
|
|
291
293
|
if (groupByKey === 'tag') {
|
|
@@ -296,7 +298,6 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
296
298
|
userRoleState,
|
|
297
299
|
addressState,
|
|
298
300
|
tagState,
|
|
299
|
-
userGroupsState,
|
|
300
301
|
});
|
|
301
302
|
}
|
|
302
303
|
return getTaskListGroupedByDueDate({
|
|
@@ -306,7 +307,6 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
306
307
|
userRoleState,
|
|
307
308
|
addressState,
|
|
308
309
|
tagState,
|
|
309
|
-
userGroupsState,
|
|
310
310
|
});
|
|
311
311
|
};
|
|
312
312
|
export const getAllTasks = createSelector((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (state) => state.userGroupsState, (state) => state.userGroupListViewState, (_state, isTaskTemplatesEnabled) => isTaskTemplatesEnabled, (taskListState, taskState, userState, userRoleState, userListViewState, addressState, taskGroupState, taskGroupViewState, tagViewState, tagState, taskGroupTemplateState, taskGroupTemplateViewState, userGroupsState, userGroupListViewState, isTaskTemplatesEnabled) => {
|
|
@@ -320,7 +320,6 @@ export const getAllTasks = createSelector((state) => state.taskListState, (state
|
|
|
320
320
|
taskGroupState,
|
|
321
321
|
taskGroupViewState,
|
|
322
322
|
tagState,
|
|
323
|
-
userGroupsState,
|
|
324
323
|
});
|
|
325
324
|
const fetchStateVariables = [
|
|
326
325
|
taskListState,
|
|
@@ -332,15 +331,7 @@ export const getAllTasks = createSelector((state) => state.taskListState, (state
|
|
|
332
331
|
}
|
|
333
332
|
const { fetchState, error } = reduceAnyFetchState(fetchStateVariables);
|
|
334
333
|
const taskGroupTemplates = getTaskGroupTemplateByIds(taskGroupTemplateState, taskGroupTemplateViewState.taskGroupTemplateIds);
|
|
335
|
-
const tabCounts = {
|
|
336
|
-
live: taskListState.byTab.live.taskIds.length,
|
|
337
|
-
archived: taskListState.byTab.archived.taskIds.length,
|
|
338
|
-
deleted: taskListState.byTab.deleted.taskIds.length,
|
|
339
|
-
snoozed: taskListState.byTab.snoozed.taskIds.length,
|
|
340
|
-
};
|
|
341
334
|
return {
|
|
342
|
-
currentTab: taskListState.currentTab,
|
|
343
|
-
tabCounts,
|
|
344
335
|
uiState: taskListState.uiState,
|
|
345
336
|
filters: taskListState.filters,
|
|
346
337
|
taskGroupTemplates,
|
package/lib/index.d.ts
CHANGED
|
@@ -537,15 +537,12 @@ import { createTag, deleteTag, fetchTagList } from './view/tagView/tagViewReduce
|
|
|
537
537
|
import { TagViewSelectorView, getAllTags } from './view/tagView/tagViewSelector';
|
|
538
538
|
import { TagViewState } from './view/tagView/tagViewState';
|
|
539
539
|
import { EditTaskLocalData, initialTaskDetail, initialTaskDetailLocalData } from './view/taskManager/taskDetailView/taskDetail';
|
|
540
|
-
import { archiveTask, deleteTask, discardTaskUpdatesInLocalStore, fetchTaskDetailPage, saveTaskDetail, saveTaskUpdatesToLocalStore
|
|
541
|
-
import { CannedResponse, CannedResponsesViewState } from './view/taskManager/cannedResponsesView/cannedResponses';
|
|
542
|
-
import { deleteCannedResponse, fetchCannedResponses, saveCannedResponse } from './view/taskManager/cannedResponsesView/cannedResponsesReducer';
|
|
543
|
-
import { getCannedResponsesView } from './view/taskManager/cannedResponsesView/cannedResponsesSelector';
|
|
540
|
+
import { archiveTask, deleteTask, discardTaskUpdatesInLocalStore, fetchTaskDetailPage, saveTaskDetail, saveTaskUpdatesToLocalStore } from './view/taskManager/taskDetailView/taskDetailReducer';
|
|
544
541
|
import { TaskDetailSelectorView, allTaskPriority, allTaskStatus, getTaskDetail } from './view/taskManager/taskDetailView/taskDetailSelector';
|
|
545
542
|
import { createTaskFromTaskGroupTemplate } from './view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer';
|
|
546
543
|
import { createNewTaskGroup, deleteTaskGroup, fetchAllTaskGroups, updateTaskGroupName } from './view/taskManager/taskGroupView/taskGroupViewReducer';
|
|
547
|
-
import { DueDateGroupKey, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, TaskFilterCategory, TaskGroupKey, TaskListFilterCategoryField, TaskListFilters, TaskListLocalData, TaskListUIState, TaskListViewSortKey, toDueDateGroupKeyType, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict
|
|
548
|
-
import { bulkUpdateTaskList, dragNDropTasks, fetchTaskListPage, initiateTaskListLocalData,
|
|
544
|
+
import { DueDateGroupKey, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, TaskFilterCategory, TaskGroupKey, TaskListFilterCategoryField, TaskListFilters, TaskListLocalData, TaskListUIState, TaskListViewSortKey, toDueDateGroupKeyType, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict } from './view/taskManager/taskListView/taskList';
|
|
545
|
+
import { bulkUpdateTaskList, dragNDropTasks, fetchTaskListPage, initiateTaskListLocalData, updateTaskFilters, updateTaskFromListView, updateTaskListLocalData, updateTaskListSearchText, updateTaskListUIState } from './view/taskManager/taskListView/taskListReducer';
|
|
549
546
|
import { TaskGroupWithTasksList, TaskListSelectorView, TaskWithUserDetails, getAllTasks } from './view/taskManager/taskListView/taskListSelector';
|
|
550
547
|
import { getDueDateValueFromDueDateGroupId, getTaskUpdates } from './view/taskManager/taskListView/taskListViewHelpers';
|
|
551
548
|
import { fetchTasksCard } from './view/tasksCard/tasksCardReducer';
|
|
@@ -611,10 +608,6 @@ import { ZeniAccStatementsSelectorView, getZeniAccStatements } from './view/zeni
|
|
|
611
608
|
import { fetchZeniAccountsPromoCard } from './view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer';
|
|
612
609
|
import { ZeniAccountsPromoCardReport, getZeniAccountsPromoCard } from './view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector';
|
|
613
610
|
import { ZeniAccountsPromoCardState } from './view/zeniAccountsPromoCard/zeniAccountsPromoCardState';
|
|
614
|
-
import { ApproveOAuthConsentPayload, approveOAuthConsent, approveOAuthConsentFailure, approveOAuthConsentSuccess, clearZeniOAuthView } from './view/zeniOAuthView/zeniOAuthReducer';
|
|
615
|
-
import { OAuthParams, ParseOAuthParamsResult, parseOAuthParams } from './view/zeniOAuthView/zeniOAuthParamsParser';
|
|
616
|
-
import { getZeniOAuthApproveError, getZeniOAuthApproveFetchState, getZeniOAuthApproveRedirectUrl } from './view/zeniOAuthView/zeniOAuthSelector';
|
|
617
|
-
import { ZeniOAuthViewState } from './view/zeniOAuthView/zeniOAuthState';
|
|
618
611
|
import { RESTAPIEndpoints } from './zeniAPI';
|
|
619
612
|
import { Dayjs, ZeniDate, date, dateFromYearMonthDate, dateInLocal, dateLocal, dateNow, getBusinessDayOfDate, getLocalTimezone, getMinDate, getMonthIndex, setLocalTimezone, updateZeniDateLocaleID } from './zeniDayJS';
|
|
620
613
|
import { ZeniUrl, toZeniUrl, toZeniUrlWithoutBaseURL } from './zeniUrl';
|
|
@@ -854,13 +847,12 @@ export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGl
|
|
|
854
847
|
export { approveVendorGlobalReview, rejectVendorGlobalReview, fetchVendorGlobalReviewView, updateSelectedGlobalMerchant, updateVendorGlobalReviewViewUIState, getVendorGlobalReviewView, getTenantMerchantByMerchantId, toVendorGlobalReviewColumnSortKeyType, VendorGlobalReview, VendorGlobalReviewViewUIState, VendorGlobalReviewViewColumnSortKey, VendorGlobalReviewViewSelectorView, VendorGlobalReviewViewState, VendorGlobalReviewViewLocalData, updateVendorGlobalReviewViewLocalData, GlobalReviewPageCurrentSelectionByColumn, GlobalRecommendationFetchSource, };
|
|
855
848
|
export { fetchArAging, updateArAgingUIState, fetchArAgingDetail, updateArAgingDetailUIState, ArAgingReport, ArAgingDetail, NestedAgingBalancesByCustomer, getArAgingReport, getArAgingDetailForCustomer, updateArAgingNodeCollapseState, };
|
|
856
849
|
export { toRecurringBillFrequency, toRecurringBillFrequencyStrict, RecurringBillFrequency, RecurringBillDetail, RecurringBillConfig, RecurringBillStatus, RecurringBillPaymentStatus, };
|
|
857
|
-
export { Task, TaskListSelectorView, TaskWithUserDetails, TaskListViewSortKey, TaskListUIState, TaskDetailSelectorView, EditTaskLocalData, TaskStatusCodeType, PriorityCodeType, getTaskGroupById, TaskStatus, TaskPriority, TaskCodeType, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, archiveTask,
|
|
850
|
+
export { Task, TaskListSelectorView, TaskWithUserDetails, TaskListViewSortKey, TaskListUIState, TaskDetailSelectorView, EditTaskLocalData, TaskStatusCodeType, PriorityCodeType, getTaskGroupById, TaskStatus, TaskPriority, TaskCodeType, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, archiveTask, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, TaskListFilters, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, TaskListFilterCategoryField, deleteTask, discardTaskUpdatesInLocalStore, TaskFilterCategory, TaskType, TaskGroupWithTasksList, TaskListLocalData, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, TaskGroupState, TaskGroupKey, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, DueDateGroupKey, toDueDateGroupKeyType, updateTaskFromListView, convertHHMMStrToMinutes, initialTaskDetailLocalData, };
|
|
858
851
|
export { Tag, TagState, TagViewState, getAllTags, TagViewSelectorView, fetchTagList, createTag, deleteTag, };
|
|
859
852
|
export { CardPayment, CardPaymentViewState, SetupIntentData, CardPaymentSelectorView, getAllCardsAndBankPaymentMethods, createCardSetupIntent, confirmCardSetupIntent, addCardPaymentSource, fetchPaymentSources, resetCardPaymentErrorStatuses, clearCardPaymentView, AddCardPaymentSourceType, };
|
|
860
853
|
export { getAuditReportGroupViewSelectorView, getAuditRuleGroupViewSelectorView, getUserFromAllUsers, AuditReportGroupSelectorView, AuditReportGroupViewSelectorView, AuditRuleGroupViewSelectorView, fetchAuditRuleGroupView, fetchAuditReportGroupView, saveReasonForAuditRule, AuditRuleGroup, AuditRuleGroupReport, AuditReportRule, AuditRuleEntityType, AuditRuleEntityIdType, AuditRuleBypassReason, clearAuditReportGroupViewByCompanyId, };
|
|
861
854
|
export { AuthenticationFeatureType, AuthenticationDetails, AuthenticationViewState, fetchCollaborationAuthToken, getAuthenticationView, };
|
|
862
855
|
export { ZeniAccountsPromoCardState, getZeniAccountsPromoCard, ZeniAccountsPromoCardReport, fetchZeniAccountsPromoCard, };
|
|
863
|
-
export { ApproveOAuthConsentPayload, OAuthParams, ParseOAuthParamsResult, ZeniOAuthViewState, approveOAuthConsent, approveOAuthConsentFailure, approveOAuthConsentSuccess, clearZeniOAuthView, getZeniOAuthApproveError, getZeniOAuthApproveFetchState, getZeniOAuthApproveRedirectUrl, parseOAuthParams, };
|
|
864
856
|
export { ExternalNotificationData, NotificationGroup, NotificationActivityType, NotificationIdentifierType, NotificationUpdateValue, NotificationMode, NotificationStatus, Notification, NotificationWithAuthors, NotificationMetaData, NotificationEventData, NotificationActivity, NotificationUpdates, NotificationValueFormat, toNotificationModeStrict, updateCommentsNotifications, updateCommentsNotificationsStatuses, };
|
|
865
857
|
export { NotificationView, NotificationViewUIState, NotificationTabState, NotificationTabType, NotificationSubTabType, toNotificationSubTabTypeStrict, toNotificationTabTypeStrict, fetchNotificationView, fetchNotificationUnreadCount, fetchNotificationUnreadCountSuccess, updateNotificationViewAllNotificationsStatus, updateNotificationViewNotificationStatus, updateNotificationViewTabState, updateNotificationViewCurrentTabAndSubTab, updateNotificationViewSubTab, updateNotificationViewUIState, getNotificationView, getExternalNotificationsForSelectedSubTab, getNotificationsForSelectedSubTab, };
|
|
866
858
|
export { pushToastNotification, ToastNotification, ToastNotificationPayload, getLastNotificationTime, getNotifications, };
|
package/lib/index.js
CHANGED
|
@@ -65,12 +65,11 @@ exports.fetchIssueCardPage = exports.issueChargeCards = exports.toCardType = exp
|
|
|
65
65
|
exports.toTimeSeriesDuration = exports.convertToTimeSeriesSelectionRange = exports.TIME_SERIES_DURATIONS = exports.anyCardOnHold = exports.getChargeCardById = exports.setCurrentDisplayedCardId = exports.setFirstViewCompleteAfterActivation = exports.setFirstViewAfterActivation = exports.completeCardUserOnboardingActivationWait = exports.startCardUserOnboardingActivationWait = exports.fetchChargeCardsRecurringExpenses = exports.updateChargeCardsSpendLimit = exports.closeChargeCards = exports.unlockChargeCards = exports.lockChargeCards = exports.revokeChargeCardsInvite = exports.updateRowActionCardId = exports.revokeCardInvite = exports.resendCardInvite = exports.updateChargeCardSpendLimitSuccessOrFailure = exports.updateChargeCardSpendLimit = exports.startCVVActivationWait = exports.completeCVVActivationWait = exports.fetchChargeCardTransactionAttachments = exports.updateChargeCardTransactionIsViewReceiptClicked = exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = exports.updateDebitCardPinAttempt = exports.startDebitCardSetPinWait = exports.completeDebitCardSetPinWait = exports.updateChargeCardTransactionUploadReceiptsFetchStatus = exports.saveCardOnboardingUserDetails = exports.updateCardUserOnboardingLocalData = exports.initializeCardUserOnboardingLocalData = exports.getCardUserOnboardingView = exports.updateChargeCardName = exports.closeChargeCard = exports.unlockChargeCard = exports.lockChargeCard = exports.updatePhysicalChargeCardAttempt = exports.updateChargeCardDetail = exports.updateCashbackDetailUIState = exports.updateChargeCardListUIState = exports.updateChargeCardListSearchText = exports.updateBulkActionCardIds = exports.resetIssueChargeCardForm = exports.updateChargeCardsLocalStore = exports.updateCustomAddressId = exports.getDebitCardSummary = exports.getDebitCardList = exports.fetchDepositAccountListForCards = void 0;
|
|
66
66
|
exports.toScheduleSubTabType = exports.toScheduleListTabsFileTypeStrict = exports.toScheduleTypesTypeStrict = exports.toScheduleTypesType = exports.getFetchStateForScheduleAccountList = exports.updateScheduleListLocalData = exports.fetchSchedulesAccount = exports.fetchDownloadSchedules = exports.fetchAccruedScheduleList = exports.fetchScheduleList = exports.getAccruedScheduleListReport = exports.getScheduleListReport = exports.ALL_SCHEDULES_TYPES = exports.getJEScheduleTransactionKey = exports.resetAccruedDetailNewScheduleState = exports.resetSelectedJEAccruedScheduleKey = exports.updateSelectedJEAccruedScheduleKey = exports.updateScheduleAccruedDetailsLocalData = exports.updateLinkBillExpenseLocalData = exports.clearSelectedJELinkRowIndex = exports.fetchRecommendedTransactionRowIndex = exports.updatedJELinkInLocalDataAccruedExpenses = exports.updatedJEAccruedLinkWithRecommendedLocalData = exports.updateAmountsInScheduleAccruedDetail = exports.saveScheduleAccruedDetails = exports.resetJEAccruedLinkInLocalData = exports.fetchScheduleAccruedDetailsPage = exports.fetchScheduleAccruedDetails = exports.cancelScheduleAccruedJournalEntry = exports.deleteScheduleAccruedDetail = exports.createNewSchedulesAccrued = exports.updateJeScheduleTransactionKeys = exports.updateJeScheduleLocalDataById = exports.updateExpenseAutomationJESchedulesUIState = exports.retryExpenseAutomationJESchedule = exports.removeJeScheduleTransactionKey = exports.initializeJeScheduleLocalData = exports.initializeJeAccountSettingsView = exports.ignoreExpenseAutomationJESchedule = exports.fetchExpenseAutomationJESchedulesPage = exports.clearExpenseAutomationJESchedulesView = exports.clearExpenseAutomationJEScheduleLocalData = exports.updateApAgingDetailUIState = exports.getApAgingDetailForVendor = exports.fetchApAgingDetail = exports.updateApAgingUIState = exports.getApAgingReport = exports.fetchApAging = exports.aggregatedReportView = exports.fetchAggregatedReport = void 0;
|
|
67
67
|
exports.updateCreateGlobalMerchantLocalData = exports.createGlobalMerchant = exports.fetchGlobalMerchantRecommendation = exports.getVendorDetailSelectorView = exports.saveVendorDetailsView = exports.updateReviewVendorDetailLocalData = exports.clearGlobalMerchantAutoCompleteResults = exports.fetchGlobalMerchantAutoCompleteView = exports.updateVendorFirstReviewSortUiState = exports.updateVendorFirstReviewViewLocalData = exports.saveVendorFirstReviewView = exports.clearRecentlySavedErroredVendorData = exports.updateVendorFirstReviewViewPageToken = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewScrollYOffset = exports.fetchVendorFirstReviewAttachments = exports.fetchVendorFirstReviewView = exports.getVendorFirstReviewAttachmentView = exports.getVendorFirstReviewView = exports.getGlobalMerchantAutoCompleteResults = exports.toVendorFirstReviewViewColumnKeyType = exports.getVendorTabView = exports.updateVendorTabViewTab = exports.fetchVendorTabView = exports.resetMarkAsCompleteStatus = exports.markAsCompleteScheduleDetail = exports.getDefaultSelectedTimeframeForScheduleType = exports.getFetchStateForScheduleListByType = exports.updatedJELinkWithRecommendedLocalData = exports.resetJELinkInLocalData = exports.updateAmountsInScheduleDetail = exports.updatedJELinkInLocalData = exports.getThirdPartyIDFromQBOURL = exports.getQBOUrlForLink = exports.updatedSelectedJELinkRowIndex = exports.updateAccruedJEScheduleAccruedByListKey = exports.updateScheduleListDownloadState = exports.updateScheduleDetailsLocalData = exports.createNewSchedules = exports.deleteScheduleDetail = exports.saveScheduleDetails = exports.fetchScheduleDetailsPage = exports.getAccruedScheduleDetailsView = exports.getScheduleDetailsView = exports.fetchScheduleDetails = exports.updateSelectedJEScheduleKey = exports.updateScheduleListSortState = exports.updateScheduleListScrollState = exports.updateScheduleListSearchText = exports.updateScheduleListSubTab = void 0;
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
70
|
-
exports.
|
|
71
|
-
exports.
|
|
72
|
-
exports.
|
|
73
|
-
exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = void 0;
|
|
68
|
+
exports.getDueDateValueFromDueDateGroupId = exports.initialTaskDetail = exports.fetchAllTaskGroups = exports.getTaskUpdates = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.updateTaskGroupName = exports.dragNDropTasks = exports.updateTaskListLocalData = exports.deleteTaskGroup = exports.initiateTaskListLocalData = exports.createNewTaskGroup = exports.bulkUpdateTaskList = exports.discardTaskUpdatesInLocalStore = exports.deleteTask = exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.updateTaskFilters = exports.allTaskPriority = exports.allTaskStatus = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.archiveTask = exports.saveTaskDetail = exports.saveTaskUpdatesToLocalStore = exports.fetchTaskDetailPage = exports.getTaskDetail = exports.fetchTaskListPage = exports.getAllTasks = exports.getTaskGroupById = exports.toRecurringBillFrequencyStrict = exports.toRecurringBillFrequency = exports.updateArAgingNodeCollapseState = exports.getArAgingDetailForCustomer = exports.getArAgingReport = exports.updateArAgingDetailUIState = exports.fetchArAgingDetail = exports.updateArAgingUIState = exports.fetchArAging = exports.updateVendorGlobalReviewViewLocalData = exports.toVendorGlobalReviewColumnSortKeyType = exports.getTenantMerchantByMerchantId = exports.getVendorGlobalReviewView = exports.updateVendorGlobalReviewViewUIState = exports.updateSelectedGlobalMerchant = exports.fetchVendorGlobalReviewView = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.getGlobalMerchantView = exports.clearGlobalMerchantView = void 0;
|
|
69
|
+
exports.getInviteFormView = exports.getReferralListView = exports.getNotifications = exports.getLastNotificationTime = exports.pushToastNotification = exports.getNotificationsForSelectedSubTab = exports.getExternalNotificationsForSelectedSubTab = exports.getNotificationView = exports.updateNotificationViewUIState = exports.updateNotificationViewSubTab = exports.updateNotificationViewCurrentTabAndSubTab = exports.updateNotificationViewTabState = exports.updateNotificationViewNotificationStatus = exports.updateNotificationViewAllNotificationsStatus = exports.fetchNotificationUnreadCountSuccess = exports.fetchNotificationUnreadCount = exports.fetchNotificationView = exports.toNotificationTabTypeStrict = exports.toNotificationSubTabTypeStrict = exports.updateCommentsNotificationsStatuses = exports.updateCommentsNotifications = exports.toNotificationModeStrict = exports.fetchZeniAccountsPromoCard = exports.getZeniAccountsPromoCard = exports.getAuthenticationView = exports.fetchCollaborationAuthToken = exports.clearAuditReportGroupViewByCompanyId = exports.saveReasonForAuditRule = exports.fetchAuditReportGroupView = exports.fetchAuditRuleGroupView = exports.getUserFromAllUsers = exports.getAuditRuleGroupViewSelectorView = exports.getAuditReportGroupViewSelectorView = exports.clearCardPaymentView = exports.resetCardPaymentErrorStatuses = exports.fetchPaymentSources = exports.addCardPaymentSource = exports.confirmCardSetupIntent = exports.createCardSetupIntent = exports.getAllCardsAndBankPaymentMethods = exports.deleteTag = exports.createTag = exports.fetchTagList = exports.getAllTags = exports.initialTaskDetailLocalData = exports.convertHHMMStrToMinutes = exports.updateTaskFromListView = exports.toDueDateGroupKeyType = exports.toTaskStatusCodeType = exports.toPriorityCodeType = void 0;
|
|
70
|
+
exports.getAiAccountantCustomers = exports.updateAiAccountantJobs = exports.updateAiAccountantCustomer = exports.updateAiAccountantCustomers = exports.clearAllAiAccountantCustomers = exports.toAiAccountantJob = exports.toAiAccountantEnrollment = exports.toAiAccountantCustomer = exports.toAiAccountantOperationType = exports.toAiAccountantJobStatus = exports.toAiAccountantEnrollmentStatus = exports.getAllowedOperationsForStatus = exports.getTreasuryFundsMaximumYield = exports.getTreasurySetupViewDetails = exports.updateTreasuryVideoViewed = exports.updateFundAllocationLocalData = exports.fetchPortfolioAllocation = exports.updatePortfolioAllocation = exports.fetchTreasuryFunds = exports.clearTreasurySetupView = exports.fetchTreasurySetupView = exports.acceptTreasuryTerms = exports.getExpressPayView = exports.resetExpressPayLocalData = exports.submitExpressPay = exports.updateExpressPayFormLocalData = exports.fetchExpressPayInitialDetails = exports.getIntlWireVerificationView = exports.updateVerificationFormLocalData = exports.submitInternationalVerificationForm = exports.fetchInternationalVerificationForm = exports.createTaskFromTaskGroupTemplate = exports.getCompanyTaskManagerView = exports.fetchTaskManagerMetrics = exports.fetchCompanyTaskManagerView = exports.getMinAllowedEndDate = exports.toRecurringFrequency = exports.getRecurringEndDateFromCount = exports.updateReferViewed = exports.getRewardsPlanCard = exports.fetchRewardsPlan = exports.resendReferralInvite = exports.updateReferralListSortUiState = exports.saveReferralFormDataInLocalStore = exports.clearReferrals = exports.sendReferralInvite = exports.fetchReferrals = exports.AmountStatusTypes = exports.StatusTypes = exports.toReferralListViewSortKeyType = void 0;
|
|
71
|
+
exports.ALL_AI_CFO_ANSWER_STATE_TYPES = exports.ALL_AI_CFO_VISUALIZATION_TYPES = exports.ALL_AI_CFO_CHARTS_TYPES = exports.getAiCfoSelectorView = exports.getAllQuestionsForChatSession = exports.getQuestionAnswerByIdForChatSession = exports.getAllQuestionAnswersForChatSession = exports.toAiCfoVisualization = exports.clearAiCfo = exports.clearSession = exports.addQuestionPayload = exports.upsertOrAddQuestionAnswerPayload = exports.upsertAnswerPayload = exports.setSessions = exports.setNewSession = exports.getSuggestedQuestionsForPageContext = exports.getAiCfoView = exports.clearAiCfoSidePanelHostPageContext = exports.applyAiCfoSidePanelHostPageTransition = exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateResponseState = exports.deleteChatSession = exports.acceptMasterTOS = exports.fetchChatHistory = exports.stopSubmitQuestion = exports.stopSubmit = exports.createSessionAndSubmit = exports.clearLastContextMessage = exports.clearDeleteChatSessionStatus = exports.clearCurrentSessionId = exports.clearAiCfoView = exports.setSession = exports.clearInput = exports.updateCotCollapsedState = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.submitQuestion = exports.createSession = exports.fetchChatSessionsForUser = exports.getAiAccountantCockpitView = exports.updateAiAccountantUIState = exports.triggerAiAccountantJob = exports.setSelectedTenantIdsForJobTrigger = exports.fetchAiAccountantJobs = exports.fetchAiAccountantCustomers = exports.clearAiAccountantView = exports.cancelAiAccountantOnboarding = exports.getAiAccountantJobsByTenantId = void 0;
|
|
72
|
+
exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.toMessageType = exports.toMessageSender = exports.toAiCfoAnswerResponseTypeStrict = exports.toAiCfoAnswerResponseType = exports.toAiCfoAnswerStateTypeStrict = exports.toAiCfoAnswerStateType = exports.toAiCfoChartTypeStrict = exports.toAiCfoChartType = exports.toAiCfoVisualizationTypeStrict = exports.toAiCfoVisualizationType = exports.ALL_AI_CFO_ANSWER_RESPONSE_TYPES = void 0;
|
|
74
73
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
75
74
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
76
75
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -1814,14 +1813,6 @@ Object.defineProperty(exports, "discardTaskUpdatesInLocalStore", { enumerable: t
|
|
|
1814
1813
|
Object.defineProperty(exports, "fetchTaskDetailPage", { enumerable: true, get: function () { return taskDetailReducer_1.fetchTaskDetailPage; } });
|
|
1815
1814
|
Object.defineProperty(exports, "saveTaskDetail", { enumerable: true, get: function () { return taskDetailReducer_1.saveTaskDetail; } });
|
|
1816
1815
|
Object.defineProperty(exports, "saveTaskUpdatesToLocalStore", { enumerable: true, get: function () { return taskDetailReducer_1.saveTaskUpdatesToLocalStore; } });
|
|
1817
|
-
Object.defineProperty(exports, "snoozeTask", { enumerable: true, get: function () { return taskDetailReducer_1.snoozeTask; } });
|
|
1818
|
-
Object.defineProperty(exports, "unsnoozeTask", { enumerable: true, get: function () { return taskDetailReducer_1.unsnoozeTask; } });
|
|
1819
|
-
const cannedResponsesReducer_1 = require("./view/taskManager/cannedResponsesView/cannedResponsesReducer");
|
|
1820
|
-
Object.defineProperty(exports, "deleteCannedResponse", { enumerable: true, get: function () { return cannedResponsesReducer_1.deleteCannedResponse; } });
|
|
1821
|
-
Object.defineProperty(exports, "fetchCannedResponses", { enumerable: true, get: function () { return cannedResponsesReducer_1.fetchCannedResponses; } });
|
|
1822
|
-
Object.defineProperty(exports, "saveCannedResponse", { enumerable: true, get: function () { return cannedResponsesReducer_1.saveCannedResponse; } });
|
|
1823
|
-
const cannedResponsesSelector_1 = require("./view/taskManager/cannedResponsesView/cannedResponsesSelector");
|
|
1824
|
-
Object.defineProperty(exports, "getCannedResponsesView", { enumerable: true, get: function () { return cannedResponsesSelector_1.getCannedResponsesView; } });
|
|
1825
1816
|
const taskDetailSelector_1 = require("./view/taskManager/taskDetailView/taskDetailSelector");
|
|
1826
1817
|
Object.defineProperty(exports, "allTaskPriority", { enumerable: true, get: function () { return taskDetailSelector_1.allTaskPriority; } });
|
|
1827
1818
|
Object.defineProperty(exports, "allTaskStatus", { enumerable: true, get: function () { return taskDetailSelector_1.allTaskStatus; } });
|
|
@@ -1839,18 +1830,15 @@ Object.defineProperty(exports, "TASK_LIST_GROUP_BY_CATEGORIES", { enumerable: tr
|
|
|
1839
1830
|
Object.defineProperty(exports, "toDueDateGroupKeyType", { enumerable: true, get: function () { return taskList_1.toDueDateGroupKeyType; } });
|
|
1840
1831
|
Object.defineProperty(exports, "toTaskListGroupByKeyType", { enumerable: true, get: function () { return taskList_1.toTaskListGroupByKeyType; } });
|
|
1841
1832
|
Object.defineProperty(exports, "toTaskListGroupByKeyTypeStrict", { enumerable: true, get: function () { return taskList_1.toTaskListGroupByKeyTypeStrict; } });
|
|
1842
|
-
Object.defineProperty(exports, "ALL_TASK_LIST_TABS", { enumerable: true, get: function () { return taskList_1.ALL_TASK_LIST_TABS; } });
|
|
1843
1833
|
const taskListReducer_1 = require("./view/taskManager/taskListView/taskListReducer");
|
|
1844
1834
|
Object.defineProperty(exports, "bulkUpdateTaskList", { enumerable: true, get: function () { return taskListReducer_1.bulkUpdateTaskList; } });
|
|
1845
1835
|
Object.defineProperty(exports, "dragNDropTasks", { enumerable: true, get: function () { return taskListReducer_1.dragNDropTasks; } });
|
|
1846
1836
|
Object.defineProperty(exports, "fetchTaskListPage", { enumerable: true, get: function () { return taskListReducer_1.fetchTaskListPage; } });
|
|
1847
1837
|
Object.defineProperty(exports, "initiateTaskListLocalData", { enumerable: true, get: function () { return taskListReducer_1.initiateTaskListLocalData; } });
|
|
1848
|
-
Object.defineProperty(exports, "removeTaskFromList", { enumerable: true, get: function () { return taskListReducer_1.removeTaskFromList; } });
|
|
1849
1838
|
Object.defineProperty(exports, "updateTaskFilters", { enumerable: true, get: function () { return taskListReducer_1.updateTaskFilters; } });
|
|
1850
1839
|
Object.defineProperty(exports, "updateTaskFromListView", { enumerable: true, get: function () { return taskListReducer_1.updateTaskFromListView; } });
|
|
1851
1840
|
Object.defineProperty(exports, "updateTaskListLocalData", { enumerable: true, get: function () { return taskListReducer_1.updateTaskListLocalData; } });
|
|
1852
1841
|
Object.defineProperty(exports, "updateTaskListSearchText", { enumerable: true, get: function () { return taskListReducer_1.updateTaskListSearchText; } });
|
|
1853
|
-
Object.defineProperty(exports, "updateTaskListTab", { enumerable: true, get: function () { return taskListReducer_1.updateTaskListTab; } });
|
|
1854
1842
|
Object.defineProperty(exports, "updateTaskListUIState", { enumerable: true, get: function () { return taskListReducer_1.updateTaskListUIState; } });
|
|
1855
1843
|
const taskListSelector_1 = require("./view/taskManager/taskListView/taskListSelector");
|
|
1856
1844
|
Object.defineProperty(exports, "getAllTasks", { enumerable: true, get: function () { return taskListSelector_1.getAllTasks; } });
|
|
@@ -2048,17 +2036,6 @@ const zeniAccountsPromoCardReducer_1 = require("./view/zeniAccountsPromoCard/zen
|
|
|
2048
2036
|
Object.defineProperty(exports, "fetchZeniAccountsPromoCard", { enumerable: true, get: function () { return zeniAccountsPromoCardReducer_1.fetchZeniAccountsPromoCard; } });
|
|
2049
2037
|
const zeniAccountsPromoCardSelector_1 = require("./view/zeniAccountsPromoCard/zeniAccountsPromoCardSelector");
|
|
2050
2038
|
Object.defineProperty(exports, "getZeniAccountsPromoCard", { enumerable: true, get: function () { return zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard; } });
|
|
2051
|
-
const zeniOAuthReducer_1 = require("./view/zeniOAuthView/zeniOAuthReducer");
|
|
2052
|
-
Object.defineProperty(exports, "approveOAuthConsent", { enumerable: true, get: function () { return zeniOAuthReducer_1.approveOAuthConsent; } });
|
|
2053
|
-
Object.defineProperty(exports, "approveOAuthConsentFailure", { enumerable: true, get: function () { return zeniOAuthReducer_1.approveOAuthConsentFailure; } });
|
|
2054
|
-
Object.defineProperty(exports, "approveOAuthConsentSuccess", { enumerable: true, get: function () { return zeniOAuthReducer_1.approveOAuthConsentSuccess; } });
|
|
2055
|
-
Object.defineProperty(exports, "clearZeniOAuthView", { enumerable: true, get: function () { return zeniOAuthReducer_1.clearZeniOAuthView; } });
|
|
2056
|
-
const zeniOAuthParamsParser_1 = require("./view/zeniOAuthView/zeniOAuthParamsParser");
|
|
2057
|
-
Object.defineProperty(exports, "parseOAuthParams", { enumerable: true, get: function () { return zeniOAuthParamsParser_1.parseOAuthParams; } });
|
|
2058
|
-
const zeniOAuthSelector_1 = require("./view/zeniOAuthView/zeniOAuthSelector");
|
|
2059
|
-
Object.defineProperty(exports, "getZeniOAuthApproveError", { enumerable: true, get: function () { return zeniOAuthSelector_1.getZeniOAuthApproveError; } });
|
|
2060
|
-
Object.defineProperty(exports, "getZeniOAuthApproveFetchState", { enumerable: true, get: function () { return zeniOAuthSelector_1.getZeniOAuthApproveFetchState; } });
|
|
2061
|
-
Object.defineProperty(exports, "getZeniOAuthApproveRedirectUrl", { enumerable: true, get: function () { return zeniOAuthSelector_1.getZeniOAuthApproveRedirectUrl; } });
|
|
2062
2039
|
const zeniDayJS_1 = require("./zeniDayJS");
|
|
2063
2040
|
Object.defineProperty(exports, "Dayjs", { enumerable: true, get: function () { return zeniDayJS_1.Dayjs; } });
|
|
2064
2041
|
Object.defineProperty(exports, "zeniDate", { enumerable: true, get: function () { return zeniDayJS_1.date; } });
|
package/lib/init.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Options } from 'pusher-js/with-encryption';
|
|
1
|
+
import Pusher, { Options } from 'pusher-js';
|
|
3
2
|
import { Store } from 'redux';
|
|
4
3
|
import { ID } from './commonStateTypes/common';
|
|
5
4
|
import { RootState } from './reducer';
|
|
@@ -7,7 +6,7 @@ import { RESTAPIEndpoints, ZeniAPI } from './zeniAPI';
|
|
|
7
6
|
export type ZeniStore = Store<RootState>;
|
|
8
7
|
export declare let zeniAPI: ZeniAPI;
|
|
9
8
|
export declare let store: ZeniStore;
|
|
10
|
-
declare let pusher: Pusher
|
|
9
|
+
declare let pusher: Pusher;
|
|
11
10
|
/**
|
|
12
11
|
* Call initialize before using any of the functionalities in this module
|
|
13
12
|
* Note: This version SHOULD BE used only in the client side. Not intended to be used
|
|
@@ -17,7 +16,6 @@ declare let pusher: Pusher | undefined;
|
|
|
17
16
|
export default function initialize(restEndPoints: RESTAPIEndpoints, userId?: string, sessionId?: string, tenantId?: string, isSandboxEnv?: boolean, onSessionInvalidated?: () => void): ZeniStore;
|
|
18
17
|
export interface PusherAuthPayload {
|
|
19
18
|
auth: ID;
|
|
20
|
-
shared_secret: ID;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
21
|
* Call initializePusher before using pusher in web-app
|
|
@@ -26,7 +24,7 @@ export declare function initializePusher(pusherClientSecret: ID, options: Option
|
|
|
26
24
|
sessionId: ID;
|
|
27
25
|
tenantId: ID;
|
|
28
26
|
userId: ID;
|
|
29
|
-
}, reInitialize?: boolean):
|
|
27
|
+
}, reInitialize?: boolean): Pusher | undefined;
|
|
30
28
|
export declare function disconnectPusher(): void;
|
|
31
29
|
export { pusher };
|
|
32
30
|
export { injectFeatureModules, injectFeatureEpics } from './configureStore';
|
package/lib/init.js
CHANGED
|
@@ -44,6 +44,7 @@ exports.updateZeniAPIClientConfig = updateZeniAPIClientConfig;
|
|
|
44
44
|
exports.zeniAPIClientConfig = zeniAPIClientConfig;
|
|
45
45
|
exports.initializeWithNewStore = initializeWithNewStore;
|
|
46
46
|
exports.initialize3rdPartyExtensions = initialize3rdPartyExtensions;
|
|
47
|
+
const pusher_js_1 = __importDefault(require("pusher-js"));
|
|
47
48
|
const configureStore_1 = __importDefault(require("./configureStore"));
|
|
48
49
|
const zeniAPI_1 = require("./zeniAPI");
|
|
49
50
|
let pusher;
|
|
@@ -67,23 +68,10 @@ function initialize(restEndPoints, userId, sessionId, tenantId, isSandboxEnv, on
|
|
|
67
68
|
return exports.store;
|
|
68
69
|
}
|
|
69
70
|
let isPusherInitialized = false;
|
|
70
|
-
// Caches an in-flight initializePusher() promise so that concurrent callers
|
|
71
|
-
// share a single Pusher instance instead of each constructing their own and
|
|
72
|
-
// leaking WebSocket connections (see Bugbot review on PR #2983). Cleared in
|
|
73
|
-
// the IIFE's `finally` once construction settles.
|
|
74
|
-
let pusherInitPromise;
|
|
75
71
|
/**
|
|
76
72
|
* Call initializePusher before using pusher in web-app
|
|
77
73
|
*/
|
|
78
|
-
|
|
79
|
-
// Pusher subscribes/decrypts only make sense in the browser. `pusher-js/
|
|
80
|
-
// with-encryption` resolves to a browser-only bundle that references
|
|
81
|
-
// `window` at module init, so even *importing* it on the server crashes.
|
|
82
|
-
// Bail out early on SSR/Node so the dynamic import below never executes.
|
|
83
|
-
if (typeof window === 'undefined') {
|
|
84
|
-
console.warn(`initializePusher called on server-side; pusher-js/with-encryption is browser-only — skipping.`);
|
|
85
|
-
return undefined;
|
|
86
|
-
}
|
|
74
|
+
function initializePusher(pusherClientSecret, options, headers, reInitialize = false) {
|
|
87
75
|
if (Boolean(exports.zeniAPI.userId) === false ||
|
|
88
76
|
Boolean(exports.zeniAPI.tenantId) === false ||
|
|
89
77
|
!initialized) {
|
|
@@ -94,59 +82,19 @@ async function initializePusher(pusherClientSecret, options, headers, reInitiali
|
|
|
94
82
|
console.warn(`Already initialized pusher`);
|
|
95
83
|
return pusher;
|
|
96
84
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// inside the try is `await import(...)`, which always yields control —
|
|
111
|
-
// so the finally runs in a future microtask, after `currentInit` has
|
|
112
|
-
// already been assigned below. We declare it as `let … | undefined` so
|
|
113
|
-
// TS's definite-assignment analysis (which doesn't model the await) accepts
|
|
114
|
-
// the closure read; at runtime it's always the IIFE promise by then.
|
|
115
|
-
let currentInit = undefined;
|
|
116
|
-
currentInit = (async () => {
|
|
117
|
-
try {
|
|
118
|
-
// Dynamic import so the browser-only bundle is loaded only when this
|
|
119
|
-
// function actually runs (browser path). Works in both build outputs:
|
|
120
|
-
// • ESM (lib/esm): preserved as native `import()` → Vite/Rollup code-split
|
|
121
|
-
// • CJS (lib): TypeScript lowers to `Promise.resolve().then(() => require(...))`
|
|
122
|
-
// The pusher-js UMD wrapper does `module.exports = factory()` for CJS,
|
|
123
|
-
// so the module result is the Pusher class directly. Some bundlers wrap
|
|
124
|
-
// CJS in `{ default: ... }` for ESM interop — fall back to the module
|
|
125
|
-
// itself when `.default` is absent.
|
|
126
|
-
const pusherModule = (await Promise.resolve().then(() => __importStar(require('pusher-js/with-encryption'))));
|
|
127
|
-
const PusherConstructor = 'default' in pusherModule ? pusherModule.default : pusherModule;
|
|
128
|
-
const endpoint = `${exports.zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/notifications/push_notification/auth`;
|
|
129
|
-
exports.pusher = pusher = new PusherConstructor(pusherClientSecret, {
|
|
130
|
-
...options,
|
|
131
|
-
channelAuthorization: {
|
|
132
|
-
endpoint,
|
|
133
|
-
transport: 'ajax',
|
|
134
|
-
customHandler: (params, callback) => customHandler(params, headers, callback),
|
|
135
|
-
},
|
|
136
|
-
}).bind('error', function (err) {
|
|
137
|
-
console.warn('Pusher error', err);
|
|
138
|
-
});
|
|
139
|
-
console.info(`initializing with ${JSON.stringify(options)}`);
|
|
140
|
-
return pusher;
|
|
141
|
-
}
|
|
142
|
-
finally {
|
|
143
|
-
if (pusherInitPromise === currentInit) {
|
|
144
|
-
pusherInitPromise = undefined;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
})();
|
|
148
|
-
pusherInitPromise = currentInit;
|
|
149
|
-
return currentInit;
|
|
85
|
+
const endpoint = `${exports.zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/notifications/push_notification/auth`;
|
|
86
|
+
exports.pusher = pusher = new pusher_js_1.default(pusherClientSecret, {
|
|
87
|
+
...options,
|
|
88
|
+
channelAuthorization: {
|
|
89
|
+
endpoint,
|
|
90
|
+
transport: 'ajax',
|
|
91
|
+
customHandler: (params, callback) => customHandler(params, headers, callback),
|
|
92
|
+
},
|
|
93
|
+
}).bind('error', function (err) {
|
|
94
|
+
console.warn('Pusher error', err);
|
|
95
|
+
});
|
|
96
|
+
console.info(`initializing with ${JSON.stringify(options)}`);
|
|
97
|
+
return pusher;
|
|
150
98
|
}
|
|
151
99
|
const customHandler = async (params, headers, callback) => {
|
|
152
100
|
const { socketId, channelName } = params;
|
|
@@ -160,10 +108,7 @@ const customHandler = async (params, headers, callback) => {
|
|
|
160
108
|
.toPromise()
|
|
161
109
|
.then((response) => {
|
|
162
110
|
if (response.data != null) {
|
|
163
|
-
callback(null, {
|
|
164
|
-
auth: response.data.auth,
|
|
165
|
-
shared_secret: response.data.shared_secret,
|
|
166
|
-
});
|
|
111
|
+
callback(null, { auth: response.data.auth });
|
|
167
112
|
isPusherInitialized = true;
|
|
168
113
|
}
|
|
169
114
|
})
|