@planningcenter/chat-react-native 4.6.4-rc.0 โ 4.7.0-rc.1
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/message_list.d.ts.map +1 -1
- package/build/components/conversation/message_list.js +7 -0
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/components/conversation/unsupported_message.d.ts +15 -0
- package/build/components/conversation/unsupported_message.d.ts.map +1 -0
- package/build/components/conversation/unsupported_message.js +415 -0
- package/build/components/conversation/unsupported_message.js.map +1 -0
- package/build/contexts/api_provider.js +39 -33
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +1 -0
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +28 -25
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/session_context.d.ts +2 -1
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +10 -6
- package/build/contexts/session_context.js.map +1 -1
- package/build/types/jolt_events/message_events.d.ts +3 -0
- package/build/types/jolt_events/message_events.d.ts.map +1 -1
- package/build/types/jolt_events/message_events.js.map +1 -1
- package/build/types/resources/fallback_content.d.ts +20 -0
- package/build/types/resources/fallback_content.d.ts.map +1 -0
- package/build/types/resources/fallback_content.js +2 -0
- package/build/types/resources/fallback_content.js.map +1 -0
- package/build/types/resources/message.d.ts +3 -0
- package/build/types/resources/message.d.ts.map +1 -1
- package/build/types/resources/message.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +2 -0
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/message_types.d.ts +5 -0
- package/build/utils/message_types.d.ts.map +1 -0
- package/build/utils/message_types.js +10 -0
- package/build/utils/message_types.js.map +1 -0
- package/build/utils/request/messages_data_options.d.ts.map +1 -1
- package/build/utils/request/messages_data_options.js +1 -1
- package/build/utils/request/messages_data_options.js.map +1 -1
- package/build/utils/session.d.ts +3 -1
- package/build/utils/session.d.ts.map +1 -1
- package/build/utils/session.js +3 -0
- package/build/utils/session.js.map +1 -1
- package/build/utils/session_manager.d.ts +1 -1
- package/build/utils/session_manager.d.ts.map +1 -1
- package/build/utils/session_manager.js +2 -1
- package/build/utils/session_manager.js.map +1 -1
- package/build/utils/upload_uri.d.ts.map +1 -1
- package/build/utils/upload_uri.js +3 -0
- package/build/utils/upload_uri.js.map +1 -1
- package/build/utils/uri.d.ts.map +1 -1
- package/build/utils/uri.js +4 -0
- package/build/utils/uri.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/__tests__/message_list.test.tsx +1 -1
- package/src/components/conversation/__tests__/unsupported_message.test.tsx +109 -0
- package/src/components/conversation/message_list.tsx +6 -0
- package/src/components/conversation/unsupported_message.tsx +202 -0
- package/src/contexts/__tests__/api_provider.test.tsx +17 -4
- package/src/contexts/api_provider.tsx +13 -6
- package/src/contexts/chat_context.tsx +4 -2
- package/src/contexts/session_context.tsx +18 -10
- package/src/types/jolt_events/message_events.ts +3 -0
- package/src/types/resources/fallback_content.ts +20 -0
- package/src/types/resources/message.ts +5 -0
- package/src/utils/__tests__/message_types.test.ts +22 -0
- package/src/utils/__tests__/session_manager.test.ts +12 -0
- package/src/utils/__tests__/uri.test.ts +26 -0
- package/src/utils/jolt/__tests__/transform_message_event_data_to_message_resource.test.ts +10 -0
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +2 -0
- package/src/utils/message_types.ts +22 -0
- package/src/utils/request/messages_data_options.ts +1 -0
- package/src/utils/session.ts +11 -3
- package/src/utils/session_manager.ts +2 -1
- package/src/utils/upload_uri.ts +4 -0
- package/src/utils/uri.ts +5 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** FallbackContent
|
|
2
|
+
* The read-only shape the server sends for a message type this build can't render: text and
|
|
3
|
+
* numbers only, nothing actionable, and only `title` is guaranteed. It is a contract with
|
|
4
|
+
* shipped builds, so it only ever gains optional fields.
|
|
5
|
+
*/
|
|
6
|
+
export interface FallbackContentItem {
|
|
7
|
+
label: string;
|
|
8
|
+
detail?: string | null;
|
|
9
|
+
fraction?: number | null;
|
|
10
|
+
selected?: boolean | null;
|
|
11
|
+
}
|
|
12
|
+
export interface FallbackContent {
|
|
13
|
+
kind: string;
|
|
14
|
+
title: string;
|
|
15
|
+
subtitle?: string | null;
|
|
16
|
+
items?: FallbackContentItem[] | null;
|
|
17
|
+
footer?: string | null;
|
|
18
|
+
hint?: string | null;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=fallback_content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback_content.d.ts","sourceRoot":"","sources":["../../../src/types/resources/fallback_content.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback_content.js","names":[],"sources":["../../../src/types/resources/fallback_content.ts"],"sourcesContent":["/** FallbackContent\n * The read-only shape the server sends for a message type this build can't render: text and\n * numbers only, nothing actionable, and only `title` is guaranteed. It is a contract with\n * shipped builds, so it only ever gains optional fields.\n */\nexport interface FallbackContentItem {\n label: string\n detail?: string | null\n fraction?: number | null\n selected?: boolean | null\n}\n\nexport interface FallbackContent {\n kind: string\n title: string\n subtitle?: string | null\n items?: FallbackContentItem[] | null\n footer?: string | null\n hint?: string | null\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DenormalizedAttachmentResource } from './denormalized_attachment_resource';
|
|
2
2
|
import { DenormalizedAttachmentResourceForCreate } from './denormalized_attachment_resource_for_create';
|
|
3
|
+
import type { FallbackContent } from './fallback_content';
|
|
3
4
|
import type { PersonResource } from './person';
|
|
4
5
|
import type { ReactionCountResource } from './reaction';
|
|
5
6
|
export type SystemTextFormat = 'people' | 'actor';
|
|
@@ -20,6 +21,8 @@ export interface MessageResource {
|
|
|
20
21
|
replyRoot?: MessageResource | null;
|
|
21
22
|
idempotentKey?: string | null;
|
|
22
23
|
messageType: string;
|
|
24
|
+
unsupportedMessageType?: string | null;
|
|
25
|
+
fallbackContent?: FallbackContent | null;
|
|
23
26
|
personIdsForSystemEvent?: number[] | null;
|
|
24
27
|
systemTextParts?: {
|
|
25
28
|
names: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/types/resources/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAA;AACnF,OAAO,EAAE,uCAAuC,EAAE,MAAM,+CAA+C,CAAA;AACvG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEjD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACn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[],"sources":["../../../src/types/resources/message.ts"],"sourcesContent":["import { DenormalizedAttachmentResource } from './denormalized_attachment_resource'\nimport { DenormalizedAttachmentResourceForCreate } from './denormalized_attachment_resource_for_create'\nimport type { PersonResource } from './person'\nimport type { ReactionCountResource } from './reaction'\n\nexport type SystemTextFormat = 'people' | 'actor'\n\nexport interface MessageResource {\n type: 'Message'\n id: string\n text: string | null\n html: string\n createdAt: string\n deletedAt: string | null\n textEditedAt: string | null\n mine: boolean\n attachments: DenormalizedAttachmentResource[]\n author: PersonResource\n reactionCounts: ReactionCountResource[]\n replyCount: number\n replyRootId?: string | null\n replyRoot?: MessageResource | null\n idempotentKey?: string | null\n messageType: string\n personIdsForSystemEvent?: number[] | null\n systemTextParts?: { names: string[]; overflowCount: number; action: string } | null\n systemTextFormat?: SystemTextFormat | null\n\n // Custom Local Properties we set for rendering\n renderAuthor?: boolean\n renderTime?: boolean\n myLatestInConversation?: boolean\n lastInGroup?: boolean\n threadPosition?: 'first' | 'center' | 'last' | null\n prevIsMyReply?: boolean\n nextIsMyReply?: boolean\n nextRendersAuthor?: boolean\n isReplyShadowMessage?: boolean\n nextIsReplyShadowMessage?: boolean\n\n // Properties for mutation state\n pending?: boolean // Indicates if the message is optimistically created and pending server response\n error?: string // Error message if the message failed to send\n attachmentsForCreate?: DenormalizedAttachmentResourceForCreate[]\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"message.js","names":[],"sources":["../../../src/types/resources/message.ts"],"sourcesContent":["import { DenormalizedAttachmentResource } from './denormalized_attachment_resource'\nimport { DenormalizedAttachmentResourceForCreate } from './denormalized_attachment_resource_for_create'\nimport type { FallbackContent } from './fallback_content'\nimport type { PersonResource } from './person'\nimport type { ReactionCountResource } from './reaction'\n\nexport type SystemTextFormat = 'people' | 'actor'\n\nexport interface MessageResource {\n type: 'Message'\n id: string\n text: string | null\n html: string\n createdAt: string\n deletedAt: string | null\n textEditedAt: string | null\n mine: boolean\n attachments: DenormalizedAttachmentResource[]\n author: PersonResource\n reactionCounts: ReactionCountResource[]\n replyCount: number\n replyRootId?: string | null\n replyRoot?: MessageResource | null\n idempotentKey?: string | null\n messageType: string\n // Set when messageType is 'unsupported': the type the server would have sent a newer client.\n unsupportedMessageType?: string | null\n // Set when messageType is 'unsupported': what to show read-only in place of the type.\n fallbackContent?: FallbackContent | null\n personIdsForSystemEvent?: number[] | null\n systemTextParts?: { names: string[]; overflowCount: number; action: string } | null\n systemTextFormat?: SystemTextFormat | null\n\n // Custom Local Properties we set for rendering\n renderAuthor?: boolean\n renderTime?: boolean\n myLatestInConversation?: boolean\n lastInGroup?: boolean\n threadPosition?: 'first' | 'center' | 'last' | null\n prevIsMyReply?: boolean\n nextIsMyReply?: boolean\n nextRendersAuthor?: boolean\n isReplyShadowMessage?: boolean\n nextIsReplyShadowMessage?: boolean\n\n // Properties for mutation state\n pending?: boolean // Indicates if the message is optimistically created and pending server response\n error?: string // Error message if the message failed to send\n attachmentsForCreate?: DenormalizedAttachmentResourceForCreate[]\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform_message_event_data_to_message_resource.d.ts","sourceRoot":"","sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAI5E,wBAAgB,0CAA0C,CAAC,EACzD,IAAI,EACJ,eAAe,GAChB,EAAE;IACD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,eAAe,EAAE,MAAM,CAAA;CACxB,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"transform_message_event_data_to_message_resource.d.ts","sourceRoot":"","sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAA;AAI5E,wBAAgB,0CAA0C,CAAC,EACzD,IAAI,EACJ,eAAe,GAChB,EAAE;IACD,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;IACzC,eAAe,EAAE,MAAM,CAAA;CACxB,GAAG,eAAe,CAkClB"}
|
|
@@ -24,6 +24,8 @@ export function transformMessageEventDataToMessageResource({
|
|
|
24
24
|
replyRootId: data.reply_root_id || null,
|
|
25
25
|
idempotentKey: data.idempotent_key ?? null,
|
|
26
26
|
messageType: data.message_type,
|
|
27
|
+
unsupportedMessageType: data.unsupported_message_type ?? null,
|
|
28
|
+
fallbackContent: data.fallback_content ?? null,
|
|
27
29
|
personIdsForSystemEvent: data.system_event_person_ids,
|
|
28
30
|
systemTextParts: data.system_text_parts ? {
|
|
29
31
|
names: data.system_text_parts.names,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform_message_event_data_to_message_resource.js","names":["deepCamelCaseKeys","transformMessageEventDataToMessageResource","data","currentPersonId","type","id","sort_key","text","html","createdAt","created_at","deletedAt","deleted_at","textEditedAt","text_edited_at","mine","author_id","attachments","author","name","author_name","avatar","author_avatar","reactionCounts","replyCount","reply_count","replyRootId","reply_root_id","idempotentKey","idempotent_key","messageType","message_type","personIdsForSystemEvent","system_event_person_ids","systemTextParts","system_text_parts","names","overflowCount","overflow_count","action","systemTextFormat","system_text_format"],"sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"sourcesContent":["import { MessageResource } from '../../types'\nimport { MessageCreatedEvent } from '../../types/jolt_events/message_events'\nimport { DenormalizedAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport { deepCamelCaseKeys } from '../deepCamelCaseKeys'\n\nexport function transformMessageEventDataToMessageResource({\n data,\n currentPersonId,\n}: {\n data: MessageCreatedEvent['data']['data']\n currentPersonId: number\n}): MessageResource {\n return {\n type: 'Message',\n id: data.sort_key,\n text: data.text,\n html: data.html,\n createdAt: data.created_at,\n deletedAt: data.deleted_at,\n textEditedAt: data.text_edited_at,\n mine: data.author_id === currentPersonId,\n attachments: deepCamelCaseKeys<DenormalizedAttachmentResource[]>(data.attachments) || [],\n author: {\n type: 'Person',\n id: data.author_id,\n name: data.author_name,\n avatar: data.author_avatar,\n },\n reactionCounts: [],\n replyCount: data.reply_count || 0,\n replyRootId: data.reply_root_id || null,\n idempotentKey: data.idempotent_key ?? null,\n messageType: data.message_type,\n personIdsForSystemEvent: data.system_event_person_ids,\n systemTextParts: data.system_text_parts\n ? {\n names: data.system_text_parts.names,\n overflowCount: data.system_text_parts.overflow_count,\n action: data.system_text_parts.action,\n }\n : null,\n systemTextFormat: data.system_text_format,\n }\n}\n"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,sBAAsB;AAExD,OAAO,SAASC,0CAA0CA,CAAC;EACzDC,IAAI;EACJC;AAIF,CAAC,EAAmB;EAClB,OAAO;IACLC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAEH,IAAI,CAACI,QAAQ;IACjBC,IAAI,EAAEL,IAAI,CAACK,IAAI;IACfC,IAAI,EAAEN,IAAI,CAACM,IAAI;IACfC,SAAS,EAAEP,IAAI,CAACQ,UAAU;IAC1BC,SAAS,EAAET,IAAI,CAACU,UAAU;IAC1BC,YAAY,EAAEX,IAAI,CAACY,cAAc;IACjCC,IAAI,EAAEb,IAAI,CAACc,SAAS,KAAKb,eAAe;IACxCc,WAAW,EAAEjB,iBAAiB,CAAmCE,IAAI,CAACe,WAAW,CAAC,IAAI,EAAE;IACxFC,MAAM,EAAE;MACNd,IAAI,EAAE,QAAQ;MACdC,EAAE,EAAEH,IAAI,CAACc,SAAS;MAClBG,IAAI,EAAEjB,IAAI,CAACkB,WAAW;MACtBC,MAAM,EAAEnB,IAAI,CAACoB;IACf,CAAC;IACDC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAEtB,IAAI,CAACuB,WAAW,IAAI,CAAC;IACjCC,WAAW,EAAExB,IAAI,CAACyB,aAAa,IAAI,IAAI;IACvCC,aAAa,EAAE1B,IAAI,CAAC2B,cAAc,IAAI,IAAI;IAC1CC,WAAW,EAAE5B,IAAI,CAAC6B,YAAY;IAC9BC,
|
|
1
|
+
{"version":3,"file":"transform_message_event_data_to_message_resource.js","names":["deepCamelCaseKeys","transformMessageEventDataToMessageResource","data","currentPersonId","type","id","sort_key","text","html","createdAt","created_at","deletedAt","deleted_at","textEditedAt","text_edited_at","mine","author_id","attachments","author","name","author_name","avatar","author_avatar","reactionCounts","replyCount","reply_count","replyRootId","reply_root_id","idempotentKey","idempotent_key","messageType","message_type","unsupportedMessageType","unsupported_message_type","fallbackContent","fallback_content","personIdsForSystemEvent","system_event_person_ids","systemTextParts","system_text_parts","names","overflowCount","overflow_count","action","systemTextFormat","system_text_format"],"sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"sourcesContent":["import { MessageResource } from '../../types'\nimport { MessageCreatedEvent } from '../../types/jolt_events/message_events'\nimport { DenormalizedAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport { deepCamelCaseKeys } from '../deepCamelCaseKeys'\n\nexport function transformMessageEventDataToMessageResource({\n data,\n currentPersonId,\n}: {\n data: MessageCreatedEvent['data']['data']\n currentPersonId: number\n}): MessageResource {\n return {\n type: 'Message',\n id: data.sort_key,\n text: data.text,\n html: data.html,\n createdAt: data.created_at,\n deletedAt: data.deleted_at,\n textEditedAt: data.text_edited_at,\n mine: data.author_id === currentPersonId,\n attachments: deepCamelCaseKeys<DenormalizedAttachmentResource[]>(data.attachments) || [],\n author: {\n type: 'Person',\n id: data.author_id,\n name: data.author_name,\n avatar: data.author_avatar,\n },\n reactionCounts: [],\n replyCount: data.reply_count || 0,\n replyRootId: data.reply_root_id || null,\n idempotentKey: data.idempotent_key ?? null,\n messageType: data.message_type,\n unsupportedMessageType: data.unsupported_message_type ?? null,\n fallbackContent: data.fallback_content ?? null,\n personIdsForSystemEvent: data.system_event_person_ids,\n systemTextParts: data.system_text_parts\n ? {\n names: data.system_text_parts.names,\n overflowCount: data.system_text_parts.overflow_count,\n action: data.system_text_parts.action,\n }\n : null,\n systemTextFormat: data.system_text_format,\n }\n}\n"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,sBAAsB;AAExD,OAAO,SAASC,0CAA0CA,CAAC;EACzDC,IAAI;EACJC;AAIF,CAAC,EAAmB;EAClB,OAAO;IACLC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAEH,IAAI,CAACI,QAAQ;IACjBC,IAAI,EAAEL,IAAI,CAACK,IAAI;IACfC,IAAI,EAAEN,IAAI,CAACM,IAAI;IACfC,SAAS,EAAEP,IAAI,CAACQ,UAAU;IAC1BC,SAAS,EAAET,IAAI,CAACU,UAAU;IAC1BC,YAAY,EAAEX,IAAI,CAACY,cAAc;IACjCC,IAAI,EAAEb,IAAI,CAACc,SAAS,KAAKb,eAAe;IACxCc,WAAW,EAAEjB,iBAAiB,CAAmCE,IAAI,CAACe,WAAW,CAAC,IAAI,EAAE;IACxFC,MAAM,EAAE;MACNd,IAAI,EAAE,QAAQ;MACdC,EAAE,EAAEH,IAAI,CAACc,SAAS;MAClBG,IAAI,EAAEjB,IAAI,CAACkB,WAAW;MACtBC,MAAM,EAAEnB,IAAI,CAACoB;IACf,CAAC;IACDC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAEtB,IAAI,CAACuB,WAAW,IAAI,CAAC;IACjCC,WAAW,EAAExB,IAAI,CAACyB,aAAa,IAAI,IAAI;IACvCC,aAAa,EAAE1B,IAAI,CAAC2B,cAAc,IAAI,IAAI;IAC1CC,WAAW,EAAE5B,IAAI,CAAC6B,YAAY;IAC9BC,sBAAsB,EAAE9B,IAAI,CAAC+B,wBAAwB,IAAI,IAAI;IAC7DC,eAAe,EAAEhC,IAAI,CAACiC,gBAAgB,IAAI,IAAI;IAC9CC,uBAAuB,EAAElC,IAAI,CAACmC,uBAAuB;IACrDC,eAAe,EAAEpC,IAAI,CAACqC,iBAAiB,GACnC;MACEC,KAAK,EAAEtC,IAAI,CAACqC,iBAAiB,CAACC,KAAK;MACnCC,aAAa,EAAEvC,IAAI,CAACqC,iBAAiB,CAACG,cAAc;MACpDC,MAAM,EAAEzC,IAAI,CAACqC,iBAAiB,CAACI;IACjC,CAAC,GACD,IAAI;IACRC,gBAAgB,EAAE1C,IAAI,CAAC2C;EACzB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MessageResource } from '../types/resources/message';
|
|
2
|
+
export declare const UNSUPPORTED_MESSAGE_TYPE = "unsupported";
|
|
3
|
+
export declare const SUPPORTED_MESSAGE_TYPES: readonly ["user", "user_joined", "conversation_archived", "conversation_unarchived"];
|
|
4
|
+
export declare function isUnsupportedMessage(message: Pick<MessageResource, 'messageType'>): boolean;
|
|
5
|
+
//# sourceMappingURL=message_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message_types.d.ts","sourceRoot":"","sources":["../../src/utils/message_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAKjE,eAAO,MAAM,wBAAwB,gBAAgB,CAAA;AAErD,eAAO,MAAM,uBAAuB,sFAK1B,CAAA;AAEV,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,GAAG,OAAO,CAO3F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// The server reports a type newer than this build's API version as 'unsupported'. Jolt payloads
|
|
2
|
+
// are not versioned, so a type this build has no code for can still arrive under its real name
|
|
3
|
+
// and gets the same treatment.
|
|
4
|
+
export const UNSUPPORTED_MESSAGE_TYPE = 'unsupported';
|
|
5
|
+
export const SUPPORTED_MESSAGE_TYPES = ['user', 'user_joined', 'conversation_archived', 'conversation_unarchived'];
|
|
6
|
+
export function isUnsupportedMessage(message) {
|
|
7
|
+
if (!message.messageType) return false;
|
|
8
|
+
return message.messageType === UNSUPPORTED_MESSAGE_TYPE || !SUPPORTED_MESSAGE_TYPES.includes(message.messageType);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=message_types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message_types.js","names":["UNSUPPORTED_MESSAGE_TYPE","SUPPORTED_MESSAGE_TYPES","isUnsupportedMessage","message","messageType","includes"],"sources":["../../src/utils/message_types.ts"],"sourcesContent":["import type { MessageResource } from '../types/resources/message'\n\n// The server reports a type newer than this build's API version as 'unsupported'. Jolt payloads\n// are not versioned, so a type this build has no code for can still arrive under its real name\n// and gets the same treatment.\nexport const UNSUPPORTED_MESSAGE_TYPE = 'unsupported'\n\nexport const SUPPORTED_MESSAGE_TYPES = [\n 'user',\n 'user_joined',\n 'conversation_archived',\n 'conversation_unarchived',\n] as const\n\nexport function isUnsupportedMessage(message: Pick<MessageResource, 'messageType'>): boolean {\n if (!message.messageType) return false\n\n return (\n message.messageType === UNSUPPORTED_MESSAGE_TYPE ||\n !(SUPPORTED_MESSAGE_TYPES as readonly string[]).includes(message.messageType)\n )\n}\n"],"mappings":"AAEA;AACA;AACA;AACA,OAAO,MAAMA,wBAAwB,GAAG,aAAa;AAErD,OAAO,MAAMC,uBAAuB,GAAG,CACrC,MAAM,EACN,aAAa,EACb,uBAAuB,EACvB,yBAAyB,CACjB;AAEV,OAAO,SAASC,oBAAoBA,CAACC,OAA6C,EAAW;EAC3F,IAAI,CAACA,OAAO,CAACC,WAAW,EAAE,OAAO,KAAK;EAEtC,OACED,OAAO,CAACC,WAAW,KAAKJ,wBAAwB,IAChD,CAAEC,uBAAuB,CAAuBI,QAAQ,CAACF,OAAO,CAACC,WAAW,CAAC;AAEjF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_data_options.d.ts","sourceRoot":"","sources":["../../../src/utils/request/messages_data_options.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;
|
|
1
|
+
{"version":3,"file":"messages_data_options.d.ts","sourceRoot":"","sources":["../../../src/utils/request/messages_data_options.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;CAqB5B,CAAA;AAED,eAAO,MAAM,kBAAkB,UAAmE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const getMessageFields = {
|
|
2
|
-
Message: ['text', 'text_edited_at', 'mine', 'attachments', 'created_at', 'deleted_at', 'author', 'reaction_counts', 'reply_count', 'reply_root', 'idempotent_key', 'message_type', 'person_ids_for_system_event', 'system_text_parts', 'system_text_format'],
|
|
2
|
+
Message: ['text', 'text_edited_at', 'mine', 'attachments', 'created_at', 'deleted_at', 'author', 'reaction_counts', 'reply_count', 'reply_root', 'idempotent_key', 'message_type', 'fallback_content', 'person_ids_for_system_event', 'system_text_parts', 'system_text_format'],
|
|
3
3
|
Person: ['name', 'avatar'],
|
|
4
4
|
ReactionCount: ['value', 'count', 'mine', 'message_id', 'author_ids']
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_data_options.js","names":["getMessageFields","Message","Person","ReactionCount","getMessagesInclude"],"sources":["../../../src/utils/request/messages_data_options.ts"],"sourcesContent":["export const getMessageFields = {\n Message: [\n 'text',\n 'text_edited_at',\n 'mine',\n 'attachments',\n 'created_at',\n 'deleted_at',\n 'author',\n 'reaction_counts',\n 'reply_count',\n 'reply_root',\n 'idempotent_key',\n 'message_type',\n 'person_ids_for_system_event',\n 'system_text_parts',\n 'system_text_format',\n ],\n Person: ['name', 'avatar'],\n ReactionCount: ['value', 'count', 'mine', 'message_id', 'author_ids'],\n}\n\nexport const getMessagesInclude = ['author', 'reaction_counts', 'reply_root', 'reply_root.author']\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,OAAO,EAAE,CACP,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,6BAA6B,EAC7B,mBAAmB,EACnB,oBAAoB,CACrB;EACDC,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;EAC1BC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY;AACtE,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,mBAAmB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"messages_data_options.js","names":["getMessageFields","Message","Person","ReactionCount","getMessagesInclude"],"sources":["../../../src/utils/request/messages_data_options.ts"],"sourcesContent":["export const getMessageFields = {\n Message: [\n 'text',\n 'text_edited_at',\n 'mine',\n 'attachments',\n 'created_at',\n 'deleted_at',\n 'author',\n 'reaction_counts',\n 'reply_count',\n 'reply_root',\n 'idempotent_key',\n 'message_type',\n 'fallback_content',\n 'person_ids_for_system_event',\n 'system_text_parts',\n 'system_text_format',\n ],\n Person: ['name', 'avatar'],\n ReactionCount: ['value', 'count', 'mine', 'message_id', 'author_ids'],\n}\n\nexport const getMessagesInclude = ['author', 'reaction_counts', 'reply_root', 'reply_root.author']\n"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC9BC,OAAO,EAAE,CACP,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,6BAA6B,EAC7B,mBAAmB,EACnB,oBAAoB,CACrB;EACDC,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;EAC1BC,aAAa,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY;AACtE,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,YAAY,EAAE,mBAAmB,CAAC","ignoreList":[]}
|
package/build/utils/session.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OAuthToken, OrganizationResource, PersonResource } from '../types';
|
|
2
|
-
export type ENV = 'production' | 'staging' | 'development';
|
|
2
|
+
export type ENV = 'production' | 'staging' | 'development' | 'prototype';
|
|
3
3
|
export type OauthType = 'OAuth' | 'ChurchCenterOauth';
|
|
4
4
|
export type PartialToken = Pick<OAuthToken, 'access_token'> & Partial<OAuthToken>;
|
|
5
5
|
export type SessionMeta = {
|
|
@@ -10,6 +10,7 @@ export type SessionMeta = {
|
|
|
10
10
|
};
|
|
11
11
|
export type SessionProps<T extends PartialToken> = {
|
|
12
12
|
env?: ENV;
|
|
13
|
+
prototypeName?: string;
|
|
13
14
|
token?: T;
|
|
14
15
|
type?: OauthType;
|
|
15
16
|
meta?: SessionMeta;
|
|
@@ -22,6 +23,7 @@ type SessionId = string | typeof UNAUTHENTICATED_SESSION_ID;
|
|
|
22
23
|
*/
|
|
23
24
|
export declare class Session<T extends PartialToken = PartialToken> {
|
|
24
25
|
env: ENV;
|
|
26
|
+
prototypeName: string | undefined;
|
|
25
27
|
token: T | undefined;
|
|
26
28
|
type: OauthType;
|
|
27
29
|
meta: Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE3E,MAAM,MAAM,GAAG,GAAG,YAAY,GAAG,SAAS,GAAG,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],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Q;IAUR,SAAS,CAAC,MAAM,EAAE,cAAc;IAIhC,eAAe,CAAC,YAAY,EAAE,oBAAoB;IAIlD,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,aAAa,EAAE,MAAM;CAQ7D"}
|
package/build/utils/session.js
CHANGED
|
@@ -7,11 +7,13 @@ export class Session {
|
|
|
7
7
|
constructor(props) {
|
|
8
8
|
const {
|
|
9
9
|
env = 'production',
|
|
10
|
+
prototypeName,
|
|
10
11
|
token,
|
|
11
12
|
type,
|
|
12
13
|
meta
|
|
13
14
|
} = props || {};
|
|
14
15
|
this.env = env;
|
|
16
|
+
this.prototypeName = env === 'prototype' ? prototypeName : undefined;
|
|
15
17
|
this.token = token;
|
|
16
18
|
this.type = type || 'OAuth';
|
|
17
19
|
this.meta = meta || {};
|
|
@@ -32,6 +34,7 @@ export class Session {
|
|
|
32
34
|
toString() {
|
|
33
35
|
return JSON.stringify({
|
|
34
36
|
env: this.env,
|
|
37
|
+
prototypeName: this.prototypeName,
|
|
35
38
|
token: this.token,
|
|
36
39
|
meta: this.meta
|
|
37
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","names":["UNAUTHENTICATED_SESSION_ID","Session","constructor","props","env","token","type","meta","isAuthenticated","Boolean","access_token","isChurchCenterToken","id","tokenStr","slice","toString","JSON","stringify","setPerson","person","setOrganization","organization","hydrate","sessionString","parse","_error"],"sources":["../../src/utils/session.ts"],"sourcesContent":["import { OAuthToken, OrganizationResource, PersonResource } from '../types'\n\nexport type ENV = 'production' | 'staging' | 'development'\nexport type OauthType = 'OAuth' | 'ChurchCenterOauth'\nexport type PartialToken = Pick<OAuthToken, 'access_token'> & Partial<OAuthToken>\nexport type SessionMeta = {\n [key: string]: {\n person: PersonResource\n organization: OrganizationResource\n }\n}\nexport type SessionProps<T extends PartialToken> = {\n env?: ENV\n token?: T\n type?: OauthType\n meta?: SessionMeta\n}\n\nexport const UNAUTHENTICATED_SESSION_ID = 'unauthenticated' as const\ntype SessionId = string | typeof UNAUTHENTICATED_SESSION_ID\n\n/**\n * Session class to track the environment and token\n * Not intended to make network requests or handle authentication\n */\nexport class Session<T extends PartialToken = PartialToken> {\n env: ENV\n token: T | undefined\n type: OauthType\n meta: Record<string, any>\n\n constructor(props?: SessionProps<T>) {\n const { env = 'production', token, type, meta } = props || {}\n this.env = env\n this.token = token\n this.type = type || 'OAuth'\n this.meta = meta || {}\n }\n\n get isAuthenticated() {\n return Boolean(this.token?.access_token)\n }\n\n get isChurchCenterToken() {\n return this.type === 'ChurchCenterOauth'\n }\n\n get id(): SessionId {\n if (!this.isAuthenticated || !this.token?.access_token) {\n return UNAUTHENTICATED_SESSION_ID\n }\n const tokenStr = this.token.access_token\n return tokenStr.slice(-8)\n }\n\n toString() {\n return JSON.stringify({
|
|
1
|
+
{"version":3,"file":"session.js","names":["UNAUTHENTICATED_SESSION_ID","Session","constructor","props","env","prototypeName","token","type","meta","undefined","isAuthenticated","Boolean","access_token","isChurchCenterToken","id","tokenStr","slice","toString","JSON","stringify","setPerson","person","setOrganization","organization","hydrate","sessionString","parse","_error"],"sources":["../../src/utils/session.ts"],"sourcesContent":["import { OAuthToken, OrganizationResource, PersonResource } from '../types'\n\nexport type ENV = 'production' | 'staging' | 'development' | 'prototype'\nexport type OauthType = 'OAuth' | 'ChurchCenterOauth'\nexport type PartialToken = Pick<OAuthToken, 'access_token'> & Partial<OAuthToken>\nexport type SessionMeta = {\n [key: string]: {\n person: PersonResource\n organization: OrganizationResource\n }\n}\nexport type SessionProps<T extends PartialToken> = {\n env?: ENV\n prototypeName?: string\n token?: T\n type?: OauthType\n meta?: SessionMeta\n}\n\nexport const UNAUTHENTICATED_SESSION_ID = 'unauthenticated' as const\ntype SessionId = string | typeof UNAUTHENTICATED_SESSION_ID\n\n/**\n * Session class to track the environment and token\n * Not intended to make network requests or handle authentication\n */\nexport class Session<T extends PartialToken = PartialToken> {\n env: ENV\n prototypeName: string | undefined\n token: T | undefined\n type: OauthType\n meta: Record<string, any>\n\n constructor(props?: SessionProps<T>) {\n const { env = 'production', prototypeName, token, type, meta } = props || {}\n this.env = env\n this.prototypeName = env === 'prototype' ? prototypeName : undefined\n this.token = token\n this.type = type || 'OAuth'\n this.meta = meta || {}\n }\n\n get isAuthenticated() {\n return Boolean(this.token?.access_token)\n }\n\n get isChurchCenterToken() {\n return this.type === 'ChurchCenterOauth'\n }\n\n get id(): SessionId {\n if (!this.isAuthenticated || !this.token?.access_token) {\n return UNAUTHENTICATED_SESSION_ID\n }\n const tokenStr = this.token.access_token\n return tokenStr.slice(-8)\n }\n\n toString() {\n return JSON.stringify({\n env: this.env,\n prototypeName: this.prototypeName,\n token: this.token,\n meta: this.meta,\n })\n }\n\n // Convenience methods to set the person and organization\n setPerson(person: PersonResource) {\n this.meta.person = person\n }\n\n setOrganization(organization: OrganizationResource) {\n this.meta.organization = organization\n }\n\n static hydrate<T extends PartialToken>(sessionString: string) {\n try {\n const props = JSON.parse(sessionString)\n return new Session<T>(props)\n } catch (_error) {\n return new Session<T>()\n }\n }\n}\n"],"mappings":"AAmBA,OAAO,MAAMA,0BAA0B,GAAG,iBAA0B;AAGpE;AACA;AACA;AACA;AACA,OAAO,MAAMC,OAAO,CAAwC;EAO1DC,WAAWA,CAACC,KAAuB,EAAE;IACnC,MAAM;MAAEC,GAAG,GAAG,YAAY;MAAEC,aAAa;MAAEC,KAAK;MAAEC,IAAI;MAAEC;IAAK,CAAC,GAAGL,KAAK,IAAI,CAAC,CAAC;IAC5E,IAAI,CAACC,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,aAAa,GAAGD,GAAG,KAAK,WAAW,GAAGC,aAAa,GAAGI,SAAS;IACpE,IAAI,CAACH,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,OAAO;IAC3B,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,CAAC,CAAC;EACxB;EAEA,IAAIE,eAAeA,CAAA,EAAG;IACpB,OAAOC,OAAO,CAAC,IAAI,CAACL,KAAK,EAAEM,YAAY,CAAC;EAC1C;EAEA,IAAIC,mBAAmBA,CAAA,EAAG;IACxB,OAAO,IAAI,CAACN,IAAI,KAAK,mBAAmB;EAC1C;EAEA,IAAIO,EAAEA,CAAA,EAAc;IAClB,IAAI,CAAC,IAAI,CAACJ,eAAe,IAAI,CAAC,IAAI,CAACJ,KAAK,EAAEM,YAAY,EAAE;MACtD,OAAOZ,0BAA0B;IACnC;IACA,MAAMe,QAAQ,GAAG,IAAI,CAACT,KAAK,CAACM,YAAY;IACxC,OAAOG,QAAQ,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAC3B;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAOC,IAAI,CAACC,SAAS,CAAC;MACpBf,GAAG,EAAE,IAAI,CAACA,GAAG;MACbC,aAAa,EAAE,IAAI,CAACA,aAAa;MACjCC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBE,IAAI,EAAE,IAAI,CAACA;IACb,CAAC,CAAC;EACJ;;EAEA;EACAY,SAASA,CAACC,MAAsB,EAAE;IAChC,IAAI,CAACb,IAAI,CAACa,MAAM,GAAGA,MAAM;EAC3B;EAEAC,eAAeA,CAACC,YAAkC,EAAE;IAClD,IAAI,CAACf,IAAI,CAACe,YAAY,GAAGA,YAAY;EACvC;EAEA,OAAOC,OAAOA,CAAyBC,aAAqB,EAAE;IAC5D,IAAI;MACF,MAAMtB,KAAK,GAAGe,IAAI,CAACQ,KAAK,CAACD,aAAa,CAAC;MACvC,OAAO,IAAIxB,OAAO,CAAIE,KAAK,CAAC;IAC9B,CAAC,CAAC,OAAOwB,MAAM,EAAE;MACf,OAAO,IAAI1B,OAAO,CAAI,CAAC;IACzB;EACF;AACF","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ export declare class SessionManager {
|
|
|
10
10
|
constructor(props?: SessionManagerProps);
|
|
11
11
|
static hydrate(sessionManagerString: string): SessionManager;
|
|
12
12
|
get currentSession(): Session<OAuthToken>;
|
|
13
|
-
setEnv(env: ENV): void;
|
|
13
|
+
setEnv(env: ENV, prototypeName?: string): void;
|
|
14
14
|
toString(): string;
|
|
15
15
|
removeSession(sessionId: string): void;
|
|
16
16
|
switchSession(sessionId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_manager.d.ts","sourceRoot":"","sources":["../../src/utils/session_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,GAAG,EAAE,OAAO,EAA8B,MAAM,WAAW,CAAA;AAEpE,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,qBAAa,cAAc;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,gBAAgB,EAAE,MAAM,CAAA;gBAEZ,KAAK,CAAC,EAAE,mBAAmB;IAMvC,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM;IAS3C,IAAI,cAAc,wBAIjB;IAED,MAAM,CAAC,GAAG,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"session_manager.d.ts","sourceRoot":"","sources":["../../src/utils/session_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,GAAG,EAAE,OAAO,EAA8B,MAAM,WAAW,CAAA;AAEpE,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,qBAAa,cAAc;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,gBAAgB,EAAE,MAAM,CAAA;gBAEZ,KAAK,CAAC,EAAE,mBAAmB;IAMvC,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM;IAS3C,IAAI,cAAc,wBAIjB;IAED,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,MAAM;IASvC,QAAQ;IAIR,aAAa,CAAC,SAAS,EAAE,MAAM;IAQ/B,aAAa,CAAC,SAAS,EAAE,MAAM;IAQ/B,aAAa,CAAC,OAAO,EAAE,OAAO;IAK9B,kBAAkB,CAAC,KAAK,EAAE,UAAU;CAMrC"}
|
|
@@ -20,10 +20,11 @@ export class SessionManager {
|
|
|
20
20
|
get currentSession() {
|
|
21
21
|
return Session.hydrate(this.sessions[this.currentSessionId] || new Session({}).toString());
|
|
22
22
|
}
|
|
23
|
-
setEnv(env) {
|
|
23
|
+
setEnv(env, prototypeName) {
|
|
24
24
|
// Get the current session (handles case where it doesn't exist)
|
|
25
25
|
const session = this.currentSession;
|
|
26
26
|
session.env = env;
|
|
27
|
+
session.prototypeName = prototypeName;
|
|
27
28
|
// Store the session with its ID
|
|
28
29
|
this.upsertSession(session);
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_manager.js","names":["omit","Session","UNAUTHENTICATED_SESSION_ID","SessionManager","constructor","props","sessions","currentSessionId","hydrate","sessionManagerString","JSON","parse","_error","currentSession","toString","setEnv","env","session","upsertSession","stringify","removeSession","sessionId","switchSession","sessionPresent","Error","id","updateCurrentToken","token"],"sources":["../../src/utils/session_manager.ts"],"sourcesContent":["import { omit } from 'lodash'\nimport { OAuthToken } from '../types'\nimport { ENV, Session, UNAUTHENTICATED_SESSION_ID } from './session'\n\ntype SessionManagerProps = {\n sessions?: Record<string, string>\n currentSessionId?: string\n}\n\nexport class SessionManager {\n sessions: Record<string, string>\n currentSessionId: string\n\n constructor(props?: SessionManagerProps) {\n const { sessions, currentSessionId } = props || {}\n this.sessions = sessions || {}\n this.currentSessionId = currentSessionId || UNAUTHENTICATED_SESSION_ID\n }\n\n static hydrate(sessionManagerString: string) {\n try {\n const props = JSON.parse(sessionManagerString)\n return new SessionManager(props)\n } catch (_error) {\n return new SessionManager()\n }\n }\n\n get currentSession() {\n return Session.hydrate<OAuthToken>(\n this.sessions[this.currentSessionId] || new Session<OAuthToken>({}).toString()\n )\n }\n\n setEnv(env: ENV) {\n // Get the current session (handles case where it doesn't exist)\n const session = this.currentSession\n session.env = env\n // Store the session with its ID\n this.upsertSession(session)\n }\n\n toString() {\n return JSON.stringify({ sessions: this.sessions, currentSessionId: this.currentSessionId })\n }\n\n removeSession(sessionId: string) {\n // if unauthenticated, this is a no-op\n this.sessions = omit(this.sessions, sessionId)\n if (this.currentSessionId === sessionId) {\n this.currentSessionId = UNAUTHENTICATED_SESSION_ID\n }\n }\n\n switchSession(sessionId: string) {\n const sessionPresent = this.sessions[sessionId]\n if (!sessionPresent) {\n throw new Error(`Session ${sessionId} not found`)\n }\n this.currentSessionId = sessionId\n }\n\n upsertSession(session: Session) {\n this.sessions[session.id] = session.toString()\n this.currentSessionId = session.id\n }\n\n updateCurrentToken(token: OAuthToken) {\n const session = this.currentSession\n this.removeSession(session.id)\n session.token = token\n this.upsertSession(session)\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,QAAQ;AAE7B,SAAcC,OAAO,EAAEC,0BAA0B,QAAQ,WAAW;AAOpE,OAAO,MAAMC,cAAc,CAAC;EAI1BC,WAAWA,CAACC,KAA2B,EAAE;IACvC,MAAM;MAAEC,QAAQ;MAAEC;IAAiB,CAAC,GAAGF,KAAK,IAAI,CAAC,CAAC;IAClD,IAAI,CAACC,QAAQ,GAAGA,QAAQ,IAAI,CAAC,CAAC;IAC9B,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB,IAAIL,0BAA0B;EACxE;EAEA,OAAOM,OAAOA,CAACC,oBAA4B,EAAE;IAC3C,IAAI;MACF,MAAMJ,KAAK,GAAGK,IAAI,CAACC,KAAK,CAACF,oBAAoB,CAAC;MAC9C,OAAO,IAAIN,cAAc,CAACE,KAAK,CAAC;IAClC,CAAC,CAAC,OAAOO,MAAM,EAAE;MACf,OAAO,IAAIT,cAAc,CAAC,CAAC;IAC7B;EACF;EAEA,IAAIU,cAAcA,CAAA,EAAG;IACnB,OAAOZ,OAAO,CAACO,OAAO,CACpB,IAAI,CAACF,QAAQ,CAAC,IAAI,CAACC,gBAAgB,CAAC,IAAI,IAAIN,OAAO,CAAa,CAAC,CAAC,CAAC,CAACa,QAAQ,CAAC,CAC/E,CAAC;EACH;EAEAC,MAAMA,CAACC,GAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"session_manager.js","names":["omit","Session","UNAUTHENTICATED_SESSION_ID","SessionManager","constructor","props","sessions","currentSessionId","hydrate","sessionManagerString","JSON","parse","_error","currentSession","toString","setEnv","env","prototypeName","session","upsertSession","stringify","removeSession","sessionId","switchSession","sessionPresent","Error","id","updateCurrentToken","token"],"sources":["../../src/utils/session_manager.ts"],"sourcesContent":["import { omit } from 'lodash'\nimport { OAuthToken } from '../types'\nimport { ENV, Session, UNAUTHENTICATED_SESSION_ID } from './session'\n\ntype SessionManagerProps = {\n sessions?: Record<string, string>\n currentSessionId?: string\n}\n\nexport class SessionManager {\n sessions: Record<string, string>\n currentSessionId: string\n\n constructor(props?: SessionManagerProps) {\n const { sessions, currentSessionId } = props || {}\n this.sessions = sessions || {}\n this.currentSessionId = currentSessionId || UNAUTHENTICATED_SESSION_ID\n }\n\n static hydrate(sessionManagerString: string) {\n try {\n const props = JSON.parse(sessionManagerString)\n return new SessionManager(props)\n } catch (_error) {\n return new SessionManager()\n }\n }\n\n get currentSession() {\n return Session.hydrate<OAuthToken>(\n this.sessions[this.currentSessionId] || new Session<OAuthToken>({}).toString()\n )\n }\n\n setEnv(env: ENV, prototypeName?: string) {\n // Get the current session (handles case where it doesn't exist)\n const session = this.currentSession\n session.env = env\n session.prototypeName = prototypeName\n // Store the session with its ID\n this.upsertSession(session)\n }\n\n toString() {\n return JSON.stringify({ sessions: this.sessions, currentSessionId: this.currentSessionId })\n }\n\n removeSession(sessionId: string) {\n // if unauthenticated, this is a no-op\n this.sessions = omit(this.sessions, sessionId)\n if (this.currentSessionId === sessionId) {\n this.currentSessionId = UNAUTHENTICATED_SESSION_ID\n }\n }\n\n switchSession(sessionId: string) {\n const sessionPresent = this.sessions[sessionId]\n if (!sessionPresent) {\n throw new Error(`Session ${sessionId} not found`)\n }\n this.currentSessionId = sessionId\n }\n\n upsertSession(session: Session) {\n this.sessions[session.id] = session.toString()\n this.currentSessionId = session.id\n }\n\n updateCurrentToken(token: OAuthToken) {\n const session = this.currentSession\n this.removeSession(session.id)\n session.token = token\n this.upsertSession(session)\n }\n}\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,QAAQ;AAE7B,SAAcC,OAAO,EAAEC,0BAA0B,QAAQ,WAAW;AAOpE,OAAO,MAAMC,cAAc,CAAC;EAI1BC,WAAWA,CAACC,KAA2B,EAAE;IACvC,MAAM;MAAEC,QAAQ;MAAEC;IAAiB,CAAC,GAAGF,KAAK,IAAI,CAAC,CAAC;IAClD,IAAI,CAACC,QAAQ,GAAGA,QAAQ,IAAI,CAAC,CAAC;IAC9B,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB,IAAIL,0BAA0B;EACxE;EAEA,OAAOM,OAAOA,CAACC,oBAA4B,EAAE;IAC3C,IAAI;MACF,MAAMJ,KAAK,GAAGK,IAAI,CAACC,KAAK,CAACF,oBAAoB,CAAC;MAC9C,OAAO,IAAIN,cAAc,CAACE,KAAK,CAAC;IAClC,CAAC,CAAC,OAAOO,MAAM,EAAE;MACf,OAAO,IAAIT,cAAc,CAAC,CAAC;IAC7B;EACF;EAEA,IAAIU,cAAcA,CAAA,EAAG;IACnB,OAAOZ,OAAO,CAACO,OAAO,CACpB,IAAI,CAACF,QAAQ,CAAC,IAAI,CAACC,gBAAgB,CAAC,IAAI,IAAIN,OAAO,CAAa,CAAC,CAAC,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;IAC9BR,OAAO,CAACU,KAAK,GAAGA,KAAK;IACrB,IAAI,CAACT,aAAa,CAACD,OAAO,CAAC;EAC7B;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload_uri.d.ts","sourceRoot":"","sources":["../../src/utils/upload_uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;gBAEA,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;IAI7C,IAAI,MAAM,WAET;IAED,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"upload_uri.d.ts","sourceRoot":"","sources":["../../src/utils/upload_uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;gBAEA,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE;IAI7C,IAAI,MAAM,WAET;IAED,IAAI,IAAI,WAMP;IAED,IAAI,SAAS,gCAOZ;IAED,IAAI,MAAM,IAAI,KAAK,GAAG,sBAAsB,CAE3C;IAED,IAAI,GAAG,mBAON;IAED,IAAI,GAAG,4BAEN;IAED,IAAI,OAAO,WAEV;IAED,IAAI,OAAO;;;;MAMV;CACF"}
|
|
@@ -19,6 +19,9 @@ export class UploadUri {
|
|
|
19
19
|
return 'https';
|
|
20
20
|
}
|
|
21
21
|
get host() {
|
|
22
|
+
if (this.env === 'prototype') {
|
|
23
|
+
return `${this.session.prototypeName}.upload.planningcenter.ninja`;
|
|
24
|
+
}
|
|
22
25
|
return `${this.subdomain}.${this.domain}.${this.tld}`;
|
|
23
26
|
}
|
|
24
27
|
get subdomain() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload_uri.js","names":["DeviceInfo","brand","getBrand","model","getModel","systemName","getSystemName","systemVersion","getSystemVersion","readableVersion","getReadableVersion","appName","getApplicationName","UploadUri","constructor","session","schema","host","subdomain","domain","tld","
|
|
1
|
+
{"version":3,"file":"upload_uri.js","names":["DeviceInfo","brand","getBrand","model","getModel","systemName","getSystemName","systemVersion","getSystemVersion","readableVersion","getReadableVersion","appName","getApplicationName","UploadUri","constructor","session","schema","host","env","prototypeName","subdomain","domain","tld","baseUrl","headers","Authorization","token","access_token"],"sources":["../../src/utils/upload_uri.ts"],"sourcesContent":["import DeviceInfo from 'react-native-device-info'\nimport { Session } from './session'\nconst brand = DeviceInfo.getBrand()\nconst model = DeviceInfo.getModel()\nconst systemName = DeviceInfo.getSystemName()\nconst systemVersion = DeviceInfo.getSystemVersion()\nconst readableVersion = DeviceInfo.getReadableVersion()\nconst appName = DeviceInfo.getApplicationName()\n\n/**\n * This is for accessing https://github.com/planningcenter/upload\n */\nexport class UploadUri {\n session: Session\n app?: string\n\n constructor({ session }: { session: Session }) {\n this.session = session\n }\n\n get schema() {\n return 'https'\n }\n\n get host() {\n if (this.env === 'prototype') {\n return `${this.session.prototypeName}.upload.planningcenter.ninja`\n }\n\n return `${this.subdomain}.${this.domain}.${this.tld}`\n }\n\n get subdomain() {\n switch (this.env) {\n case 'staging':\n return 'upload-staging'\n default:\n return 'upload'\n }\n }\n\n get domain(): 'pco' | 'planningcenteronline' {\n return this.env === 'development' ? 'pco' : 'planningcenteronline'\n }\n\n get tld() {\n switch (this.env) {\n case 'development':\n return 'test'\n default:\n return 'com'\n }\n }\n\n get env() {\n return this.session?.env || 'production'\n }\n\n get baseUrl() {\n return `${this.schema}://${this.host}`\n }\n\n get headers() {\n return {\n 'User-Agent': `${appName}/${readableVersion} (${brand}, ${model}, ${systemName}, ${systemVersion})`,\n Authorization: `Bearer ${this.session.token?.access_token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AAK;IAChB;EACF;EAEA,IAAIA,GAAGA,CAAA,EAAG;IACR,OAAO,IAAI,CAACH,OAAO,EAAEG,GAAG,IAAI,YAAY;EAC1C;EAEA,IAAIK,OAAOA,CAAA,EAAG;IACZ,OAAO,GAAG,IAAI,CAACP,MAAM,MAAM,IAAI,CAACC,IAAI,EAAE;EACxC;EAEA,IAAIO,OAAOA,CAAA,EAAG;IACZ,OAAO;MACL,YAAY,EAAE,GAAGb,OAAO,IAAIF,eAAe,KAAKR,KAAK,KAAKE,KAAK,KAAKE,UAAU,KAAKE,aAAa,GAAG;MACnGkB,aAAa,EAAE,UAAU,IAAI,CAACV,OAAO,CAACW,KAAK,EAAEC,YAAY,EAAE;MAC3D,sBAAsB,EAAE;IAC1B,CAAC;EACH;AACF","ignoreList":[]}
|
package/build/utils/uri.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["../../src/utils/uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,KAAK,KAAK,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAC9C,qBAAa,GAAG;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,KAAK,CAAmB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;gBAEA,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE;IAMtF,IAAI,MAAM,WAET;IAED,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["../../src/utils/uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAQnC,KAAK,KAAK,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAC9C,qBAAa,GAAG;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,KAAK,CAAmB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAA;gBAEA,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE;IAMtF,IAAI,MAAM,WAET;IAED,IAAI,IAAI,WAOP;IAED,IAAI,SAAS,0CAOZ;IAED,IAAI,MAAM,IAAI,KAAK,GAAG,sBAAsB,GAAG,cAAc,CAM5D;IAED,IAAI,GAAG,mBAON;IAED,IAAI,cAAc,YAEjB;IAED,IAAI,GAAG,4BAEN;IAED,IAAI,OAAO,WAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO;;;MAKV;IAED,MAAM,GAAI,MAAM,MAAM,YAIrB;IAED,GAAG,GAAI,MAAM,MAAM,YAIlB;CACF"}
|
package/build/utils/uri.js
CHANGED
|
@@ -20,6 +20,10 @@ export class Uri {
|
|
|
20
20
|
return 'https';
|
|
21
21
|
}
|
|
22
22
|
get host() {
|
|
23
|
+
if (this.env === 'prototype') {
|
|
24
|
+
const graphDomain = this.isChurchCenter ? 'churchcenter' : 'planningcenter';
|
|
25
|
+
return `${this.session.prototypeName}.api.${graphDomain}.ninja`;
|
|
26
|
+
}
|
|
23
27
|
return `${this.subdomain}.${this.domain}.${this.tld}`;
|
|
24
28
|
}
|
|
25
29
|
get subdomain() {
|
package/build/utils/uri.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uri.js","names":["DeviceInfo","brand","getBrand","model","getModel","systemName","getSystemName","systemVersion","getSystemVersion","readableVersion","getReadableVersion","appName","getApplicationName","Uri","graph","constructor","session","app","schema","host","
|
|
1
|
+
{"version":3,"file":"uri.js","names":["DeviceInfo","brand","getBrand","model","getModel","systemName","getSystemName","systemVersion","getSystemVersion","readableVersion","getReadableVersion","appName","getApplicationName","Uri","graph","constructor","session","app","schema","host","env","graphDomain","isChurchCenter","prototypeName","subdomain","domain","tld","isChurchCenterToken","baseUrl","directory","headers","Authorization","token","access_token","appUrl","path","startsWith","api"],"sources":["../../src/utils/uri.ts"],"sourcesContent":["import DeviceInfo from 'react-native-device-info'\nimport { Session } from './session'\nconst brand = DeviceInfo.getBrand()\nconst model = DeviceInfo.getModel()\nconst systemName = DeviceInfo.getSystemName()\nconst systemVersion = DeviceInfo.getSystemVersion()\nconst readableVersion = DeviceInfo.getReadableVersion()\nconst appName = DeviceInfo.getApplicationName()\n\ntype Graph = 'churchcenter' | 'planningcenter'\nexport class Uri {\n session: Session\n graph: Graph = 'planningcenter'\n app?: string\n\n constructor({ session, app, graph }: { session: Session; app?: string; graph?: Graph }) {\n this.session = session\n this.app = app\n this.graph = graph || 'planningcenter'\n }\n\n get schema() {\n return 'https'\n }\n\n get host() {\n if (this.env === 'prototype') {\n const graphDomain = this.isChurchCenter ? 'churchcenter' : 'planningcenter'\n return `${this.session.prototypeName}.api.${graphDomain}.ninja`\n }\n\n return `${this.subdomain}.${this.domain}.${this.tld}`\n }\n\n get subdomain() {\n switch (this.env) {\n case 'staging':\n return this.isChurchCenter ? 'api.staging' : 'api-staging'\n default:\n return 'api'\n }\n }\n\n get domain(): 'pco' | 'planningcenteronline' | 'churchcenter' {\n if (this.isChurchCenter) {\n return 'churchcenter'\n }\n\n return this.env === 'development' ? 'pco' : 'planningcenteronline'\n }\n\n get tld() {\n switch (this.env) {\n case 'development':\n return 'test'\n default:\n return 'com'\n }\n }\n\n get isChurchCenter() {\n return this.session.isChurchCenterToken\n }\n\n get env() {\n return this.session?.env || 'production'\n }\n\n get baseUrl() {\n return `${this.schema}://${this.host}`\n }\n\n get directory() {\n return this.app ? `/${this.app}/v2` : ''\n }\n\n get headers() {\n return {\n 'User-Agent': `${appName}/${readableVersion} (${brand}, ${model}, ${systemName}, ${systemVersion})`,\n Authorization: `Bearer ${this.session.token?.access_token}`,\n }\n }\n\n appUrl = (path: string) => {\n if (path.startsWith(`${this.schema}://`)) return path\n\n return `${this.baseUrl}${this.directory}${path || '/'}`\n }\n\n api = (path: string) => {\n if (path.startsWith(`${this.schema}://`)) return path\n\n return `${this.baseUrl}${path || '/'}`\n }\n}\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,0BAA0B;AAEjD,MAAMC,KAAK,GAAGD,UAAU,CAACE,QAAQ,CAAC,CAAC;AACnC,MAAMC,KAAK,GAAGH,UAAU,CAACI,QAAQ,CAAC,CAAC;AACnC,MAAMC,UAAU,GAAGL,UAAU,CAACM,aAAa,CAAC,CAAC;AAC7C,MAAMC,aAAa,GAAGP,UAAU,CAACQ,gBAAgB,CAAC,CAAC;AACnD,MAAMC,eAAe,GAAGT,UAAU,CAACU,kBAAkB,CAAC,CAAC;AACvD,MAAMC,OAAO,GAAGX,UAAU,CAACY,kBAAkB,CAAC,CAAC;AAG/C,OAAO,MAAMC,GAAG,CAAC;EAEfC,KAAK,GAAU,gBAAgB;EAG/BC,WAAWA,CAAC;IAAEC,OAAO;IAAEC,GAAG;IAAEH;EAAyD,CAAC,EAAE;IACtF,IAAI,CAACE,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,GAAG,GAAGA,GAAG;IACd,IAAI,CAACH,KAAK,GAAGA,KAAK,IAAI,gBAAgB;EACxC;EAEA,IAAII,MAAMA,CAAA,EAAG;IACX,OAAO,OAAO;EAChB;EAEA,IAAIC,IAAIA,CAAA,EAAG;IACT,IAAI,IAAI,CAACC,GAAG,KAAK,WAAW,EAAE;MAC5B,MAAMC,WAAW,GAAG,IAAI,CAACC,cAAc,GAAG,cAAc,GAAG,gBAAgB;MAC3E,OAAO,GAAG,IAAI,CAACN,OAAO,CAACO,aAAa,QAAQF,WAAW,QAAQ;IACjE;IAEA,OAAO,GAAG,IAAI,CAACG,SAAS,IAAI,IAAI,CAACC,MAAM,IAAI,IAAI,CAACC,GAAG,EA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OiB,IAAI;IAErD,OAAO,GAAG,IAAI,CAACP,OAAO,GAAG,IAAI,CAACC,SAAS,GAAGM,IAAI,IAAI,GAAG,EAAE;EACzD,CAAC;EAEDE,GAAG,GAAIF,IAAY,IAAK;IACtB,IAAIA,IAAI,CAACC,UAAU,CAAC,GAAG,IAAI,CAAClB,MAAM,KAAK,CAAC,EAAE,OAAOiB,IAAI;IAErD,OAAO,GAAG,IAAI,CAACP,OAAO,GAAGO,IAAI,IAAI,GAAG,EAAE;EACxC,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0-rc.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"sf-symbols-typescript": "^2.2.0",
|
|
85
85
|
"typescript": "~6.0.3"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "84ac1257e5c11783165de5670a87ef984bdbd961"
|
|
88
88
|
}
|
|
@@ -90,7 +90,7 @@ const buildMessage = (n: number, overrides: Partial<MessageResource> = {}): Mess
|
|
|
90
90
|
reactionCounts: [],
|
|
91
91
|
replyCount: 0,
|
|
92
92
|
replyRootId: null,
|
|
93
|
-
messageType: '
|
|
93
|
+
messageType: 'user',
|
|
94
94
|
...overrides,
|
|
95
95
|
}
|
|
96
96
|
idByCreatedAt.set(message.createdAt, message.id)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import type { MessageResource } from '../../../types/resources/message'
|
|
4
|
+
import type { PersonResource } from '../../../types/resources/person'
|
|
5
|
+
import {
|
|
6
|
+
UNSUPPORTED_MESSAGE_FALLBACK,
|
|
7
|
+
UNSUPPORTED_MESSAGE_HINT,
|
|
8
|
+
UnsupportedMessage,
|
|
9
|
+
} from '../unsupported_message'
|
|
10
|
+
|
|
11
|
+
const author = { id: 1, type: 'Person', name: 'Wes', avatar: null } as unknown as PersonResource
|
|
12
|
+
|
|
13
|
+
const message = (overrides: Partial<MessageResource>): MessageResource => ({
|
|
14
|
+
type: 'Message',
|
|
15
|
+
id: '01',
|
|
16
|
+
text: null,
|
|
17
|
+
html: '',
|
|
18
|
+
createdAt: '2026-02-03T14:18:00',
|
|
19
|
+
deletedAt: null,
|
|
20
|
+
textEditedAt: null,
|
|
21
|
+
mine: false,
|
|
22
|
+
attachments: [],
|
|
23
|
+
author,
|
|
24
|
+
reactionCounts: [],
|
|
25
|
+
replyCount: 0,
|
|
26
|
+
replyRootId: null,
|
|
27
|
+
messageType: 'unsupported',
|
|
28
|
+
...overrides,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
describe('UnsupportedMessage', () => {
|
|
32
|
+
it("shows the server's fallback text and the update hint", () => {
|
|
33
|
+
render(
|
|
34
|
+
<UnsupportedMessage
|
|
35
|
+
message={message({ text: '๐ Poll: Lunch? โ Update your app to vote' })}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
expect(screen.getByText('๐ Poll: Lunch? โ Update your app to vote')).toBeTruthy()
|
|
40
|
+
expect(screen.getByText(UNSUPPORTED_MESSAGE_HINT)).toBeTruthy()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('falls back to a generic line when the server sent no text', () => {
|
|
44
|
+
render(<UnsupportedMessage message={message({ text: ' ' })} />)
|
|
45
|
+
|
|
46
|
+
expect(screen.getByText(UNSUPPORTED_MESSAGE_FALLBACK)).toBeTruthy()
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('names the author when grouping asks for it, so follow-ups stay attributed', () => {
|
|
50
|
+
render(<UnsupportedMessage message={message({ text: 'Poll', renderAuthor: true })} />)
|
|
51
|
+
|
|
52
|
+
expect(screen.getByText('Wes')).toBeTruthy()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('omits the author inside a group and on my own messages', () => {
|
|
56
|
+
const { rerender } = render(
|
|
57
|
+
<UnsupportedMessage message={message({ text: 'Poll', renderAuthor: false })} />
|
|
58
|
+
)
|
|
59
|
+
expect(screen.queryByText('Wes')).toBeNull()
|
|
60
|
+
|
|
61
|
+
rerender(
|
|
62
|
+
<UnsupportedMessage message={message({ text: 'Poll', mine: true, renderAuthor: true })} />
|
|
63
|
+
)
|
|
64
|
+
expect(screen.queryByText('Wes')).toBeNull()
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('renders the fallback content read-only: title, items with totals, footer and hint', () => {
|
|
68
|
+
render(
|
|
69
|
+
<UnsupportedMessage
|
|
70
|
+
message={message({
|
|
71
|
+
text: '๐ Poll: Lunch? โ Update your app to vote',
|
|
72
|
+
fallbackContent: {
|
|
73
|
+
kind: 'poll',
|
|
74
|
+
title: 'Lunch?',
|
|
75
|
+
subtitle: 'Select one ยท 3 votes',
|
|
76
|
+
items: [
|
|
77
|
+
{ label: 'Tacos', detail: '2', fraction: 0.67, selected: true },
|
|
78
|
+
{ label: 'Pizza', detail: '1', fraction: 0.33 },
|
|
79
|
+
],
|
|
80
|
+
footer: 'Ends Friday',
|
|
81
|
+
hint: 'Update your app to vote',
|
|
82
|
+
},
|
|
83
|
+
})}
|
|
84
|
+
/>
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
expect(screen.getByText('Lunch?')).toBeTruthy()
|
|
88
|
+
expect(screen.getByText('Select one ยท 3 votes')).toBeTruthy()
|
|
89
|
+
expect(screen.getByText('โ Tacos')).toBeTruthy()
|
|
90
|
+
expect(screen.getByText('2')).toBeTruthy()
|
|
91
|
+
expect(screen.getByText('Pizza')).toBeTruthy()
|
|
92
|
+
expect(screen.getByText('Ends Friday')).toBeTruthy()
|
|
93
|
+
expect(screen.getByText('Update your app to vote')).toBeTruthy()
|
|
94
|
+
expect(screen.queryByText(/๐ Poll/)).toBeNull()
|
|
95
|
+
expect(screen.queryByRole('button')).toBeNull()
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
it('does not repeat the update hint when the server text already carries it', () => {
|
|
99
|
+
render(
|
|
100
|
+
<UnsupportedMessage
|
|
101
|
+
message={message({
|
|
102
|
+
text: "This message can't be shown here. Update your app to see it.",
|
|
103
|
+
})}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
expect(screen.getAllByText(/Update your app/)).toHaveLength(1)
|
|
108
|
+
})
|
|
109
|
+
})
|
|
@@ -9,6 +9,7 @@ import { MessageResource } from '../../types/resources/message'
|
|
|
9
9
|
import { getRelativeDateStatus } from '../../utils/date'
|
|
10
10
|
import { groupMessages, type DateSeparator, type EnrichedMessage } from '../../utils/group_messages'
|
|
11
11
|
import { isLiquidGlassEnabled } from '../../utils/liquid_glass'
|
|
12
|
+
import { isUnsupportedMessage } from '../../utils/message_types'
|
|
12
13
|
import { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../../utils/styles'
|
|
13
14
|
import { isSystemMessage } from '../../utils/system_messages'
|
|
14
15
|
import { Text } from '../display'
|
|
@@ -17,6 +18,7 @@ import { Message } from './message'
|
|
|
17
18
|
import { MissingMessage } from './missing_message'
|
|
18
19
|
import { ReplyShadowMessage } from './reply_shadow_message'
|
|
19
20
|
import { SystemMessage } from './system_message'
|
|
21
|
+
import { UnsupportedMessage } from './unsupported_message'
|
|
20
22
|
|
|
21
23
|
// While behind, the bottom of the window isn't the live edge. Following there pulls
|
|
22
24
|
// each newly paged-in page into view and chains the next fetch.
|
|
@@ -199,6 +201,10 @@ export function MessageList({
|
|
|
199
201
|
)
|
|
200
202
|
}
|
|
201
203
|
|
|
204
|
+
if (isUnsupportedMessage(item)) {
|
|
205
|
+
return <UnsupportedMessage message={item} />
|
|
206
|
+
}
|
|
207
|
+
|
|
202
208
|
if (isSystemMessage(item)) {
|
|
203
209
|
return (
|
|
204
210
|
<SystemMessage
|