@amityco/ts-sdk-react-native 6.33.0 → 6.33.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.
@@ -0,0 +1,5 @@
1
+ export declare enum AmityUserSearchMatchType {
2
+ DEFAULT = "default",
3
+ PARTIAL = "partial"
4
+ }
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/userRepository/constants/index.ts"],"names":[],"mappings":"AAAA,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB"}
@@ -2,4 +2,5 @@ export * as Relationship from './relationship';
2
2
  export * from './api';
3
3
  export * from './events';
4
4
  export * from './observers';
5
+ export * from './constants';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/userRepository/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/userRepository/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messageLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/messageLinkedObject.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,YAAa,MAAM,eAAe,KAAG,MAAM,OAY1E,CAAC"}
1
+ {"version":3,"file":"messageLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/messageLinkedObject.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,YAAa,MAAM,eAAe,KAAG,MAAM,OAe1E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk-react-native",
3
- "version": "6.33.0",
3
+ "version": "6.33.1",
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",
@@ -60,6 +60,7 @@ declare global {
60
60
  channelSegment: number;
61
61
  childrenNumber: number;
62
62
  creatorId: string;
63
+ creator?: Amity.User;
63
64
  editedAt?: Amity.timestamp;
64
65
  parentId?: string;
65
66
  messageId: string;
@@ -1,3 +1,5 @@
1
+ import { AmityUserSearchMatchType } from '~/userRepository';
2
+
1
3
  export {};
2
4
 
3
5
  declare global {
@@ -9,6 +11,8 @@ declare global {
9
11
  DisplayName = 'displayName',
10
12
  }
11
13
 
14
+ type UserSearchMatchType = AmityUserSearchMatchType;
15
+
12
16
  type UserSortBy = `${Amity.UserSortByEnum}`;
13
17
 
14
18
  const enum SearchUserSortByEnum {
@@ -67,7 +71,7 @@ declare global {
67
71
  sortBy?: Amity.UserSortBy | Amity.UserSortByEnum;
68
72
  limit?: number;
69
73
  page?: string;
70
- matchType?: string;
74
+ matchType?: UserSearchMatchType;
71
75
  };
72
76
 
73
77
  type QuerySearchUsers = {
@@ -76,7 +80,7 @@ declare global {
76
80
  sortBy?: Amity.SearchUserSortBy | Amity.SearchUserSortByEnum;
77
81
  limit?: number;
78
82
  page?: string;
79
- matchType?: string;
83
+ matchType?: UserSearchMatchType;
80
84
  };
81
85
 
82
86
  type UserLiveCollection = Amity.LiveCollectionParams<Omit<Amity.QueryUsers, 'page'>>;
@@ -18,9 +18,9 @@ export const getGlobalPinnedPosts = (
18
18
  ) => {
19
19
  const { log, cache } = getActiveClient();
20
20
 
21
- if (!cache) {
22
- console.log(ENABLE_CACHE_MESSAGE);
23
- }
21
+ // if (!cache) {
22
+ // console.log(ENABLE_CACHE_MESSAGE);
23
+ // }
24
24
 
25
25
  const timestamp = Date.now();
26
26
  log(`getGlobalPinnedPosts(tmpid: ${timestamp}) > listen`);
@@ -34,9 +34,9 @@ export const getReactions = (
34
34
  ): Amity.Unsubscriber => {
35
35
  const { log, cache } = getActiveClient();
36
36
 
37
- if (!cache) {
38
- console.log('For using Live Collection feature you need to enable Cache!');
39
- }
37
+ // if (!cache) {
38
+ // console.log('For using Live Collection feature you need to enable Cache!');
39
+ // }
40
40
 
41
41
  const timestamp = Date.now();
42
42
  log(`getReactions(tmpid: ${timestamp}) > listen`);
@@ -0,0 +1,4 @@
1
+ export enum AmityUserSearchMatchType {
2
+ DEFAULT = 'default',
3
+ PARTIAL = 'partial',
4
+ }
@@ -3,3 +3,4 @@ export * as Relationship from './relationship';
3
3
  export * from './api';
4
4
  export * from './events';
5
5
  export * from './observers';
6
+ export * from './constants';
@@ -1,3 +1,4 @@
1
+ import { pullFromCache } from '~/cache/api';
1
2
  import { getMessageReadCount } from '~/messageRepository/utils/getMessageReadCount';
2
3
  import { markReadMessage } from '~/messageRepository/utils/markReadMessage';
3
4
 
@@ -11,6 +12,9 @@ export const messageLinkedObject = (message: Amity.InternalMessage): Amity.Messa
11
12
  get deliveredCount() {
12
13
  return getMessageReadCount(message).deliveredCount;
13
14
  },
15
+ get creator() {
16
+ return pullFromCache<Amity.InternalUser>(['user', 'get', message.creatorId])?.data;
17
+ },
14
18
  markRead: () => markReadMessage(message),
15
19
  };
16
20
  };