@amityco/ts-sdk 7.5.4-91188fd.0 → 7.5.4-d9c7b36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ export declare const getSubChannelMessagePreviewWithUser: (subChannel: Amity.Sub
3
3
  user: Amity.InternalUser | undefined;
4
4
  messagePreviewId: string;
5
5
  subChannelName: string;
6
- data?: string | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | Amity.ContentDataStream | Record<string, unknown> | undefined;
6
+ data?: string | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | Record<string, unknown> | undefined;
7
7
  dataType?: any;
8
8
  channelId: string;
9
9
  subChannelId: string;
@@ -18,12 +18,12 @@ export declare const generateComment: (params?: Partial<Amity.InternalComment>)
18
18
  editedAt: string;
19
19
  attachments?: Amity.Attachment[] | undefined;
20
20
  targetId: string;
21
- targetType: "user" | "community" | "content";
21
+ targetType: "community" | "user" | "content";
22
22
  referenceId: string;
23
23
  referenceType: Amity.CommentReferenceType;
24
24
  dataType?: any;
25
25
  dataTypes?: any[] | undefined;
26
- data?: string | Record<string, unknown> | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | Amity.ContentDataStream | undefined;
26
+ data?: string | Record<string, unknown> | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | undefined;
27
27
  metadata?: Record<string, any> | undefined;
28
28
  flagCount: number;
29
29
  hashFlag: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.5.4-91188fd.0",
3
+ "version": "7.5.4-d9c7b36.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",
@@ -24,15 +24,7 @@ declare global {
24
24
  | Exclude<`${ContentFlagReasonEnum}`, `${ContentFlagReasonEnum.Others}`>
25
25
  | (string & {});
26
26
 
27
- type ContentType =
28
- | 'text'
29
- | 'image'
30
- | 'file'
31
- | 'video'
32
- | 'poll'
33
- | 'json'
34
- | 'liveStream'
35
- | string;
27
+ type ContentType = 'text' | 'image' | 'file' | 'video' | 'poll' | 'json' | string;
36
28
 
37
29
  type ContentFeedType = ValueOf<typeof ContentFeedType>;
38
30
 
@@ -66,10 +58,6 @@ declare global {
66
58
  pollId: Amity.Poll['pollId'];
67
59
  };
68
60
 
69
- type ContentDataStream = {
70
- streamId: Amity.Stream['streamId'];
71
- };
72
-
73
61
  type ContentData<T extends ContentType> = T extends 'text'
74
62
  ? ContentDataText
75
63
  : T extends 'file'
@@ -80,8 +68,6 @@ declare global {
80
68
  ? ContentDataVideo
81
69
  : T extends 'poll'
82
70
  ? ContentDataPoll
83
- : T extends 'liveStream'
84
- ? ContentDataStream
85
71
  : T extends 'json'
86
72
  ? Record<string, unknown>
87
73
  : T extends string
@@ -32,6 +32,6 @@ declare global {
32
32
  pinnedAt: Date;
33
33
  };
34
34
 
35
- type GlobalPinnedPostLiveCollection = Amity.LiveCollectionParams<{}>;
35
+ type GlobalPinnedPostLiveCollection = Amity.LiveCollectionParams<Record<string, never>>;
36
36
  }
37
37
  }
@@ -41,5 +41,3 @@ export * from './domains/notification';
41
41
  export * from './domains/client';
42
42
  export * from './domains/invitation';
43
43
  export * from './domains/joinRequest';
44
- export * from './domains/pin';
45
- export * from './domains/pinnedPost';
@@ -2,7 +2,6 @@ import { getActiveClient } from '~/client/api';
2
2
 
3
3
  import { fireEvent } from '~/core/events';
4
4
  import { getCommunity } from './getCommunity';
5
- import { LinkedObject } from '~/utils/linkedObject';
6
5
 
7
6
  /* begin_public_function
8
7
  id: community.delete
@@ -41,6 +40,6 @@ export const deleteCommunity = async (
41
40
  users: [],
42
41
  });
43
42
 
44
- return LinkedObject.community(deleted.data);
43
+ return deleted.data;
45
44
  };
46
45
  /* end_public_function */
@@ -25,7 +25,7 @@ export const getCommunity = async (
25
25
  communityId: Amity.Community['communityId'],
26
26
  type?: Amity.JoinRequestType,
27
27
  includeDiscoverablePrivateCommunity?: boolean,
28
- ): Promise<Amity.Cached<Amity.InternalCommunity>> => {
28
+ ): Promise<Amity.Cached<Amity.Community>> => {
29
29
  const client = getActiveClient();
30
30
  client.log('community/getCommunity', communityId);
31
31
 
@@ -51,7 +51,9 @@ export const getCommunity = async (
51
51
  const { communities } = data;
52
52
 
53
53
  return {
54
- data: communities.find(community => community.communityId === communityId)!,
54
+ data: LinkedObject.community(
55
+ communities.find(community => community.communityId === communityId)!,
56
+ ),
55
57
  cachedAt,
56
58
  };
57
59
  };
@@ -71,18 +73,18 @@ export const getCommunity = async (
71
73
  */
72
74
  getCommunity.locally = (
73
75
  communityId: Amity.Community['communityId'],
74
- ): Amity.Cached<Amity.InternalCommunity> | undefined => {
76
+ ): Amity.Cached<Amity.Community> | undefined => {
75
77
  const client = getActiveClient();
76
78
  client.log('community/getCommunity.locally', communityId);
77
79
 
78
80
  if (!client.cache) return;
79
81
 
80
- const cached = pullFromCache<Amity.InternalCommunity>(['community', 'get', communityId]);
82
+ const cached = pullFromCache<Amity.Community>(['community', 'get', communityId]);
81
83
 
82
84
  if (!cached) return;
83
85
 
84
86
  return {
85
- data: cached.data,
87
+ data: LinkedObject.community(cached.data),
86
88
  cachedAt: cached.cachedAt,
87
89
  };
88
90
  };
@@ -12,7 +12,6 @@ import {
12
12
  onLocalCommunityJoin,
13
13
  } from '../communityMembership/events';
14
14
  import { convertEventPayload } from '~/utils/event';
15
- import { LinkedObject } from '~/utils/linkedObject';
16
15
 
17
16
  /* begin_public_function
18
17
  id: community.get
@@ -40,28 +39,17 @@ export const getCommunity = (
40
39
  communityId: Amity.Community['communityId'],
41
40
  callback: Amity.LiveObjectCallback<Amity.Community>,
42
41
  ): Amity.Unsubscriber => {
43
- return liveObject(
44
- communityId,
45
- callback,
46
- 'communityId',
47
- _getCommunity,
48
- [
49
- onCommunityUpdated,
50
- onCommunityDeleted,
51
- onCommunityJoined,
52
- onCommunityLeft,
53
- onLocalCommunityJoined,
54
- onLocalCommunityLeft,
55
- onCommunityUserBanned,
56
- onCommunityUserUnbanned,
57
- onCommunityUserChanged,
58
- convertEventPayload(onLocalCommunityJoin, 'targetId', 'community'),
59
- ],
60
- {
61
- callbackDataSelector: (data: Amity.InternalCommunity) => {
62
- return LinkedObject.community(data);
63
- },
64
- },
65
- );
42
+ return liveObject(communityId, callback, 'communityId', _getCommunity, [
43
+ onCommunityUpdated,
44
+ onCommunityDeleted,
45
+ onCommunityJoined,
46
+ onCommunityLeft,
47
+ onLocalCommunityJoined,
48
+ onLocalCommunityLeft,
49
+ onCommunityUserBanned,
50
+ onCommunityUserUnbanned,
51
+ onCommunityUserChanged,
52
+ convertEventPayload(onLocalCommunityJoin, 'targetId', 'community'),
53
+ ]);
66
54
  };
67
55
  /* end_public_function */