@droppii-org/chat-sdk 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/conversationBg.png +0 -0
- package/dist/components/message/MessageHeader.js +2 -2
- package/dist/components/message/MessageList.d.ts.map +1 -1
- package/dist/components/message/MessageList.js +9 -0
- package/dist/components/searchConversation/item/SearchItemAsUser.d.ts.map +1 -1
- package/dist/components/searchConversation/item/SearchItemAsUser.js +14 -3
- package/dist/hooks/collection/useMediaCollection.d.ts +229 -0
- package/dist/hooks/collection/useMediaCollection.d.ts.map +1 -0
- package/dist/hooks/collection/useMediaCollection.js +66 -0
- package/dist/hooks/conversation/useConversationStore.d.ts +3 -2
- package/dist/hooks/conversation/useConversationStore.d.ts.map +1 -1
- package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
- package/dist/hooks/message/useSendMessage.js +16 -11
- package/dist/hooks/search/useSearchConversation.d.ts +2 -0
- package/dist/hooks/search/useSearchConversation.d.ts.map +1 -0
- package/dist/hooks/search/useSearchConversation.js +1 -0
- package/dist/hooks/session/useGetSessionByTagOrStatus.d.ts +220 -0
- package/dist/hooks/session/useGetSessionByTagOrStatus.d.ts.map +1 -0
- package/dist/hooks/session/useGetSessionByTagOrStatus.js +72 -0
- package/dist/hooks/user/useUpdateFcmToken.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/common.js +1 -1
- package/package.json +1 -1
- package/dist/assets/openIM.wasm +0 -0
- package/dist/components/ChatBubble.d.ts +0 -10
- package/dist/components/ChatBubble.d.ts.map +0 -1
- package/dist/components/ChatBubble.js +0 -28
- package/dist/components/message/MessageItem.d.ts +0 -7
- package/dist/components/message/MessageItem.d.ts.map +0 -1
- package/dist/components/message/MessageItem.js +0 -21
- package/dist/components/message/footer/BottomSection.d.ts +0 -3
- package/dist/components/message/footer/BottomSection.d.ts.map +0 -1
- package/dist/components/message/footer/BottomSection.js +0 -6
- package/dist/screens/desk-message/index.d.ts +0 -3
- package/dist/screens/desk-message/index.d.ts.map +0 -1
- package/dist/screens/desk-message/index.js +0 -15
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/sdk.d.ts +0 -1
- package/dist/types/sdk.d.ts.map +0 -1
- package/dist/types/sdk.js +0 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { BaseResponse } from "../../types/dto";
|
|
2
|
+
import { IFilterSummary, ISessionByStatus } from "../../store/type";
|
|
3
|
+
export declare const useGetSessionByTagOrStatus: (filter: IFilterSummary) => {
|
|
4
|
+
error: Error;
|
|
5
|
+
isError: true;
|
|
6
|
+
isPending: false;
|
|
7
|
+
isLoadingError: false;
|
|
8
|
+
isRefetchError: true;
|
|
9
|
+
isSuccess: false;
|
|
10
|
+
isPlaceholderData: false;
|
|
11
|
+
status: "error";
|
|
12
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
13
|
+
hasPreviousPage: boolean;
|
|
14
|
+
isFetchNextPageError: boolean;
|
|
15
|
+
isFetchPreviousPageError: boolean;
|
|
16
|
+
isFetchingPreviousPage: boolean;
|
|
17
|
+
dataUpdatedAt: number;
|
|
18
|
+
errorUpdatedAt: number;
|
|
19
|
+
failureCount: number;
|
|
20
|
+
failureReason: Error | null;
|
|
21
|
+
errorUpdateCount: number;
|
|
22
|
+
isFetched: boolean;
|
|
23
|
+
isFetchedAfterMount: boolean;
|
|
24
|
+
isFetching: boolean;
|
|
25
|
+
isInitialLoading: boolean;
|
|
26
|
+
isPaused: boolean;
|
|
27
|
+
isRefetching: boolean;
|
|
28
|
+
isStale: boolean;
|
|
29
|
+
isEnabled: boolean;
|
|
30
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
31
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
32
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>>;
|
|
33
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown> | undefined;
|
|
34
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
35
|
+
hasNextPage: boolean;
|
|
36
|
+
isFetchingNextPage: boolean;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
dataFlatten: ISessionByStatus[];
|
|
39
|
+
} | {
|
|
40
|
+
error: null;
|
|
41
|
+
isError: false;
|
|
42
|
+
isPending: false;
|
|
43
|
+
isLoadingError: false;
|
|
44
|
+
isRefetchError: false;
|
|
45
|
+
isFetchNextPageError: false;
|
|
46
|
+
isFetchPreviousPageError: false;
|
|
47
|
+
isSuccess: true;
|
|
48
|
+
isPlaceholderData: false;
|
|
49
|
+
status: "success";
|
|
50
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
51
|
+
hasPreviousPage: boolean;
|
|
52
|
+
isFetchingPreviousPage: boolean;
|
|
53
|
+
dataUpdatedAt: number;
|
|
54
|
+
errorUpdatedAt: number;
|
|
55
|
+
failureCount: number;
|
|
56
|
+
failureReason: Error | null;
|
|
57
|
+
errorUpdateCount: number;
|
|
58
|
+
isFetched: boolean;
|
|
59
|
+
isFetchedAfterMount: boolean;
|
|
60
|
+
isFetching: boolean;
|
|
61
|
+
isInitialLoading: boolean;
|
|
62
|
+
isPaused: boolean;
|
|
63
|
+
isRefetching: boolean;
|
|
64
|
+
isStale: boolean;
|
|
65
|
+
isEnabled: boolean;
|
|
66
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
67
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
68
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>>;
|
|
69
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown> | undefined;
|
|
70
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
71
|
+
hasNextPage: boolean;
|
|
72
|
+
isFetchingNextPage: boolean;
|
|
73
|
+
isLoading: boolean;
|
|
74
|
+
dataFlatten: ISessionByStatus[];
|
|
75
|
+
} | {
|
|
76
|
+
error: Error;
|
|
77
|
+
isError: true;
|
|
78
|
+
isPending: false;
|
|
79
|
+
isLoadingError: true;
|
|
80
|
+
isRefetchError: false;
|
|
81
|
+
isFetchNextPageError: false;
|
|
82
|
+
isFetchPreviousPageError: false;
|
|
83
|
+
isSuccess: false;
|
|
84
|
+
isPlaceholderData: false;
|
|
85
|
+
status: "error";
|
|
86
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
87
|
+
hasPreviousPage: boolean;
|
|
88
|
+
isFetchingPreviousPage: boolean;
|
|
89
|
+
dataUpdatedAt: number;
|
|
90
|
+
errorUpdatedAt: number;
|
|
91
|
+
failureCount: number;
|
|
92
|
+
failureReason: Error | null;
|
|
93
|
+
errorUpdateCount: number;
|
|
94
|
+
isFetched: boolean;
|
|
95
|
+
isFetchedAfterMount: boolean;
|
|
96
|
+
isFetching: boolean;
|
|
97
|
+
isInitialLoading: boolean;
|
|
98
|
+
isPaused: boolean;
|
|
99
|
+
isRefetching: boolean;
|
|
100
|
+
isStale: boolean;
|
|
101
|
+
isEnabled: boolean;
|
|
102
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
103
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
104
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>>;
|
|
105
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown> | undefined;
|
|
106
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
107
|
+
hasNextPage: boolean;
|
|
108
|
+
isFetchingNextPage: boolean;
|
|
109
|
+
isLoading: boolean;
|
|
110
|
+
dataFlatten: ISessionByStatus[];
|
|
111
|
+
} | {
|
|
112
|
+
error: null;
|
|
113
|
+
isError: false;
|
|
114
|
+
isPending: true;
|
|
115
|
+
isLoadingError: false;
|
|
116
|
+
isRefetchError: false;
|
|
117
|
+
isFetchNextPageError: false;
|
|
118
|
+
isFetchPreviousPageError: false;
|
|
119
|
+
isSuccess: false;
|
|
120
|
+
isPlaceholderData: false;
|
|
121
|
+
status: "pending";
|
|
122
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
123
|
+
hasPreviousPage: boolean;
|
|
124
|
+
isFetchingPreviousPage: boolean;
|
|
125
|
+
dataUpdatedAt: number;
|
|
126
|
+
errorUpdatedAt: number;
|
|
127
|
+
failureCount: number;
|
|
128
|
+
failureReason: Error | null;
|
|
129
|
+
errorUpdateCount: number;
|
|
130
|
+
isFetched: boolean;
|
|
131
|
+
isFetchedAfterMount: boolean;
|
|
132
|
+
isFetching: boolean;
|
|
133
|
+
isInitialLoading: boolean;
|
|
134
|
+
isPaused: boolean;
|
|
135
|
+
isRefetching: boolean;
|
|
136
|
+
isStale: boolean;
|
|
137
|
+
isEnabled: boolean;
|
|
138
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
139
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
140
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>>;
|
|
141
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown> | undefined;
|
|
142
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
143
|
+
hasNextPage: boolean;
|
|
144
|
+
isFetchingNextPage: boolean;
|
|
145
|
+
isLoading: boolean;
|
|
146
|
+
dataFlatten: ISessionByStatus[];
|
|
147
|
+
} | {
|
|
148
|
+
error: null;
|
|
149
|
+
isError: false;
|
|
150
|
+
isPending: true;
|
|
151
|
+
isLoadingError: false;
|
|
152
|
+
isRefetchError: false;
|
|
153
|
+
isFetchNextPageError: false;
|
|
154
|
+
isFetchPreviousPageError: false;
|
|
155
|
+
isSuccess: false;
|
|
156
|
+
isPlaceholderData: false;
|
|
157
|
+
status: "pending";
|
|
158
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
159
|
+
hasPreviousPage: boolean;
|
|
160
|
+
isFetchingPreviousPage: boolean;
|
|
161
|
+
dataUpdatedAt: number;
|
|
162
|
+
errorUpdatedAt: number;
|
|
163
|
+
failureCount: number;
|
|
164
|
+
failureReason: Error | null;
|
|
165
|
+
errorUpdateCount: number;
|
|
166
|
+
isFetched: boolean;
|
|
167
|
+
isFetchedAfterMount: boolean;
|
|
168
|
+
isFetching: boolean;
|
|
169
|
+
isInitialLoading: boolean;
|
|
170
|
+
isPaused: boolean;
|
|
171
|
+
isRefetching: boolean;
|
|
172
|
+
isStale: boolean;
|
|
173
|
+
isEnabled: boolean;
|
|
174
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
175
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
176
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>>;
|
|
177
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown> | undefined;
|
|
178
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
179
|
+
hasNextPage: boolean;
|
|
180
|
+
isFetchingNextPage: boolean;
|
|
181
|
+
isLoading: boolean;
|
|
182
|
+
dataFlatten: ISessionByStatus[];
|
|
183
|
+
} | {
|
|
184
|
+
isError: false;
|
|
185
|
+
error: null;
|
|
186
|
+
isPending: false;
|
|
187
|
+
isLoadingError: false;
|
|
188
|
+
isRefetchError: false;
|
|
189
|
+
isSuccess: true;
|
|
190
|
+
isPlaceholderData: true;
|
|
191
|
+
isFetchNextPageError: false;
|
|
192
|
+
isFetchPreviousPageError: false;
|
|
193
|
+
status: "success";
|
|
194
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
195
|
+
hasPreviousPage: boolean;
|
|
196
|
+
isFetchingPreviousPage: boolean;
|
|
197
|
+
dataUpdatedAt: number;
|
|
198
|
+
errorUpdatedAt: number;
|
|
199
|
+
failureCount: number;
|
|
200
|
+
failureReason: Error | null;
|
|
201
|
+
errorUpdateCount: number;
|
|
202
|
+
isFetched: boolean;
|
|
203
|
+
isFetchedAfterMount: boolean;
|
|
204
|
+
isFetching: boolean;
|
|
205
|
+
isInitialLoading: boolean;
|
|
206
|
+
isPaused: boolean;
|
|
207
|
+
isRefetching: boolean;
|
|
208
|
+
isStale: boolean;
|
|
209
|
+
isEnabled: boolean;
|
|
210
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
211
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
212
|
+
promise: Promise<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>>;
|
|
213
|
+
data: import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown> | undefined;
|
|
214
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ISessionByStatus[]>, unknown>, Error>>;
|
|
215
|
+
hasNextPage: boolean;
|
|
216
|
+
isFetchingNextPage: boolean;
|
|
217
|
+
isLoading: boolean;
|
|
218
|
+
dataFlatten: ISessionByStatus[];
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=useGetSessionByTagOrStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetSessionByTagOrStatus.d.ts","sourceRoot":"","sources":["../../../src/hooks/session/useGetSessionByTagOrStatus.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAA+B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKpE,eAAO,MAAM,0BAA0B,GAAI,QAAQ,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EhE,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
14
|
+
import { apiInstance } from "../../services/api";
|
|
15
|
+
import { ENDPOINTS } from "../../services/routes";
|
|
16
|
+
import { QUERY_KEYS } from "../../services/query";
|
|
17
|
+
import { useMemo } from "react";
|
|
18
|
+
import useConversationStore from "../../store/conversation";
|
|
19
|
+
import { DChatSDK } from "../../constants/sdk";
|
|
20
|
+
export const useGetSessionByTagOrStatus = (filter) => {
|
|
21
|
+
const _a = useInfiniteQuery({
|
|
22
|
+
initialPageParam: 1,
|
|
23
|
+
queryKey: [QUERY_KEYS.GET_SESSION_BY_TAG_OR_STATUS, filter],
|
|
24
|
+
queryFn: async ({ pageParam = 1 }) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
const params = {
|
|
27
|
+
applicationType: "OBEFE",
|
|
28
|
+
tag: filter.tag,
|
|
29
|
+
status: filter.status,
|
|
30
|
+
page: pageParam,
|
|
31
|
+
pageSize: 100,
|
|
32
|
+
};
|
|
33
|
+
const res = await apiInstance.post(ENDPOINTS.chatService.getSessionsByTagOrStatus, params);
|
|
34
|
+
//FIND NEW CONVERSATIONS
|
|
35
|
+
const conversationList = useConversationStore.getState().conversationList;
|
|
36
|
+
const newConversations = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.filter((session) => {
|
|
37
|
+
return !conversationList.some((conversation) => conversation.conversationID === session.conversationId);
|
|
38
|
+
});
|
|
39
|
+
if (newConversations === null || newConversations === void 0 ? void 0 : newConversations.length) {
|
|
40
|
+
DChatSDK.getMultipleConversation(newConversations.map((session) => session.conversationId)).then((res) => {
|
|
41
|
+
useConversationStore
|
|
42
|
+
.getState()
|
|
43
|
+
.updateConversationList(res.data, "filter");
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return res.data;
|
|
47
|
+
},
|
|
48
|
+
getNextPageParam: (lastPage) => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
const currentPage = ((_a = lastPage === null || lastPage === void 0 ? void 0 : lastPage.pageable) === null || _a === void 0 ? void 0 : _a.pageNumber) || 1;
|
|
51
|
+
const totalPages = ((_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage.pageable) === null || _b === void 0 ? void 0 : _b.totalPages) || 1;
|
|
52
|
+
return currentPage + 1 < totalPages ? currentPage + 1 : undefined;
|
|
53
|
+
},
|
|
54
|
+
enabled: !!filter.tag || !!filter.status,
|
|
55
|
+
}), { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = _a, rest = __rest(_a, ["data", "fetchNextPage", "hasNextPage", "isFetchingNextPage", "isLoading"]);
|
|
56
|
+
const { dataFlatten } = useMemo(() => {
|
|
57
|
+
if (!data)
|
|
58
|
+
return {
|
|
59
|
+
dataFlatten: [],
|
|
60
|
+
};
|
|
61
|
+
const allItems = data.pages.flatMap((page) => page.data);
|
|
62
|
+
return {
|
|
63
|
+
dataFlatten: allItems,
|
|
64
|
+
};
|
|
65
|
+
}, [data]);
|
|
66
|
+
return Object.assign({ data,
|
|
67
|
+
fetchNextPage,
|
|
68
|
+
hasNextPage,
|
|
69
|
+
isFetchingNextPage,
|
|
70
|
+
isLoading,
|
|
71
|
+
dataFlatten }, rest);
|
|
72
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateFcmToken.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useUpdateFcmToken.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"useUpdateFcmToken.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useUpdateFcmToken.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C,eAAO,MAAM,iBAAiB,oGAmB1B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ import { Platform, LogLevel, SessionType } from "@openim/wasm-client-sdk";
|
|
|
5
5
|
import { Icon } from "./components/icon";
|
|
6
6
|
import useUserStore from "./store/user";
|
|
7
7
|
import { DChatInitAndLoginConfig, DChatApplicationType } from "./types/chat";
|
|
8
|
+
import useAuthStore from "./store/auth";
|
|
8
9
|
export { ChatProvider, useChatContext } from "./context/ChatContext";
|
|
9
10
|
export { DChatDeskMessage, DChatBubble, Icon };
|
|
10
11
|
export { useDChatAuth } from "./hooks/user/useAuth";
|
|
11
12
|
export { useUpdateFcmToken } from "./hooks/user/useUpdateFcmToken";
|
|
12
|
-
export { useUserStore, DChatApplicationType };
|
|
13
|
+
export { useUserStore, DChatApplicationType, useAuthStore };
|
|
13
14
|
export { Platform as DChatPlatform, LogLevel as DChatLogLevel, SessionType as DChatSessionType, };
|
|
14
15
|
export type { DChatInitAndLoginConfig };
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,YAAY,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC;AAI5D,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,gBAAgB,GAChC,CAAC;AAEF,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Platform, LogLevel, SessionType } from "@openim/wasm-client-sdk";
|
|
|
5
5
|
import { Icon } from "./components/icon";
|
|
6
6
|
import useUserStore from "./store/user";
|
|
7
7
|
import { DChatApplicationType } from "./types/chat";
|
|
8
|
+
import useAuthStore from "./store/auth";
|
|
8
9
|
// Main exports for the SDK
|
|
9
10
|
export { ChatProvider, useChatContext } from "./context/ChatContext";
|
|
10
11
|
//Components
|
|
@@ -13,6 +14,6 @@ export { DChatDeskMessage, DChatBubble, Icon };
|
|
|
13
14
|
export { useDChatAuth } from "./hooks/user/useAuth";
|
|
14
15
|
export { useUpdateFcmToken } from "./hooks/user/useUpdateFcmToken";
|
|
15
16
|
//Store
|
|
16
|
-
export { useUserStore, DChatApplicationType };
|
|
17
|
+
export { useUserStore, DChatApplicationType, useAuthStore };
|
|
17
18
|
// export * from "./types/sdk";
|
|
18
19
|
export { Platform as DChatPlatform, LogLevel as DChatLogLevel, SessionType as DChatSessionType, };
|