@workhive/api 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +160 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +253 -12
- package/dist/context.d.ts +122 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +24 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +20 -1
- package/dist/hooks/use-billing-status.d.ts +7 -0
- package/dist/hooks/use-billing-status.d.ts.map +1 -0
- package/dist/hooks/use-billing-status.js +17 -0
- package/dist/hooks/use-card.d.ts +2 -0
- package/dist/hooks/use-card.d.ts.map +1 -0
- package/dist/hooks/use-card.js +12 -0
- package/dist/hooks/use-cards.d.ts +5 -0
- package/dist/hooks/use-cards.d.ts.map +1 -0
- package/dist/hooks/use-cards.js +12 -0
- package/dist/hooks/use-create-card.d.ts +10 -0
- package/dist/hooks/use-create-card.d.ts.map +1 -0
- package/dist/hooks/use-create-card.js +13 -0
- package/dist/hooks/use-delete-card.d.ts +15 -0
- package/dist/hooks/use-delete-card.d.ts.map +1 -0
- package/dist/hooks/use-delete-card.js +38 -0
- package/dist/hooks/use-email-drafts.d.ts +32 -0
- package/dist/hooks/use-email-drafts.d.ts.map +1 -0
- package/dist/hooks/use-email-drafts.js +98 -0
- package/dist/hooks/use-gmail-connection-members.d.ts +2 -0
- package/dist/hooks/use-gmail-connection-members.d.ts.map +1 -0
- package/dist/hooks/use-gmail-connection-members.js +13 -0
- package/dist/hooks/use-gmail-connections.d.ts +5 -0
- package/dist/hooks/use-gmail-connections.d.ts.map +1 -0
- package/dist/hooks/use-gmail-connections.js +21 -0
- package/dist/hooks/use-gmail-messages.d.ts +2 -0
- package/dist/hooks/use-gmail-messages.d.ts.map +1 -0
- package/dist/hooks/use-gmail-messages.js +13 -0
- package/dist/hooks/use-gmail-signature.d.ts +2 -0
- package/dist/hooks/use-gmail-signature.d.ts.map +1 -0
- package/dist/hooks/use-gmail-signature.js +12 -0
- package/dist/hooks/use-gmail-thread-search-infinite.d.ts +2 -0
- package/dist/hooks/use-gmail-thread-search-infinite.d.ts.map +1 -0
- package/dist/hooks/use-gmail-thread-search-infinite.js +21 -0
- package/dist/hooks/use-gmail-thread-search.d.ts +2 -0
- package/dist/hooks/use-gmail-thread-search.d.ts.map +1 -0
- package/dist/hooks/use-gmail-thread-search.js +12 -0
- package/dist/hooks/use-gmail-threads-infinite.d.ts +5 -0
- package/dist/hooks/use-gmail-threads-infinite.d.ts.map +1 -0
- package/dist/hooks/use-gmail-threads-infinite.js +24 -0
- package/dist/hooks/use-gmail-threads.d.ts +7 -0
- package/dist/hooks/use-gmail-threads.d.ts.map +1 -0
- package/dist/hooks/use-gmail-threads.js +23 -0
- package/dist/hooks/use-inbox-badge-count.d.ts +6 -0
- package/dist/hooks/use-inbox-badge-count.d.ts.map +1 -0
- package/dist/hooks/use-inbox-badge-count.js +17 -0
- package/dist/hooks/use-inbox-thread-search.d.ts +2 -0
- package/dist/hooks/use-inbox-thread-search.d.ts.map +1 -0
- package/dist/hooks/use-inbox-thread-search.js +12 -0
- package/dist/hooks/use-inbox-threads-infinite.d.ts.map +1 -1
- package/dist/hooks/use-inbox-threads-infinite.js +1 -0
- package/dist/hooks/use-link-gmail-thread-contact.d.ts +7 -0
- package/dist/hooks/use-link-gmail-thread-contact.d.ts.map +1 -0
- package/dist/hooks/use-link-gmail-thread-contact.js +15 -0
- package/dist/hooks/use-manage-gmail-connection-members.d.ts +13 -0
- package/dist/hooks/use-manage-gmail-connection-members.d.ts.map +1 -0
- package/dist/hooks/use-manage-gmail-connection-members.js +25 -0
- package/dist/hooks/use-mark-inbox-thread-read.d.ts +3 -1
- package/dist/hooks/use-mark-inbox-thread-read.d.ts.map +1 -1
- package/dist/hooks/use-mark-inbox-thread-read.js +36 -14
- package/dist/hooks/use-mark-inbox-thread-unread.d.ts +3 -1
- package/dist/hooks/use-mark-inbox-thread-unread.d.ts.map +1 -1
- package/dist/hooks/use-mark-inbox-thread-unread.js +37 -14
- package/dist/hooks/use-me.d.ts.map +1 -1
- package/dist/hooks/use-me.js +2 -1
- package/dist/hooks/use-message-snippets.d.ts +1 -1
- package/dist/hooks/use-message-snippets.d.ts.map +1 -1
- package/dist/hooks/use-message-snippets.js +4 -3
- package/dist/hooks/use-missed-unseen-count.d.ts +8 -0
- package/dist/hooks/use-missed-unseen-count.d.ts.map +1 -0
- package/dist/hooks/use-missed-unseen-count.js +19 -0
- package/dist/hooks/use-patch-card.d.ts +15 -0
- package/dist/hooks/use-patch-card.d.ts.map +1 -0
- package/dist/hooks/use-patch-card.js +48 -0
- package/dist/hooks/use-phone-number.d.ts.map +1 -1
- package/dist/hooks/use-phone-number.js +2 -1
- package/dist/hooks/use-phone-numbers.d.ts.map +1 -1
- package/dist/hooks/use-phone-numbers.js +2 -1
- package/dist/hooks/use-send-gmail-message.d.ts +6 -0
- package/dist/hooks/use-send-gmail-message.d.ts.map +1 -0
- package/dist/hooks/use-send-gmail-message.js +21 -0
- package/dist/hooks/use-send-inbox-message.d.ts.map +1 -1
- package/dist/hooks/use-send-inbox-message.js +16 -13
- package/dist/hooks/use-tasks.d.ts +4 -0
- package/dist/hooks/use-tasks.d.ts.map +1 -1
- package/dist/hooks/use-tasks.js +14 -2
- package/dist/hooks/use-update-inbox-thread-status.d.ts +3 -1
- package/dist/hooks/use-update-inbox-thread-status.d.ts.map +1 -1
- package/dist/hooks/use-update-inbox-thread-status.js +36 -14
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/query-keys.d.ts +58 -0
- package/dist/query-keys.d.ts.map +1 -1
- package/dist/query-keys.js +50 -0
- package/dist/types.d.ts +402 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/hooks/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { useLeads } from './use-leads';
|
|
|
2
2
|
export { useContactLeadSubmissions } from './use-contact-lead-submissions';
|
|
3
3
|
export { useContactMeetings } from './use-contact-meetings';
|
|
4
4
|
export { useContactCalls } from './use-contact-calls';
|
|
5
|
-
export { useTasks } from './use-tasks';
|
|
5
|
+
export { useTasks, useCreateTask } from './use-tasks';
|
|
6
6
|
export { useMeetings } from './use-meetings';
|
|
7
7
|
export { usePipelines } from './use-pipelines';
|
|
8
8
|
export { useStages } from './use-stages';
|
|
@@ -20,4 +20,23 @@ export { useMarkInboxThreadRead } from './use-mark-inbox-thread-read';
|
|
|
20
20
|
export { useMarkInboxThreadUnread } from './use-mark-inbox-thread-unread';
|
|
21
21
|
export { useUpdateInboxThreadStatus } from './use-update-inbox-thread-status';
|
|
22
22
|
export { useDeleteInboxThread } from './use-delete-inbox-thread';
|
|
23
|
+
export { useInboxBadgeCount } from './use-inbox-badge-count';
|
|
24
|
+
export { useMissedUnseenCount } from './use-missed-unseen-count';
|
|
23
25
|
export { useMessageSnippets } from './use-message-snippets';
|
|
26
|
+
export { useCard } from './use-card';
|
|
27
|
+
export { useCards } from './use-cards';
|
|
28
|
+
export { usePatchCard } from './use-patch-card';
|
|
29
|
+
export { useCreateCard } from './use-create-card';
|
|
30
|
+
export { useDeleteCard } from './use-delete-card';
|
|
31
|
+
export { useBillingStatus } from './use-billing-status';
|
|
32
|
+
export { useGmailConnections, useTriggerGmailSync } from './use-gmail-connections';
|
|
33
|
+
export { useGmailThreads } from './use-gmail-threads';
|
|
34
|
+
export { useGmailMessages } from './use-gmail-messages';
|
|
35
|
+
export { useSendGmailMessage } from './use-send-gmail-message';
|
|
36
|
+
export { useLinkGmailThreadContact } from './use-link-gmail-thread-contact';
|
|
37
|
+
export { useGmailThreadSearchInfinite } from './use-gmail-thread-search-infinite';
|
|
38
|
+
export { useInboxThreadSearch } from './use-inbox-thread-search';
|
|
39
|
+
export { useGmailConnectionMembers } from './use-gmail-connection-members';
|
|
40
|
+
export { useGmailSignature } from './use-gmail-signature';
|
|
41
|
+
export { useAddGmailConnectionMember, useRemoveGmailConnectionMember } from './use-manage-gmail-connection-members';
|
|
42
|
+
export { useEmailDrafts, useCreateEmailDraft, useUpdateEmailDraft, useDeleteEmailDraft } from './use-email-drafts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MeOrganizationBilling } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Billing status derived from the /api/me response.
|
|
4
|
+
* Avoids an extra network request by extracting billing from the existing `useMe` query.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useBillingStatus(): import("@tanstack/react-query").DefinedUseQueryResult<MeOrganizationBilling | null, Error>;
|
|
7
|
+
//# sourceMappingURL=use-billing-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-billing-status.d.ts","sourceRoot":"","sources":["../../src/hooks/use-billing-status.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAErD;;;GAGG;AACH,wBAAgB,gBAAgB,+FAY/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useMe } from './use-me';
|
|
3
|
+
/**
|
|
4
|
+
* Billing status derived from the /api/me response.
|
|
5
|
+
* Avoids an extra network request by extracting billing from the existing `useMe` query.
|
|
6
|
+
*/
|
|
7
|
+
export function useBillingStatus() {
|
|
8
|
+
const { data: meData, isLoading: meLoading, error: meError } = useMe();
|
|
9
|
+
const billing = meData?.organization?.billing ?? null;
|
|
10
|
+
return useQuery({
|
|
11
|
+
queryKey: ['billing-status'],
|
|
12
|
+
queryFn: () => billing,
|
|
13
|
+
enabled: !meLoading && !meError,
|
|
14
|
+
initialData: billing,
|
|
15
|
+
staleTime: 30000,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-card.d.ts","sourceRoot":"","sources":["../../src/hooks/use-card.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,oFASvE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { cardKeys } from '../query-keys';
|
|
4
|
+
export function useCard(cardId, pipelineId) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: cardKeys.detail(cardId),
|
|
8
|
+
queryFn: ({ signal }) => client.getCard(pipelineId, cardId, { signal }).then((r) => r.card),
|
|
9
|
+
enabled: !!cardId && !!pipelineId,
|
|
10
|
+
staleTime: 30000,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface UseCardsParams {
|
|
2
|
+
showArchivedOnly?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useCards(pipelineId: string | null, params?: UseCardsParams): import("@tanstack/react-query").UseQueryResult<import("..").PipelineCardsResponse, Error>;
|
|
5
|
+
//# sourceMappingURL=use-cards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-cards.d.ts","sourceRoot":"","sources":["../../src/hooks/use-cards.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,cAAc,6FAQ1E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { cardKeys } from '../query-keys';
|
|
4
|
+
export function useCards(pipelineId, params) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: cardKeys.list(pipelineId, params),
|
|
8
|
+
queryFn: ({ signal }) => client.getPipelineCards(pipelineId, params, { signal }),
|
|
9
|
+
enabled: !!pipelineId,
|
|
10
|
+
staleTime: 30000,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CreateCardPayload } from '../types';
|
|
2
|
+
export interface CreateCardVariables {
|
|
3
|
+
pipelineId: string;
|
|
4
|
+
body: CreateCardPayload;
|
|
5
|
+
}
|
|
6
|
+
export declare function useCreateCard(): import("@tanstack/react-query").UseMutationResult<{
|
|
7
|
+
card: import("..").PipelineCard;
|
|
8
|
+
message: string;
|
|
9
|
+
}, Error, CreateCardVariables, unknown>;
|
|
10
|
+
//# sourceMappingURL=use-create-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-create-card.d.ts","sourceRoot":"","sources":["../../src/hooks/use-create-card.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,iBAAiB,CAAA;CACxB;AAED,wBAAgB,aAAa;;;wCAY5B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { cardKeys } from '../query-keys';
|
|
4
|
+
export function useCreateCard() {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation({
|
|
8
|
+
mutationFn: ({ pipelineId, body }) => client.createCard(pipelineId, body),
|
|
9
|
+
onSuccess: (_data, { pipelineId }) => {
|
|
10
|
+
queryClient.invalidateQueries({ queryKey: cardKeys.list(pipelineId) });
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PipelineCard, PipelineCardsResponse } from '../types';
|
|
2
|
+
export interface DeleteCardVariables {
|
|
3
|
+
pipelineId: string;
|
|
4
|
+
cardId: string;
|
|
5
|
+
action?: 'archive' | 'delete';
|
|
6
|
+
}
|
|
7
|
+
export declare function useDeleteCard(): import("@tanstack/react-query").UseMutationResult<{
|
|
8
|
+
success: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
card?: PipelineCard;
|
|
11
|
+
}, Error, DeleteCardVariables, {
|
|
12
|
+
previousCard: PipelineCard | undefined;
|
|
13
|
+
previousLists: [readonly unknown[], PipelineCardsResponse | undefined][];
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=use-delete-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-delete-card.d.ts","sourceRoot":"","sources":["../../src/hooks/use-delete-card.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEnE,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;CAC9B;AAED,wBAAgB,aAAa;;;;;;;GA+C5B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { cardKeys } from '../query-keys';
|
|
4
|
+
export function useDeleteCard() {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
return useMutation({
|
|
8
|
+
mutationFn: ({ pipelineId, cardId, action = 'archive' }) => client.deleteCard(pipelineId, cardId, action),
|
|
9
|
+
onMutate: async ({ cardId }) => {
|
|
10
|
+
await queryClient.cancelQueries({ queryKey: cardKeys.detail(cardId) });
|
|
11
|
+
await queryClient.cancelQueries({ queryKey: cardKeys.lists() });
|
|
12
|
+
const previousCard = queryClient.getQueryData(cardKeys.detail(cardId));
|
|
13
|
+
const previousLists = queryClient.getQueriesData({
|
|
14
|
+
queryKey: cardKeys.lists(),
|
|
15
|
+
});
|
|
16
|
+
queryClient.removeQueries({ queryKey: cardKeys.detail(cardId) });
|
|
17
|
+
queryClient.setQueriesData({ queryKey: cardKeys.lists() }, (old) => {
|
|
18
|
+
if (!old?.cards)
|
|
19
|
+
return old;
|
|
20
|
+
return { ...old, cards: old.cards.filter((card) => card.id !== cardId) };
|
|
21
|
+
});
|
|
22
|
+
return { previousCard, previousLists };
|
|
23
|
+
},
|
|
24
|
+
onError: (_err, { cardId }, context) => {
|
|
25
|
+
if (context?.previousCard) {
|
|
26
|
+
queryClient.setQueryData(cardKeys.detail(cardId), context.previousCard);
|
|
27
|
+
}
|
|
28
|
+
if (context?.previousLists) {
|
|
29
|
+
context.previousLists.forEach(([queryKey, data]) => {
|
|
30
|
+
queryClient.setQueryData(queryKey, data);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
onSuccess: (_data, { pipelineId }) => {
|
|
35
|
+
queryClient.invalidateQueries({ queryKey: cardKeys.list(pipelineId) });
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { CreateEmailDraftPayload, UpdateEmailDraftPayload, EmailDraft } from '../types';
|
|
2
|
+
/** Fetch all standalone drafts for a Gmail connection. */
|
|
3
|
+
export declare function useEmailDrafts(connectionId: string | undefined): import("@tanstack/react-query").UseQueryResult<import("..").EmailDraftsListResponse, Error>;
|
|
4
|
+
/** Create a standalone email draft. */
|
|
5
|
+
export declare function useCreateEmailDraft(): import("@tanstack/react-query").UseMutationResult<import("..").CreateEmailDraftResponse, Error, {
|
|
6
|
+
connectionId: string;
|
|
7
|
+
payload: CreateEmailDraftPayload;
|
|
8
|
+
}, unknown>;
|
|
9
|
+
/** Update a standalone email draft (optimistic). */
|
|
10
|
+
export declare function useUpdateEmailDraft(): import("@tanstack/react-query").UseMutationResult<{
|
|
11
|
+
ok: true;
|
|
12
|
+
}, Error, {
|
|
13
|
+
connectionId: string;
|
|
14
|
+
draftId: string;
|
|
15
|
+
payload: UpdateEmailDraftPayload;
|
|
16
|
+
}, {
|
|
17
|
+
previous: {
|
|
18
|
+
drafts: EmailDraft[];
|
|
19
|
+
} | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
/** Delete a standalone email draft (optimistic removal). */
|
|
22
|
+
export declare function useDeleteEmailDraft(): import("@tanstack/react-query").UseMutationResult<{
|
|
23
|
+
ok: true;
|
|
24
|
+
}, Error, {
|
|
25
|
+
connectionId: string;
|
|
26
|
+
draftId: string;
|
|
27
|
+
}, {
|
|
28
|
+
previous: {
|
|
29
|
+
drafts: EmailDraft[];
|
|
30
|
+
} | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=use-email-drafts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-email-drafts.d.ts","sourceRoot":"","sources":["../../src/hooks/use-email-drafts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,UAAU,EACX,MAAM,UAAU,CAAA;AAEjB,0DAA0D;AAC1D,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,+FAS9D;AAED,uCAAuC;AACvC,wBAAgB,mBAAmB;kBASf,MAAM;aACX,uBAAuB;YAQrC;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB;;;kBAUf,MAAM;aACX,MAAM;aACN,uBAAuB;;;gBAKoB,UAAU,EAAE;;GAmCrE;AAED,4DAA4D;AAC5D,wBAAgB,mBAAmB;;;kBASf,MAAM;aACX,MAAM;;;gBAKqC,UAAU,EAAE;;GAuBrE"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
/** Fetch all standalone drafts for a Gmail connection. */
|
|
5
|
+
export function useEmailDrafts(connectionId) {
|
|
6
|
+
const client = useApiClient();
|
|
7
|
+
return useQuery({
|
|
8
|
+
queryKey: gmailKeys.drafts(connectionId ?? ''),
|
|
9
|
+
queryFn: () => client.getEmailDrafts(connectionId),
|
|
10
|
+
enabled: Boolean(connectionId),
|
|
11
|
+
staleTime: 30000,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/** Create a standalone email draft. */
|
|
15
|
+
export function useCreateEmailDraft() {
|
|
16
|
+
const client = useApiClient();
|
|
17
|
+
const queryClient = useQueryClient();
|
|
18
|
+
return useMutation({
|
|
19
|
+
mutationFn: ({ connectionId, payload, }) => client.createEmailDraft(connectionId, payload),
|
|
20
|
+
onSuccess: (_data, variables) => {
|
|
21
|
+
queryClient.invalidateQueries({
|
|
22
|
+
queryKey: gmailKeys.drafts(variables.connectionId),
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Update a standalone email draft (optimistic). */
|
|
28
|
+
export function useUpdateEmailDraft() {
|
|
29
|
+
const client = useApiClient();
|
|
30
|
+
const queryClient = useQueryClient();
|
|
31
|
+
return useMutation({
|
|
32
|
+
mutationFn: ({ connectionId, draftId, payload, }) => client.updateEmailDraft(connectionId, draftId, payload),
|
|
33
|
+
onMutate: async (variables) => {
|
|
34
|
+
const key = gmailKeys.drafts(variables.connectionId);
|
|
35
|
+
await queryClient.cancelQueries({ queryKey: key });
|
|
36
|
+
const previous = queryClient.getQueryData(key);
|
|
37
|
+
queryClient.setQueryData(key, (old) => {
|
|
38
|
+
if (!old)
|
|
39
|
+
return old;
|
|
40
|
+
return {
|
|
41
|
+
drafts: old.drafts.map((d) => d.id === variables.draftId
|
|
42
|
+
? {
|
|
43
|
+
...d,
|
|
44
|
+
...(variables.payload.to !== undefined && { to_addresses: variables.payload.to }),
|
|
45
|
+
...(variables.payload.cc !== undefined && { cc_addresses: variables.payload.cc }),
|
|
46
|
+
...(variables.payload.bcc !== undefined && { bcc_addresses: variables.payload.bcc }),
|
|
47
|
+
...(variables.payload.subject !== undefined && { subject: variables.payload.subject }),
|
|
48
|
+
...(variables.payload.html_body !== undefined && { html_body: variables.payload.html_body }),
|
|
49
|
+
updated_at: new Date().toISOString(),
|
|
50
|
+
}
|
|
51
|
+
: d),
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
return { previous };
|
|
55
|
+
},
|
|
56
|
+
onError: (_err, variables, context) => {
|
|
57
|
+
if (context?.previous) {
|
|
58
|
+
queryClient.setQueryData(gmailKeys.drafts(variables.connectionId), context.previous);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
onSettled: (_data, _error, variables) => {
|
|
62
|
+
queryClient.invalidateQueries({
|
|
63
|
+
queryKey: gmailKeys.drafts(variables.connectionId),
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Delete a standalone email draft (optimistic removal). */
|
|
69
|
+
export function useDeleteEmailDraft() {
|
|
70
|
+
const client = useApiClient();
|
|
71
|
+
const queryClient = useQueryClient();
|
|
72
|
+
return useMutation({
|
|
73
|
+
mutationFn: ({ connectionId, draftId, }) => client.deleteEmailDraft(connectionId, draftId),
|
|
74
|
+
onMutate: async (variables) => {
|
|
75
|
+
const key = gmailKeys.drafts(variables.connectionId);
|
|
76
|
+
await queryClient.cancelQueries({ queryKey: key });
|
|
77
|
+
const previous = queryClient.getQueryData(key);
|
|
78
|
+
queryClient.setQueryData(key, (old) => {
|
|
79
|
+
if (!old)
|
|
80
|
+
return old;
|
|
81
|
+
return {
|
|
82
|
+
drafts: old.drafts.filter((d) => d.id !== variables.draftId),
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
return { previous };
|
|
86
|
+
},
|
|
87
|
+
onError: (_err, variables, context) => {
|
|
88
|
+
if (context?.previous) {
|
|
89
|
+
queryClient.setQueryData(gmailKeys.drafts(variables.connectionId), context.previous);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
onSettled: (_data, _error, variables) => {
|
|
93
|
+
queryClient.invalidateQueries({
|
|
94
|
+
queryKey: gmailKeys.drafts(variables.connectionId),
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-connection-members.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-connection-members.ts"],"names":[],"mappings":"AAIA,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,+FAUpE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
export function useGmailConnectionMembers(connectionId) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: gmailKeys.members(connectionId ?? ''),
|
|
8
|
+
queryFn: () => client.getGmailConnectionMembers(connectionId),
|
|
9
|
+
enabled: !!connectionId,
|
|
10
|
+
staleTime: 5 * 60 * 1000,
|
|
11
|
+
select: (data) => data.members,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useGmailConnections(): import("@tanstack/react-query").UseQueryResult<import("..").GmailConnectionsResponse, Error>;
|
|
2
|
+
export declare function useTriggerGmailSync(): import("@tanstack/react-query").UseMutationResult<{
|
|
3
|
+
ok: boolean;
|
|
4
|
+
}, Error, string, unknown>;
|
|
5
|
+
//# sourceMappingURL=use-gmail-connections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-connections.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-connections.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,iGAOlC;AAED,wBAAgB,mBAAmB;;2BAUlC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
export function useGmailConnections() {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: gmailKeys.connections(),
|
|
8
|
+
queryFn: () => client.getGmailConnections(),
|
|
9
|
+
staleTime: 30000,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function useTriggerGmailSync() {
|
|
13
|
+
const client = useApiClient();
|
|
14
|
+
const queryClient = useQueryClient();
|
|
15
|
+
return useMutation({
|
|
16
|
+
mutationFn: (connectionId) => client.triggerGmailSync(connectionId),
|
|
17
|
+
onSuccess: () => {
|
|
18
|
+
queryClient.invalidateQueries({ queryKey: gmailKeys.connections() });
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-messages.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-messages.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,6FAU7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
export function useGmailMessages(connectionId, threadId) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: gmailKeys.messages(threadId ?? ''),
|
|
8
|
+
queryFn: () => client.getGmailThreadMessages(connectionId, threadId),
|
|
9
|
+
enabled: Boolean(connectionId) && Boolean(threadId),
|
|
10
|
+
staleTime: 30000,
|
|
11
|
+
refetchOnWindowFocus: true,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-signature.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-signature.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,8FAQjE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
export function useGmailSignature(connectionId) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: gmailKeys.signature(connectionId),
|
|
8
|
+
queryFn: () => client.getGmailSignature(connectionId),
|
|
9
|
+
enabled: !!connectionId,
|
|
10
|
+
staleTime: 5 * 60000,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function useGmailThreadSearchInfinite(connectionId: string | undefined, query: string): import("@tanstack/react-query").UseInfiniteQueryResult<import("@tanstack/query-core").InfiniteData<import("..").GmailThreadSearchResponse, unknown>, Error>;
|
|
2
|
+
//# sourceMappingURL=use-gmail-thread-search-infinite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-thread-search-infinite.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-thread-search-infinite.ts"],"names":[],"mappings":"AAMA,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,KAAK,EAAE,MAAM,+JAoBd"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
const SEARCH_PAGE_SIZE = 20;
|
|
5
|
+
export function useGmailThreadSearchInfinite(connectionId, query) {
|
|
6
|
+
const client = useApiClient();
|
|
7
|
+
return useInfiniteQuery({
|
|
8
|
+
queryKey: gmailKeys.searchInfinite(connectionId ?? '', query),
|
|
9
|
+
queryFn: ({ pageParam }) => client.searchGmailThreads(connectionId, {
|
|
10
|
+
q: query,
|
|
11
|
+
limit: SEARCH_PAGE_SIZE,
|
|
12
|
+
cursor: pageParam ?? undefined,
|
|
13
|
+
}),
|
|
14
|
+
getNextPageParam: (lastPage) => lastPage.has_more && lastPage.next_cursor
|
|
15
|
+
? lastPage.next_cursor
|
|
16
|
+
: undefined,
|
|
17
|
+
initialPageParam: null,
|
|
18
|
+
enabled: Boolean(connectionId) && query.length >= 2,
|
|
19
|
+
staleTime: 30000,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-thread-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-thread-search.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,KAAK,EAAE,MAAM,iGASd"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
export function useGmailThreadSearch(connectionId, query) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: gmailKeys.threadSearch(connectionId ?? '', query),
|
|
8
|
+
queryFn: () => client.searchGmailThreads(connectionId, { q: query }),
|
|
9
|
+
enabled: Boolean(connectionId) && query.length >= 2,
|
|
10
|
+
staleTime: 30000,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useGmailThreadsInfinite(connectionId: string | undefined, params?: {
|
|
2
|
+
status?: 'active' | 'archived';
|
|
3
|
+
unreadOnly?: boolean;
|
|
4
|
+
}): import("@tanstack/react-query").UseInfiniteQueryResult<import("@tanstack/query-core").InfiniteData<import("..").InboxThreadsResponse, unknown>, Error>;
|
|
5
|
+
//# sourceMappingURL=use-gmail-threads-infinite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-threads-infinite.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-threads-infinite.ts"],"names":[],"mappings":"AAMA,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,0JAsBlE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useInfiniteQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
const PAGE_SIZE = 30;
|
|
5
|
+
export function useGmailThreadsInfinite(connectionId, params) {
|
|
6
|
+
const client = useApiClient();
|
|
7
|
+
const status = params?.status;
|
|
8
|
+
const unreadOnly = params?.unreadOnly === true;
|
|
9
|
+
return useInfiniteQuery({
|
|
10
|
+
queryKey: gmailKeys.threadsInfinite(connectionId ?? '', { status, unreadOnly }),
|
|
11
|
+
queryFn: ({ pageParam }) => client.getGmailThreads(connectionId, {
|
|
12
|
+
status,
|
|
13
|
+
limit: PAGE_SIZE,
|
|
14
|
+
cursor: pageParam ?? undefined,
|
|
15
|
+
unread_only: unreadOnly || undefined,
|
|
16
|
+
}),
|
|
17
|
+
getNextPageParam: (lastPage) => lastPage.has_more && lastPage.next_cursor
|
|
18
|
+
? lastPage.next_cursor
|
|
19
|
+
: undefined,
|
|
20
|
+
initialPageParam: null,
|
|
21
|
+
enabled: Boolean(connectionId),
|
|
22
|
+
staleTime: 60000,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function useGmailThreads(connectionId: string | undefined, params?: {
|
|
2
|
+
status?: 'active' | 'archived';
|
|
3
|
+
unreadOnly?: boolean;
|
|
4
|
+
page?: number;
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
}): import("@tanstack/react-query").UseQueryResult<import("..").GmailThreadsPageResponse, Error>;
|
|
7
|
+
//# sourceMappingURL=use-gmail-threads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gmail-threads.d.ts","sourceRoot":"","sources":["../../src/hooks/use-gmail-threads.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,gGAqBpG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useQuery, keepPreviousData } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { gmailKeys } from '../query-keys';
|
|
4
|
+
const DEFAULT_PAGE_SIZE = 50;
|
|
5
|
+
export function useGmailThreads(connectionId, params) {
|
|
6
|
+
const client = useApiClient();
|
|
7
|
+
const status = params?.status;
|
|
8
|
+
const unreadOnly = params?.unreadOnly === true;
|
|
9
|
+
const page = params?.page ?? 1;
|
|
10
|
+
const pageSize = params?.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
11
|
+
return useQuery({
|
|
12
|
+
queryKey: gmailKeys.threads(connectionId ?? '', { status, unreadOnly, page }),
|
|
13
|
+
queryFn: () => client.getGmailThreads(connectionId, {
|
|
14
|
+
status,
|
|
15
|
+
page,
|
|
16
|
+
page_size: pageSize,
|
|
17
|
+
unread_only: unreadOnly || undefined,
|
|
18
|
+
}),
|
|
19
|
+
enabled: Boolean(connectionId),
|
|
20
|
+
staleTime: 30000,
|
|
21
|
+
placeholderData: keepPreviousData,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregate badge count across all assigned phone numbers.
|
|
3
|
+
* Polls every 60s so the sidebar stays reasonably fresh.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useInboxBadgeCount(): import("@tanstack/react-query").UseQueryResult<import("..").InboxBadgeCountResponse, Error>;
|
|
6
|
+
//# sourceMappingURL=use-inbox-badge-count.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-inbox-badge-count.d.ts","sourceRoot":"","sources":["../../src/hooks/use-inbox-badge-count.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,kBAAkB,gGAQjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { inboxKeys } from '../query-keys';
|
|
4
|
+
const BADGE_REFETCH_MS = 60000;
|
|
5
|
+
/**
|
|
6
|
+
* Aggregate badge count across all assigned phone numbers.
|
|
7
|
+
* Polls every 60s so the sidebar stays reasonably fresh.
|
|
8
|
+
*/
|
|
9
|
+
export function useInboxBadgeCount() {
|
|
10
|
+
const client = useApiClient();
|
|
11
|
+
return useQuery({
|
|
12
|
+
queryKey: inboxKeys.badgeCount(),
|
|
13
|
+
queryFn: () => client.getInboxBadgeCount(),
|
|
14
|
+
refetchInterval: BADGE_REFETCH_MS,
|
|
15
|
+
staleTime: BADGE_REFETCH_MS / 2,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-inbox-thread-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-inbox-thread-search.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,iGASd"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useApiClient } from '../context';
|
|
3
|
+
import { inboxKeys } from '../query-keys';
|
|
4
|
+
export function useInboxThreadSearch(phoneNumberId, query) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
return useQuery({
|
|
7
|
+
queryKey: inboxKeys.threadSearch(phoneNumberId ?? '', query),
|
|
8
|
+
queryFn: () => client.searchInboxThreads(phoneNumberId, { q: query }),
|
|
9
|
+
enabled: Boolean(phoneNumberId) && query.length >= 2,
|
|
10
|
+
staleTime: 30000,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-inbox-threads-infinite.d.ts","sourceRoot":"","sources":["../../src/hooks/use-inbox-threads-infinite.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC9B,4FAA4F;IAC5F,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,MAAM,CAAC,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"use-inbox-threads-infinite.d.ts","sourceRoot":"","sources":["../../src/hooks/use-inbox-threads-infinite.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAC9B,4FAA4F;IAC5F,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,MAAM,CAAC,EAAE,6BAA6B,0JAmBvC"}
|
|
@@ -12,6 +12,7 @@ export function useInboxThreadsInfinite(phoneNumberId, params) {
|
|
|
12
12
|
status: params?.status,
|
|
13
13
|
limit: PAGE_SIZE,
|
|
14
14
|
cursor: pageParam ?? undefined,
|
|
15
|
+
unread_only: unreadOnly || undefined,
|
|
15
16
|
}),
|
|
16
17
|
getNextPageParam: (lastPage) => lastPage.has_more && lastPage.next_cursor ? lastPage.next_cursor : undefined,
|
|
17
18
|
initialPageParam: null,
|