@planningcenter/chat-react-native 3.1.0-rc.13 → 3.1.0-rc.15
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/build/components/conversation/attachments/attachment_card.d.ts +9 -0
- package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -0
- package/build/components/conversation/attachments/attachment_card.js +35 -0
- package/build/components/conversation/attachments/attachment_card.js.map +1 -0
- package/build/components/conversation/attachments/audio_attachment.d.ts +6 -0
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/audio_attachment.js +84 -0
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -0
- package/build/components/conversation/attachments/constants.d.ts +3 -0
- package/build/components/conversation/attachments/constants.d.ts.map +1 -0
- package/build/components/conversation/attachments/constants.js +4 -0
- package/build/components/conversation/attachments/constants.js.map +1 -0
- package/build/components/conversation/attachments/download_attachment_button.d.ts +9 -0
- package/build/components/conversation/attachments/download_attachment_button.d.ts.map +1 -0
- package/build/components/conversation/attachments/download_attachment_button.js +29 -0
- package/build/components/conversation/attachments/download_attachment_button.js.map +1 -0
- package/build/components/conversation/attachments/expanded_link.d.ts +5 -0
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -0
- package/build/components/conversation/attachments/expanded_link.js +44 -0
- package/build/components/conversation/attachments/expanded_link.js.map +1 -0
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +7 -0
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/generic_file_attachment.js +63 -0
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -0
- package/build/components/conversation/attachments/giphy_attachment.d.ts +6 -0
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/giphy_attachment.js +42 -0
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -0
- package/build/components/conversation/attachments/image_attachment.d.ts +5 -0
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/image_attachment.js +24 -0
- package/build/components/conversation/attachments/image_attachment.js.map +1 -0
- package/build/components/conversation/attachments/video_attachment.d.ts +6 -0
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/video_attachment.js +64 -0
- package/build/components/conversation/attachments/video_attachment.js.map +1 -0
- package/build/components/conversation/message.d.ts +1 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +13 -7
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +6 -0
- package/build/components/conversation/message_attachments.d.ts.map +1 -0
- package/build/components/conversation/message_attachments.js +52 -0
- package/build/components/conversation/message_attachments.js.map +1 -0
- package/build/components/conversation/message_markdown.d.ts +7 -0
- package/build/components/conversation/message_markdown.d.ts.map +1 -0
- package/build/components/conversation/message_markdown.js +38 -0
- package/build/components/conversation/message_markdown.js.map +1 -0
- package/build/components/conversations/conversation_preview.d.ts +9 -0
- package/build/components/conversations/conversation_preview.d.ts.map +1 -0
- package/build/components/conversations/conversation_preview.js +58 -0
- package/build/components/conversations/conversation_preview.js.map +1 -0
- package/build/components/conversations/conversations.d.ts +8 -0
- package/build/components/conversations/conversations.d.ts.map +1 -0
- package/build/components/conversations/conversations.js +40 -0
- package/build/components/conversations/conversations.js.map +1 -0
- package/build/components/conversations/unread_count_badge.d.ts +5 -0
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -0
- package/build/components/conversations/unread_count_badge.js +33 -0
- package/build/components/conversations/unread_count_badge.js.map +1 -0
- package/build/components/display/badge.d.ts +9 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +22 -10
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/button.d.ts +1 -1
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.js +2 -2
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +10 -8
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/text.js +2 -8
- package/build/components/display/text.js.map +1 -1
- package/build/components/index.d.ts +1 -1
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/page/error_boundary.d.ts +1 -1
- package/build/hooks/use_api.d.ts +6 -4
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -2
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts +1 -2
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_conversation.js +1 -1
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +1 -1
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations.d.ts +2 -3
- package/build/hooks/use_conversations.d.ts.map +1 -1
- package/build/hooks/use_conversations.js +3 -29
- package/build/hooks/use_conversations.js.map +1 -1
- package/build/hooks/use_groups.d.ts +214 -0
- package/build/hooks/use_groups.d.ts.map +1 -0
- package/build/hooks/use_groups.js +22 -0
- package/build/hooks/use_groups.js.map +1 -0
- package/build/hooks/use_groups_groups.d.ts +208 -0
- package/build/hooks/use_groups_groups.d.ts.map +1 -0
- package/build/hooks/use_groups_groups.js +18 -0
- package/build/hooks/use_groups_groups.js.map +1 -0
- package/build/hooks/use_services_team.d.ts +4 -0
- package/build/hooks/use_services_team.d.ts.map +1 -0
- package/build/hooks/use_services_team.js +22 -0
- package/build/hooks/use_services_team.js.map +1 -0
- package/build/hooks/use_suspense_api.d.ts +2 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +2 -1
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/hooks/use_teams.d.ts +208 -0
- package/build/hooks/use_teams.d.ts.map +1 -0
- package/build/hooks/use_teams.js +22 -0
- package/build/hooks/use_teams.js.map +1 -0
- package/build/navigation/index.d.ts +11 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +5 -0
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +86 -62
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +13 -0
- package/build/screens/conversation_filters_screen.d.ts.map +1 -0
- package/build/screens/conversation_filters_screen.js +346 -0
- package/build/screens/conversation_filters_screen.js.map +1 -0
- package/build/screens/conversation_screen.js +2 -1
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversations_screen.d.ts +4 -2
- package/build/screens/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations_screen.js +139 -11
- package/build/screens/conversations_screen.js.map +1 -1
- package/build/screens/create/conversation_select_recipients_screen.d.ts.map +1 -1
- package/build/screens/create/conversation_select_recipients_screen.js +3 -11
- package/build/screens/create/conversation_select_recipients_screen.js.map +1 -1
- package/build/types/resources/group_resource.d.ts +4 -2
- package/build/types/resources/group_resource.d.ts.map +1 -1
- package/build/types/resources/group_resource.js.map +1 -1
- package/build/types/resources/index.d.ts +1 -0
- package/build/types/resources/index.d.ts.map +1 -1
- package/build/types/resources/index.js +1 -0
- package/build/types/resources/index.js.map +1 -1
- package/build/types/resources/services/index.d.ts +2 -0
- package/build/types/resources/services/index.d.ts.map +1 -0
- package/build/types/resources/services/index.js +2 -0
- package/build/types/resources/services/index.js.map +1 -0
- package/build/types/resources/services/team_resource.d.ts +48 -0
- package/build/types/resources/services/team_resource.d.ts.map +1 -0
- package/build/types/resources/services/team_resource.js +7 -0
- package/build/types/resources/services/team_resource.js.map +1 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/native_adapters/audio.d.ts +13 -0
- package/build/utils/native_adapters/audio.d.ts.map +1 -0
- package/build/utils/native_adapters/audio.js +7 -0
- package/build/utils/native_adapters/audio.js.map +1 -0
- package/build/utils/native_adapters/configuration.d.ts +7 -1
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +17 -1
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/native_adapters/index.d.ts +2 -0
- package/build/utils/native_adapters/index.d.ts.map +1 -1
- package/build/utils/native_adapters/index.js +2 -0
- package/build/utils/native_adapters/index.js.map +1 -1
- package/build/utils/native_adapters/video.d.ts +25 -0
- package/build/utils/native_adapters/video.d.ts.map +1 -0
- package/build/utils/native_adapters/video.js +7 -0
- package/build/utils/native_adapters/video.js.map +1 -0
- package/build/utils/parse_simple_markdown.d.ts +7 -0
- package/build/utils/parse_simple_markdown.d.ts.map +1 -0
- package/build/utils/parse_simple_markdown.js +32 -0
- package/build/utils/parse_simple_markdown.js.map +1 -0
- package/build/utils/pluralize.d.ts +2 -0
- package/build/utils/pluralize.d.ts.map +1 -0
- package/build/utils/pluralize.js +10 -0
- package/build/utils/pluralize.js.map +1 -0
- package/build/utils/request/conversation.d.ts +10 -0
- package/build/utils/request/conversation.d.ts.map +1 -0
- package/build/utils/request/conversation.js +32 -0
- package/build/utils/request/conversation.js.map +1 -0
- package/build/utils/request/messages.d.ts +15 -0
- package/build/utils/request/messages.d.ts.map +1 -0
- package/build/utils/request/messages.js +22 -0
- package/build/utils/request/messages.js.map +1 -0
- package/build/utils/theme.d.ts +1 -1
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +1 -1
- package/build/utils/theme.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/utils/parse_simple_markdown.ts +93 -0
- package/src/__tests__/utils/pluralize.tsx +17 -0
- package/src/components/conversation/attachments/attachment_card.tsx +46 -0
- package/src/components/conversation/attachments/audio_attachment.tsx +102 -0
- package/src/components/conversation/attachments/constants.ts +5 -0
- package/src/components/conversation/attachments/download_attachment_button.tsx +46 -0
- package/src/components/conversation/attachments/expanded_link.tsx +54 -0
- package/src/components/conversation/attachments/generic_file_attachment.tsx +75 -0
- package/src/components/conversation/attachments/giphy_attachment.tsx +56 -0
- package/src/components/conversation/attachments/image_attachment.tsx +31 -0
- package/src/components/conversation/attachments/video_attachment.tsx +92 -0
- package/src/components/conversation/message.tsx +15 -6
- package/src/components/conversation/message_attachments.tsx +61 -0
- package/src/components/conversation/message_markdown.tsx +52 -0
- package/src/components/conversations/conversation_preview.tsx +84 -0
- package/src/components/conversations/conversations.tsx +79 -0
- package/src/components/conversations/unread_count_badge.tsx +38 -0
- package/src/components/display/badge.tsx +41 -10
- package/src/components/display/button.tsx +1 -1
- package/src/components/display/child_notice.tsx +2 -2
- package/src/components/display/icon.tsx +10 -8
- package/src/components/display/text.tsx +1 -7
- package/src/components/index.tsx +1 -1
- package/src/hooks/use_api.ts +11 -10
- package/src/hooks/use_api_client.ts +1 -1
- package/src/hooks/use_conversation.ts +1 -1
- package/src/hooks/use_conversation_jolt_events.ts +1 -1
- package/src/hooks/use_conversation_messages_jolt_events.ts +1 -1
- package/src/hooks/use_conversations.ts +3 -31
- package/src/hooks/use_groups.ts +31 -0
- package/src/hooks/use_groups_groups.ts +20 -0
- package/src/hooks/use_services_team.ts +30 -0
- package/src/hooks/use_suspense_api.ts +4 -4
- package/src/hooks/use_teams.ts +25 -0
- package/src/navigation/index.tsx +8 -0
- package/src/screens/conversation_details_screen.tsx +149 -117
- package/src/screens/conversation_filters_screen.tsx +488 -0
- package/src/screens/conversation_screen.tsx +8 -1
- package/src/screens/conversations_screen.tsx +210 -13
- package/src/screens/create/conversation_select_recipients_screen.tsx +3 -11
- package/src/types/resources/group_resource.ts +5 -2
- package/src/types/resources/index.ts +1 -0
- package/src/types/resources/services/index.ts +1 -0
- package/src/types/resources/services/team_resource.ts +60 -0
- package/src/utils/client/types.d.ts +2 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/native_adapters/audio.ts +15 -0
- package/src/utils/native_adapters/configuration.ts +24 -1
- package/src/utils/native_adapters/index.ts +2 -0
- package/src/utils/native_adapters/video.ts +30 -0
- package/src/utils/parse_simple_markdown.ts +40 -0
- package/src/utils/pluralize.ts +11 -0
- package/src/utils/request/conversation.ts +46 -0
- package/src/utils/request/messages.ts +21 -0
- package/src/utils/theme.ts +2 -2
- package/build/components/conversations.d.ts +0 -3
- package/build/components/conversations.d.ts.map +0 -1
- package/build/components/conversations.js +0 -100
- package/build/components/conversations.js.map +0 -1
- package/src/components/conversations.tsx +0 -144
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ConversationResource } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
export declare
|
|
4
|
-
export declare function useConversations(): {
|
|
2
|
+
import { ConversationRequestArgs } from '../utils/request/conversation';
|
|
3
|
+
export declare function useConversations(args?: Partial<ConversationRequestArgs>): {
|
|
5
4
|
error: Response | null;
|
|
6
5
|
isError: boolean;
|
|
7
6
|
isPending: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_conversations.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"use_conversations.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,uBAAuB,EAA+B,MAAM,+BAA+B,CAAA;AAEpG,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBvE"}
|
|
@@ -1,34 +1,8 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useSuspensePaginator } from './use_suspense_api';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
perPage: 20,
|
|
7
|
-
order: '-last_message',
|
|
8
|
-
fields: {
|
|
9
|
-
Conversation: [
|
|
10
|
-
'created_at',
|
|
11
|
-
'badges',
|
|
12
|
-
'groups',
|
|
13
|
-
'last_message_author_id',
|
|
14
|
-
'last_message_author_name',
|
|
15
|
-
'last_message_created_at',
|
|
16
|
-
'last_message_text_preview',
|
|
17
|
-
'preview_avatar_urls',
|
|
18
|
-
'member_ability',
|
|
19
|
-
'muted',
|
|
20
|
-
'replies_disabled',
|
|
21
|
-
'title',
|
|
22
|
-
'unread_count',
|
|
23
|
-
'updated_at',
|
|
24
|
-
],
|
|
25
|
-
ConversationBadge: ['app_name', 'pco_resource_type', 'text'],
|
|
26
|
-
},
|
|
27
|
-
include: ['badges'],
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
export function useConversations() {
|
|
31
|
-
const requestArgs = getConversationsRequestArgs();
|
|
3
|
+
import { getConversationsRequestArgs } from '../utils/request/conversation';
|
|
4
|
+
export function useConversations(args) {
|
|
5
|
+
const requestArgs = getConversationsRequestArgs(args);
|
|
32
6
|
const { data, ...rest } = useSuspensePaginator(requestArgs);
|
|
33
7
|
const conversations = useMemo(() => data.sort((a, b) => {
|
|
34
8
|
const dateA = a.lastMessageCreatedAt || a.createdAt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_conversations.js","sourceRoot":"","sources":["../../src/hooks/use_conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"use_conversations.js","sourceRoot":"","sources":["../../src/hooks/use_conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAA2B,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAEpG,MAAM,UAAU,gBAAgB,CAAC,IAAuC;IACtE,MAAM,WAAW,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAA;IACrD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,oBAAoB,CAAuB,WAAW,CAAC,CAAA;IAEjF,MAAM,aAAa,GAAG,OAAO,CAC3B,GAAG,EAAE,CACH,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjB,MAAM,KAAK,GAAG,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,SAAS,CAAA;QACnD,MAAM,KAAK,GAAG,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,SAAS,CAAA;QACnD,IAAI,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,CAAC,oBAAoB;YAAE,OAAO,CAAC,CAAA;QAC/D,IAAI,CAAC,CAAC,CAAC,oBAAoB,IAAI,CAAC,CAAC,oBAAoB;YAAE,OAAO,CAAC,CAAC,CAAA;QAChE,IAAI,KAAK,GAAG,KAAK;YAAE,OAAO,CAAC,CAAA;QAC3B,IAAI,KAAK,GAAG,KAAK;YAAE,OAAO,CAAC,CAAC,CAAA;QAC5B,OAAO,CAAC,CAAA;IACV,CAAC,CAAC,EACJ,CAAC,IAAI,CAAC,CACP,CAAA;IAED,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,CAAA;AACnC,CAAC","sourcesContent":["import { useMemo } from 'react'\nimport { ConversationResource } from '../types'\nimport { useSuspensePaginator } from './use_suspense_api'\nimport { ConversationRequestArgs, getConversationsRequestArgs } from '../utils/request/conversation'\n\nexport function useConversations(args?: Partial<ConversationRequestArgs>) {\n const requestArgs = getConversationsRequestArgs(args)\n const { data, ...rest } = useSuspensePaginator<ConversationResource>(requestArgs)\n\n const conversations = useMemo(\n () =>\n data.sort((a, b) => {\n const dateA = a.lastMessageCreatedAt || a.createdAt\n const dateB = b.lastMessageCreatedAt || b.createdAt\n if (a.lastMessageCreatedAt && !b.lastMessageCreatedAt) return 1\n if (!a.lastMessageCreatedAt && b.lastMessageCreatedAt) return -1\n if (dateB > dateA) return 1\n if (dateB < dateA) return -1\n return 0\n }),\n [data]\n )\n\n return { conversations, ...rest }\n}\n"]}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { AppName } from '../types/resources/app_name';
|
|
2
|
+
import { GroupResource, SourceType } from '../types/resources/group_resource';
|
|
3
|
+
type UseGroupsProps = {
|
|
4
|
+
source_app_name: AppName;
|
|
5
|
+
source_type: SourceType;
|
|
6
|
+
};
|
|
7
|
+
export declare const useGroups: ({ source_app_name, source_type }: UseGroupsProps) => {
|
|
8
|
+
data: GroupResource[];
|
|
9
|
+
error: Response;
|
|
10
|
+
isError: true;
|
|
11
|
+
isPending: false;
|
|
12
|
+
isLoading: false;
|
|
13
|
+
isLoadingError: false;
|
|
14
|
+
isRefetchError: true;
|
|
15
|
+
isSuccess: false;
|
|
16
|
+
isPlaceholderData: false;
|
|
17
|
+
status: "error";
|
|
18
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
19
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
20
|
+
hasNextPage: boolean;
|
|
21
|
+
hasPreviousPage: boolean;
|
|
22
|
+
isFetchNextPageError: boolean;
|
|
23
|
+
isFetchingNextPage: boolean;
|
|
24
|
+
isFetchPreviousPageError: boolean;
|
|
25
|
+
isFetchingPreviousPage: boolean;
|
|
26
|
+
dataUpdatedAt: number;
|
|
27
|
+
errorUpdatedAt: number;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Response | null;
|
|
30
|
+
errorUpdateCount: number;
|
|
31
|
+
isFetched: boolean;
|
|
32
|
+
isFetchedAfterMount: boolean;
|
|
33
|
+
isFetching: boolean;
|
|
34
|
+
isInitialLoading: boolean;
|
|
35
|
+
isPaused: boolean;
|
|
36
|
+
isRefetching: boolean;
|
|
37
|
+
isStale: boolean;
|
|
38
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
39
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
40
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>>;
|
|
41
|
+
} | {
|
|
42
|
+
data: GroupResource[];
|
|
43
|
+
error: null;
|
|
44
|
+
isError: false;
|
|
45
|
+
isPending: false;
|
|
46
|
+
isLoading: false;
|
|
47
|
+
isLoadingError: false;
|
|
48
|
+
isRefetchError: false;
|
|
49
|
+
isFetchNextPageError: false;
|
|
50
|
+
isFetchPreviousPageError: false;
|
|
51
|
+
isSuccess: true;
|
|
52
|
+
isPlaceholderData: false;
|
|
53
|
+
status: "success";
|
|
54
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
55
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
56
|
+
hasNextPage: boolean;
|
|
57
|
+
hasPreviousPage: boolean;
|
|
58
|
+
isFetchingNextPage: boolean;
|
|
59
|
+
isFetchingPreviousPage: boolean;
|
|
60
|
+
dataUpdatedAt: number;
|
|
61
|
+
errorUpdatedAt: number;
|
|
62
|
+
failureCount: number;
|
|
63
|
+
failureReason: Response | null;
|
|
64
|
+
errorUpdateCount: number;
|
|
65
|
+
isFetched: boolean;
|
|
66
|
+
isFetchedAfterMount: boolean;
|
|
67
|
+
isFetching: boolean;
|
|
68
|
+
isInitialLoading: boolean;
|
|
69
|
+
isPaused: boolean;
|
|
70
|
+
isRefetching: boolean;
|
|
71
|
+
isStale: boolean;
|
|
72
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
73
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
74
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>>;
|
|
75
|
+
} | {
|
|
76
|
+
data: GroupResource[];
|
|
77
|
+
error: Response;
|
|
78
|
+
isError: true;
|
|
79
|
+
isPending: false;
|
|
80
|
+
isLoading: false;
|
|
81
|
+
isLoadingError: true;
|
|
82
|
+
isRefetchError: false;
|
|
83
|
+
isFetchNextPageError: false;
|
|
84
|
+
isFetchPreviousPageError: false;
|
|
85
|
+
isSuccess: false;
|
|
86
|
+
isPlaceholderData: false;
|
|
87
|
+
status: "error";
|
|
88
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
89
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
90
|
+
hasNextPage: boolean;
|
|
91
|
+
hasPreviousPage: boolean;
|
|
92
|
+
isFetchingNextPage: boolean;
|
|
93
|
+
isFetchingPreviousPage: boolean;
|
|
94
|
+
dataUpdatedAt: number;
|
|
95
|
+
errorUpdatedAt: number;
|
|
96
|
+
failureCount: number;
|
|
97
|
+
failureReason: Response | null;
|
|
98
|
+
errorUpdateCount: number;
|
|
99
|
+
isFetched: boolean;
|
|
100
|
+
isFetchedAfterMount: boolean;
|
|
101
|
+
isFetching: boolean;
|
|
102
|
+
isInitialLoading: boolean;
|
|
103
|
+
isPaused: boolean;
|
|
104
|
+
isRefetching: boolean;
|
|
105
|
+
isStale: boolean;
|
|
106
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
107
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
108
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>>;
|
|
109
|
+
} | {
|
|
110
|
+
data: GroupResource[];
|
|
111
|
+
error: null;
|
|
112
|
+
isError: false;
|
|
113
|
+
isPending: true;
|
|
114
|
+
isLoading: true;
|
|
115
|
+
isLoadingError: false;
|
|
116
|
+
isRefetchError: false;
|
|
117
|
+
isFetchNextPageError: false;
|
|
118
|
+
isFetchPreviousPageError: false;
|
|
119
|
+
isSuccess: false;
|
|
120
|
+
isPlaceholderData: false;
|
|
121
|
+
status: "pending";
|
|
122
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
123
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
124
|
+
hasNextPage: boolean;
|
|
125
|
+
hasPreviousPage: boolean;
|
|
126
|
+
isFetchingNextPage: boolean;
|
|
127
|
+
isFetchingPreviousPage: boolean;
|
|
128
|
+
dataUpdatedAt: number;
|
|
129
|
+
errorUpdatedAt: number;
|
|
130
|
+
failureCount: number;
|
|
131
|
+
failureReason: Response | null;
|
|
132
|
+
errorUpdateCount: number;
|
|
133
|
+
isFetched: boolean;
|
|
134
|
+
isFetchedAfterMount: boolean;
|
|
135
|
+
isFetching: boolean;
|
|
136
|
+
isInitialLoading: boolean;
|
|
137
|
+
isPaused: boolean;
|
|
138
|
+
isRefetching: boolean;
|
|
139
|
+
isStale: boolean;
|
|
140
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
141
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
142
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>>;
|
|
143
|
+
} | {
|
|
144
|
+
data: GroupResource[];
|
|
145
|
+
error: null;
|
|
146
|
+
isError: false;
|
|
147
|
+
isPending: true;
|
|
148
|
+
isLoadingError: false;
|
|
149
|
+
isRefetchError: false;
|
|
150
|
+
isFetchNextPageError: false;
|
|
151
|
+
isFetchPreviousPageError: false;
|
|
152
|
+
isSuccess: false;
|
|
153
|
+
isPlaceholderData: false;
|
|
154
|
+
status: "pending";
|
|
155
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
156
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
157
|
+
hasNextPage: boolean;
|
|
158
|
+
hasPreviousPage: boolean;
|
|
159
|
+
isFetchingNextPage: boolean;
|
|
160
|
+
isFetchingPreviousPage: boolean;
|
|
161
|
+
dataUpdatedAt: number;
|
|
162
|
+
errorUpdatedAt: number;
|
|
163
|
+
failureCount: number;
|
|
164
|
+
failureReason: Response | null;
|
|
165
|
+
errorUpdateCount: number;
|
|
166
|
+
isFetched: boolean;
|
|
167
|
+
isFetchedAfterMount: boolean;
|
|
168
|
+
isFetching: boolean;
|
|
169
|
+
isLoading: boolean;
|
|
170
|
+
isInitialLoading: boolean;
|
|
171
|
+
isPaused: boolean;
|
|
172
|
+
isRefetching: boolean;
|
|
173
|
+
isStale: boolean;
|
|
174
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
175
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
176
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>>;
|
|
177
|
+
} | {
|
|
178
|
+
data: GroupResource[];
|
|
179
|
+
isError: false;
|
|
180
|
+
error: null;
|
|
181
|
+
isPending: false;
|
|
182
|
+
isLoading: false;
|
|
183
|
+
isLoadingError: false;
|
|
184
|
+
isRefetchError: false;
|
|
185
|
+
isSuccess: true;
|
|
186
|
+
isPlaceholderData: true;
|
|
187
|
+
isFetchNextPageError: false;
|
|
188
|
+
isFetchPreviousPageError: false;
|
|
189
|
+
status: "success";
|
|
190
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
191
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
192
|
+
hasNextPage: boolean;
|
|
193
|
+
hasPreviousPage: boolean;
|
|
194
|
+
isFetchingNextPage: boolean;
|
|
195
|
+
isFetchingPreviousPage: boolean;
|
|
196
|
+
dataUpdatedAt: number;
|
|
197
|
+
errorUpdatedAt: number;
|
|
198
|
+
failureCount: number;
|
|
199
|
+
failureReason: Response | null;
|
|
200
|
+
errorUpdateCount: number;
|
|
201
|
+
isFetched: boolean;
|
|
202
|
+
isFetchedAfterMount: boolean;
|
|
203
|
+
isFetching: boolean;
|
|
204
|
+
isInitialLoading: boolean;
|
|
205
|
+
isPaused: boolean;
|
|
206
|
+
isRefetching: boolean;
|
|
207
|
+
isStale: boolean;
|
|
208
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>, Response>>;
|
|
209
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
210
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<GroupResource>, unknown>>;
|
|
211
|
+
};
|
|
212
|
+
export declare const useCanDisplayGroups: (props: UseGroupsProps) => boolean;
|
|
213
|
+
export {};
|
|
214
|
+
//# sourceMappingURL=use_groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_groups.d.ts","sourceRoot":"","sources":["../../src/hooks/use_groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAG7E,KAAK,cAAc,GAAG;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,WAAW,EAAE,UAAU,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,SAAS,qCAAsC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAezE,CAAA;AAED,eAAO,MAAM,mBAAmB,UAAW,cAAc,YAIxD,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useApiPaginator } from './use_api';
|
|
2
|
+
export const useGroups = ({ source_app_name, source_type }) => {
|
|
3
|
+
return useApiPaginator({
|
|
4
|
+
url: '/me/groups',
|
|
5
|
+
data: {
|
|
6
|
+
fields: {
|
|
7
|
+
Group: [],
|
|
8
|
+
},
|
|
9
|
+
where: {
|
|
10
|
+
source_app_name,
|
|
11
|
+
source_type,
|
|
12
|
+
},
|
|
13
|
+
perPage: 100,
|
|
14
|
+
},
|
|
15
|
+
app: 'chat',
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export const useCanDisplayGroups = (props) => {
|
|
19
|
+
const { data: teams = [] } = useGroups(props);
|
|
20
|
+
return teams?.length > 0;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=use_groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_groups.js","sourceRoot":"","sources":["../../src/hooks/use_groups.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAO3C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,eAAe,EAAE,WAAW,EAAkB,EAAE,EAAE;IAC5E,OAAO,eAAe,CAAgB;QACpC,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE;aACV;YACD,KAAK,EAAE;gBACL,eAAe;gBACf,WAAW;aACZ;YACD,OAAO,EAAE,GAAG;SACb;QACD,GAAG,EAAE,MAAM;KACZ,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3D,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;IAE7C,OAAO,KAAK,EAAE,MAAM,GAAG,CAAC,CAAA;AAC1B,CAAC,CAAA","sourcesContent":["import { AppName } from '../types/resources/app_name'\nimport { GroupResource, SourceType } from '../types/resources/group_resource'\nimport { useApiPaginator } from './use_api'\n\ntype UseGroupsProps = {\n source_app_name: AppName\n source_type: SourceType\n}\n\nexport const useGroups = ({ source_app_name, source_type }: UseGroupsProps) => {\n return useApiPaginator<GroupResource>({\n url: '/me/groups',\n data: {\n fields: {\n Group: [],\n },\n where: {\n source_app_name,\n source_type,\n },\n perPage: 100,\n },\n app: 'chat',\n })\n}\n\nexport const useCanDisplayGroups = (props: UseGroupsProps) => {\n const { data: teams = [] } = useGroups(props)\n\n return teams?.length > 0\n}\n"]}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { GroupsGroupResource } from '../types';
|
|
2
|
+
export declare const useGroupsGroups: () => {
|
|
3
|
+
data: GroupsGroupResource[];
|
|
4
|
+
error: Response;
|
|
5
|
+
isError: true;
|
|
6
|
+
isPending: false;
|
|
7
|
+
isLoading: false;
|
|
8
|
+
isLoadingError: false;
|
|
9
|
+
isRefetchError: true;
|
|
10
|
+
isSuccess: false;
|
|
11
|
+
isPlaceholderData: false;
|
|
12
|
+
status: "error";
|
|
13
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
14
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
15
|
+
hasNextPage: boolean;
|
|
16
|
+
hasPreviousPage: boolean;
|
|
17
|
+
isFetchNextPageError: boolean;
|
|
18
|
+
isFetchingNextPage: boolean;
|
|
19
|
+
isFetchPreviousPageError: boolean;
|
|
20
|
+
isFetchingPreviousPage: boolean;
|
|
21
|
+
dataUpdatedAt: number;
|
|
22
|
+
errorUpdatedAt: number;
|
|
23
|
+
failureCount: number;
|
|
24
|
+
failureReason: Response | null;
|
|
25
|
+
errorUpdateCount: number;
|
|
26
|
+
isFetched: boolean;
|
|
27
|
+
isFetchedAfterMount: boolean;
|
|
28
|
+
isFetching: boolean;
|
|
29
|
+
isInitialLoading: boolean;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
isRefetching: boolean;
|
|
32
|
+
isStale: boolean;
|
|
33
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
34
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
35
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>>;
|
|
36
|
+
} | {
|
|
37
|
+
data: GroupsGroupResource[];
|
|
38
|
+
error: null;
|
|
39
|
+
isError: false;
|
|
40
|
+
isPending: false;
|
|
41
|
+
isLoading: false;
|
|
42
|
+
isLoadingError: false;
|
|
43
|
+
isRefetchError: false;
|
|
44
|
+
isFetchNextPageError: false;
|
|
45
|
+
isFetchPreviousPageError: false;
|
|
46
|
+
isSuccess: true;
|
|
47
|
+
isPlaceholderData: false;
|
|
48
|
+
status: "success";
|
|
49
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
50
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
51
|
+
hasNextPage: boolean;
|
|
52
|
+
hasPreviousPage: boolean;
|
|
53
|
+
isFetchingNextPage: boolean;
|
|
54
|
+
isFetchingPreviousPage: boolean;
|
|
55
|
+
dataUpdatedAt: number;
|
|
56
|
+
errorUpdatedAt: number;
|
|
57
|
+
failureCount: number;
|
|
58
|
+
failureReason: Response | null;
|
|
59
|
+
errorUpdateCount: number;
|
|
60
|
+
isFetched: boolean;
|
|
61
|
+
isFetchedAfterMount: boolean;
|
|
62
|
+
isFetching: boolean;
|
|
63
|
+
isInitialLoading: boolean;
|
|
64
|
+
isPaused: boolean;
|
|
65
|
+
isRefetching: boolean;
|
|
66
|
+
isStale: boolean;
|
|
67
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
68
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
69
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>>;
|
|
70
|
+
} | {
|
|
71
|
+
data: GroupsGroupResource[];
|
|
72
|
+
error: Response;
|
|
73
|
+
isError: true;
|
|
74
|
+
isPending: false;
|
|
75
|
+
isLoading: false;
|
|
76
|
+
isLoadingError: true;
|
|
77
|
+
isRefetchError: false;
|
|
78
|
+
isFetchNextPageError: false;
|
|
79
|
+
isFetchPreviousPageError: false;
|
|
80
|
+
isSuccess: false;
|
|
81
|
+
isPlaceholderData: false;
|
|
82
|
+
status: "error";
|
|
83
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
84
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
85
|
+
hasNextPage: boolean;
|
|
86
|
+
hasPreviousPage: boolean;
|
|
87
|
+
isFetchingNextPage: boolean;
|
|
88
|
+
isFetchingPreviousPage: boolean;
|
|
89
|
+
dataUpdatedAt: number;
|
|
90
|
+
errorUpdatedAt: number;
|
|
91
|
+
failureCount: number;
|
|
92
|
+
failureReason: Response | 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
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
102
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
103
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>>;
|
|
104
|
+
} | {
|
|
105
|
+
data: GroupsGroupResource[];
|
|
106
|
+
error: null;
|
|
107
|
+
isError: false;
|
|
108
|
+
isPending: true;
|
|
109
|
+
isLoading: true;
|
|
110
|
+
isLoadingError: false;
|
|
111
|
+
isRefetchError: false;
|
|
112
|
+
isFetchNextPageError: false;
|
|
113
|
+
isFetchPreviousPageError: false;
|
|
114
|
+
isSuccess: false;
|
|
115
|
+
isPlaceholderData: false;
|
|
116
|
+
status: "pending";
|
|
117
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
118
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
119
|
+
hasNextPage: boolean;
|
|
120
|
+
hasPreviousPage: boolean;
|
|
121
|
+
isFetchingNextPage: boolean;
|
|
122
|
+
isFetchingPreviousPage: boolean;
|
|
123
|
+
dataUpdatedAt: number;
|
|
124
|
+
errorUpdatedAt: number;
|
|
125
|
+
failureCount: number;
|
|
126
|
+
failureReason: Response | null;
|
|
127
|
+
errorUpdateCount: number;
|
|
128
|
+
isFetched: boolean;
|
|
129
|
+
isFetchedAfterMount: boolean;
|
|
130
|
+
isFetching: boolean;
|
|
131
|
+
isInitialLoading: boolean;
|
|
132
|
+
isPaused: boolean;
|
|
133
|
+
isRefetching: boolean;
|
|
134
|
+
isStale: boolean;
|
|
135
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
136
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
137
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>>;
|
|
138
|
+
} | {
|
|
139
|
+
data: GroupsGroupResource[];
|
|
140
|
+
error: null;
|
|
141
|
+
isError: false;
|
|
142
|
+
isPending: true;
|
|
143
|
+
isLoadingError: false;
|
|
144
|
+
isRefetchError: false;
|
|
145
|
+
isFetchNextPageError: false;
|
|
146
|
+
isFetchPreviousPageError: false;
|
|
147
|
+
isSuccess: false;
|
|
148
|
+
isPlaceholderData: false;
|
|
149
|
+
status: "pending";
|
|
150
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
151
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
152
|
+
hasNextPage: boolean;
|
|
153
|
+
hasPreviousPage: boolean;
|
|
154
|
+
isFetchingNextPage: boolean;
|
|
155
|
+
isFetchingPreviousPage: boolean;
|
|
156
|
+
dataUpdatedAt: number;
|
|
157
|
+
errorUpdatedAt: number;
|
|
158
|
+
failureCount: number;
|
|
159
|
+
failureReason: Response | null;
|
|
160
|
+
errorUpdateCount: number;
|
|
161
|
+
isFetched: boolean;
|
|
162
|
+
isFetchedAfterMount: boolean;
|
|
163
|
+
isFetching: boolean;
|
|
164
|
+
isLoading: boolean;
|
|
165
|
+
isInitialLoading: boolean;
|
|
166
|
+
isPaused: boolean;
|
|
167
|
+
isRefetching: boolean;
|
|
168
|
+
isStale: boolean;
|
|
169
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
170
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
171
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>>;
|
|
172
|
+
} | {
|
|
173
|
+
data: GroupsGroupResource[];
|
|
174
|
+
isError: false;
|
|
175
|
+
error: null;
|
|
176
|
+
isPending: false;
|
|
177
|
+
isLoading: false;
|
|
178
|
+
isLoadingError: false;
|
|
179
|
+
isRefetchError: false;
|
|
180
|
+
isSuccess: true;
|
|
181
|
+
isPlaceholderData: true;
|
|
182
|
+
isFetchNextPageError: false;
|
|
183
|
+
isFetchPreviousPageError: false;
|
|
184
|
+
status: "success";
|
|
185
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
186
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
187
|
+
hasNextPage: boolean;
|
|
188
|
+
hasPreviousPage: boolean;
|
|
189
|
+
isFetchingNextPage: boolean;
|
|
190
|
+
isFetchingPreviousPage: boolean;
|
|
191
|
+
dataUpdatedAt: number;
|
|
192
|
+
errorUpdatedAt: number;
|
|
193
|
+
failureCount: number;
|
|
194
|
+
failureReason: Response | null;
|
|
195
|
+
errorUpdateCount: number;
|
|
196
|
+
isFetched: boolean;
|
|
197
|
+
isFetchedAfterMount: boolean;
|
|
198
|
+
isFetching: boolean;
|
|
199
|
+
isInitialLoading: boolean;
|
|
200
|
+
isPaused: boolean;
|
|
201
|
+
isRefetching: boolean;
|
|
202
|
+
isStale: boolean;
|
|
203
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>, Response>>;
|
|
204
|
+
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
205
|
+
promise: Promise<import("@tanstack/query-core").InfiniteData<import("../types").ApiCollection<GroupsGroupResource>, unknown>>;
|
|
206
|
+
};
|
|
207
|
+
export declare const useCanDisplayGroupsGroups: () => boolean;
|
|
208
|
+
//# sourceMappingURL=use_groups_groups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_groups_groups.d.ts","sourceRoot":"","sources":["../../src/hooks/use_groups_groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAG9C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAW3B,CAAA;AAED,eAAO,MAAM,yBAAyB,eAGrC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useApiPaginator } from './use_api';
|
|
2
|
+
export const useGroupsGroups = () => {
|
|
3
|
+
return useApiPaginator({
|
|
4
|
+
url: '/me/groups',
|
|
5
|
+
data: {
|
|
6
|
+
perPage: 100,
|
|
7
|
+
fields: {
|
|
8
|
+
Group: ['can_create_conversation', 'name', 'header_image', 'memberships_count'],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
app: 'groups',
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export const useCanDisplayGroupsGroups = () => {
|
|
15
|
+
const { data: groups = [] } = useGroupsGroups();
|
|
16
|
+
return groups?.length > 0;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=use_groups_groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_groups_groups.js","sourceRoot":"","sources":["../../src/hooks/use_groups_groups.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,eAAe,CAAsB;QAC1C,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE;YACJ,OAAO,EAAE,GAAG;YACZ,MAAM,EAAE;gBACN,KAAK,EAAE,CAAC,yBAAyB,EAAE,MAAM,EAAE,cAAc,EAAE,mBAAmB,CAAC;aAChF;SACF;QACD,GAAG,EAAE,QAAQ;KACd,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,eAAe,EAAE,CAAA;IAC/C,OAAO,MAAM,EAAE,MAAM,GAAG,CAAC,CAAA;AAC3B,CAAC,CAAA","sourcesContent":["import { GroupsGroupResource } from '../types'\nimport { useApiPaginator } from './use_api'\n\nexport const useGroupsGroups = () => {\n return useApiPaginator<GroupsGroupResource>({\n url: '/me/groups',\n data: {\n perPage: 100,\n fields: {\n Group: ['can_create_conversation', 'name', 'header_image', 'memberships_count'],\n },\n },\n app: 'groups',\n })\n}\n\nexport const useCanDisplayGroupsGroups = () => {\n const { data: groups = [] } = useGroupsGroups()\n return groups?.length > 0\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_services_team.d.ts","sourceRoot":"","sources":["../../src/hooks/use_services_team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAGrE,eAAO,MAAM,gBAAgB,gCAY5B,CAAA;AAED,eAAO,MAAM,mBAAmB,8CAY/B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useApiGet } from './use_api';
|
|
2
|
+
export const useServicesTeams = () => {
|
|
3
|
+
const { data: chat } = useApiGet({
|
|
4
|
+
url: '/chat',
|
|
5
|
+
data: {
|
|
6
|
+
fields: {
|
|
7
|
+
Chat: ['teams'],
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
app: 'services',
|
|
11
|
+
});
|
|
12
|
+
return chat?.teams || [];
|
|
13
|
+
};
|
|
14
|
+
export const useServicesTeamsMap = () => {
|
|
15
|
+
const teams = useServicesTeams();
|
|
16
|
+
return teams.reduce((acc, team) => {
|
|
17
|
+
const id = `Services-Team-${team.value.teamId}`;
|
|
18
|
+
acc[id] = team;
|
|
19
|
+
return acc;
|
|
20
|
+
}, {});
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=use_services_team.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use_services_team.js","sourceRoot":"","sources":["../../src/hooks/use_services_team.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,SAAS,CAAqB;QACnD,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,CAAC,OAAO,CAAC;aAChB;SACF;QACD,GAAG,EAAE,UAAU;KAChB,CAAC,CAAA;IAEF,OAAO,IAAI,EAAE,KAAK,IAAI,EAAE,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAA;IAEhC,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACZ,MAAM,EAAE,GAAG,iBAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;QAC/C,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;QAEd,OAAO,GAAG,CAAA;IACZ,CAAC,EACD,EAA4C,CAC7C,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { TeamOptionResource, TeamOptionResponseItem } from '../types'\nimport { useApiGet } from './use_api'\n\nexport const useServicesTeams = () => {\n const { data: chat } = useApiGet<TeamOptionResource>({\n url: '/chat',\n data: {\n fields: {\n Chat: ['teams'],\n },\n },\n app: 'services',\n })\n\n return chat?.teams || []\n}\n\nexport const useServicesTeamsMap = () => {\n const teams = useServicesTeams()\n\n return teams.reduce(\n (acc, team) => {\n const id = `Services-Team-${team.value.teamId}`\n acc[id] = team\n\n return acc\n },\n {} as Record<string, TeamOptionResponseItem>\n )\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AnyUseSuspenseInfiniteQueryOptions, InfiniteData } from '@tanstack/react-query';
|
|
2
2
|
import { ApiCollection, ApiResource, ResourceObject } from '../types';
|
|
3
3
|
import { GetRequest } from '../utils/client/types';
|
|
4
|
+
import { App } from './use_api_client';
|
|
4
5
|
interface SuspenseGetOptions extends GetRequest {
|
|
5
|
-
app?:
|
|
6
|
+
app?: App;
|
|
6
7
|
}
|
|
7
8
|
export declare const useSuspenseGet: <T extends ResourceObject | ResourceObject[]>(args: SuspenseGetOptions) => {
|
|
8
9
|
error: Response | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_suspense_api.d.ts","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,YAAY,EAGb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,UAAU,EAAe,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"use_suspense_api.d.ts","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,YAAY,EAGb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,UAAU,EAAe,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,GAAG,EAAgB,MAAM,kBAAkB,CAAA;AAEpD,UAAU,kBAAmB,SAAQ,UAAU;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAA;CACV;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,QAClE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;CASzB,CAAA;AAOD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,kCAAkC,EAClC,kBAAkB,GAAG,kBAAkB,GAAG,SAAS,GAAG,UAAU,CACjE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,cAAc,QACrD,kBAAkB,SACjB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,CAAC,KAAK,CAAC;IACzB,kBAAkB,CAAC,MAAM,CAAC;IAC1B,kBAAkB,CAAC,SAAS,CAAC;IAC7B,kBAAkB,CAAC,KAAK,CAAC;CAC1B,CAAA;AACD,eAAO,MAAM,kBAAkB,SAAU,kBAAkB,KAAG,eAK7D,CAAA"}
|
|
@@ -14,9 +14,10 @@ export const useSuspensePaginator = (args, opts) => {
|
|
|
14
14
|
const pageParmWhere = pageParam?.where || {};
|
|
15
15
|
const argsWhere = args.data.where || {};
|
|
16
16
|
const where = { ...argsWhere, ...pageParmWhere };
|
|
17
|
+
const app = args.app || 'chat';
|
|
17
18
|
const offset = pageParam?.offset || args.data.offset;
|
|
18
19
|
const data = { ...args.data, where, offset };
|
|
19
|
-
return apiClient.
|
|
20
|
+
return apiClient[app].get({
|
|
20
21
|
url: args.url,
|
|
21
22
|
data,
|
|
22
23
|
});
|