@amityco/ts-sdk 6.35.3-024c022.0 → 6.35.3-223c453.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channelRepository/internalApi/getChannelByIds.d.ts +2 -2
- package/dist/channelRepository/internalApi/getChannelByIds.d.ts.map +1 -1
- package/dist/channelRepository/observers/getChannel.d.ts.map +1 -1
- package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/utils/constructChannelObject.d.ts.map +1 -1
- package/dist/channelRepository/utils/updateChannelCache.d.ts +1 -1
- package/dist/channelRepository/utils/updateChannelCache.d.ts.map +1 -1
- package/dist/communityRepository/observers/searchCommunities.d.ts +1 -1
- package/dist/communityRepository/observers/searchCommunities.d.ts.map +1 -1
- package/dist/communityRepository/utils/communityQueryFilter.d.ts.map +1 -1
- package/dist/index.cjs.js +135 -25
- package/dist/index.esm.js +135 -25
- package/dist/index.umd.js +2 -2
- package/dist/messageRepository/api/createMessage.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/getMessages.d.ts +0 -1
- package/dist/messageRepository/observers/getMessages/getMessages.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channelRepository/api/getChannelByIds.ts +5 -5
- package/src/channelRepository/internalApi/getChannelByIds.ts +5 -7
- package/src/channelRepository/observers/getChannel.ts +33 -13
- package/src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts +6 -12
- package/src/channelRepository/utils/constructChannelObject.ts +7 -0
- package/src/channelRepository/utils/resolveChannels.ts +1 -1
- package/src/channelRepository/utils/updateChannelCache.ts +4 -1
- package/src/communityRepository/communityMembership/observers/tests/getMembers.test.ts +0 -1
- package/src/communityRepository/observers/searchCommunities.ts +1 -1
- package/src/communityRepository/observers/tests/getCommunities.test.ts +0 -1
- package/src/communityRepository/utils/communityQueryFilter.ts +1 -8
- package/src/core/events.ts +1 -1
- package/src/messageRepository/api/createMessage.ts +6 -2
- package/src/messageRepository/api/tests/createMessage.test.ts +1 -0
- package/src/messageRepository/api/tests/deleteMessage.test.ts +5 -1
- package/src/messageRepository/observers/getMessages/getMessages.ts +0 -34
- package/src/userRepository/observers/tests/getUsers.test.ts +1 -43
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
15
|
export declare const getChannelByIds: {
|
|
16
|
-
(channelIds: Amity.Channel['channelPublicId'][]): Promise<Amity.Cached<Amity.
|
|
16
|
+
(channelIds: Amity.Channel['channelPublicId'][]): Promise<Amity.Cached<Amity.StaticInternalChannel[]>>;
|
|
17
17
|
/**
|
|
18
18
|
* ```js
|
|
19
19
|
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
@@ -27,6 +27,6 @@ export declare const getChannelByIds: {
|
|
|
27
27
|
*
|
|
28
28
|
* @category Channel API
|
|
29
29
|
*/
|
|
30
|
-
locally(channelIds: Amity.Channel['channelPublicId'][]): Amity.Cached<Amity.
|
|
30
|
+
locally(channelIds: Amity.Channel['channelPublicId'][]): Amity.Cached<Amity.StaticInternalChannel[]> | undefined;
|
|
31
31
|
};
|
|
32
32
|
//# sourceMappingURL=getChannelByIds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChannelByIds.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/internalApi/getChannelByIds.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getChannelByIds.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/internalApi/getChannelByIds.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;iBACd,MAAM,OAAO,CAAC,iBAAiB,CAAC,EAAE,GAC7C,QAAQ,MAAM,MAAM,CAAC,MAAM,qBAAqB,EAAE,CAAC,CAAC;IA2CvD;;;;;;;;;;;;OAYG;wBAEW,MAAM,OAAO,CAAC,iBAAiB,CAAC,EAAE,GAC7C,MAAM,MAAM,CAAC,MAAM,qBAAqB,EAAE,CAAC,GAAG,SAAS;CAjBzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChannel.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/observers/getChannel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getChannel.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/observers/getChannel.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,cACV,MAAM,OAAO,CAAC,WAAW,CAAC,YAC3B,MAAM,kBAAkB,CAAC,MAAM,OAAO,CAAC,KAChD,MAAM,YAiPR,CAAC"}
|
package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelLiveCollectionController.d.ts","sourceRoot":"","sources":["../../../../src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AA2C1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"ChannelLiveCollectionController.d.ts","sourceRoot":"","sources":["../../../../src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AA2C1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AAYvF,qBAAa,+BAAgC,SAAQ,wBAAwB,CAC3E,SAAS,EACT,KAAK,CAAC,qBAAqB,EAC3B,KAAK,CAAC,OAAO,EACb,2BAA2B,GAAG,iCAAiC,CAChE;IACC,OAAO,CAAC,qBAAqB,CAA+B;IAE5D,OAAO,CAAC,KAAK,CAA8B;gBAGzC,KAAK,EAAE,KAAK,CAAC,qBAAqB,EAClC,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC;IAgCvD,SAAS,CAAC,KAAK;cAUC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,UAAU;IAI9E,SAAS,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,KAAK,CAAC,sCAAsC,CAAC,SAAS,CAAC;IAI1D,iBAAiB;IAIjB,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,0BAA0B;IAkCzE,OAAO,CAAC,WAAW;IA4DnB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAKvC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAQtC,OAAO,CAAC,gBAAgB;CA0VzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructChannelObject.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/utils/constructChannelObject.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,YAAa,MAAM,qBAAqB,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"constructChannelObject.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/utils/constructChannelObject.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,YAAa,MAAM,qBAAqB,KAAG,MAAM,OAWnF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function updateChannelCache(channel: Amity.
|
|
1
|
+
export declare function updateChannelCache(channel: Amity.StaticInternalChannel, params: Partial<Amity.StaticInternalChannel>): void;
|
|
2
2
|
//# sourceMappingURL=updateChannelCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateChannelCache.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/utils/updateChannelCache.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"updateChannelCache.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/utils/updateChannelCache.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,KAAK,CAAC,qBAAqB,EACpC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,QAO7C"}
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
*
|
|
17
17
|
* @category Community Live Collection
|
|
18
18
|
*/
|
|
19
|
-
export declare const searchCommunities: (params: Amity.
|
|
19
|
+
export declare const searchCommunities: (params: Amity.SearchCommunityLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Community>, config?: Amity.LiveCollectionConfig) => () => void;
|
|
20
20
|
//# sourceMappingURL=searchCommunities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchCommunities.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/observers/searchCommunities.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"searchCommunities.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/observers/searchCommunities.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,6BAA6B,YACjC,MAAM,sBAAsB,CAAC,MAAM,SAAS,CAAC,WAC9C,MAAM,oBAAoB,eAyBpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communityQueryFilter.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/utils/communityQueryFilter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"communityQueryFilter.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/utils/communityQueryFilter.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB,SACzB,MAAM,SAAS,EAAE,UACf,MAAM,uBAAuB,UAC7B,MAAM,KACb,MAAM,SAAS,EAmCjB,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1333,7 +1333,7 @@ const MQTT_EVENTS = [
|
|
|
1333
1333
|
'video-streaming.didStop',
|
|
1334
1334
|
'video-streaming.didFlag',
|
|
1335
1335
|
'video-streaming.didTerminate',
|
|
1336
|
-
'user.didGlobalBan',
|
|
1336
|
+
// 'user.didGlobalBan' remove due to message event,
|
|
1337
1337
|
];
|
|
1338
1338
|
/** @hidden */
|
|
1339
1339
|
const createEventEmitter = () => {
|
|
@@ -7013,6 +7013,16 @@ const constructChannelDynamicValue = (channel) => {
|
|
|
7013
7013
|
});
|
|
7014
7014
|
};
|
|
7015
7015
|
|
|
7016
|
+
const constructChannelObject = (channel) => {
|
|
7017
|
+
/**
|
|
7018
|
+
* convert internal cache data to be public channel data
|
|
7019
|
+
* 1. [getChannelMessagePreviewWithUser] add messagePreview >> Amity.InternalChannel -> Amity.InternalChannel
|
|
7020
|
+
* 2. [constructChannelDynamicValue] construct getter value >> Amity.StaticInternalChannel -> Amity.Channel
|
|
7021
|
+
* 3. [LinkedObject.channel] add markAsRead >> Amity.InternalChannel -> Amity.Channel
|
|
7022
|
+
*/
|
|
7023
|
+
return LinkedObject.channel(constructChannelDynamicValue(getChannelMessagePreviewWithUser(channel)));
|
|
7024
|
+
};
|
|
7025
|
+
|
|
7016
7026
|
/**
|
|
7017
7027
|
* ```js
|
|
7018
7028
|
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
@@ -7027,7 +7037,7 @@ const constructChannelDynamicValue = (channel) => {
|
|
|
7027
7037
|
* @category Channel API
|
|
7028
7038
|
* @async
|
|
7029
7039
|
*/
|
|
7030
|
-
const getChannelByIds = async (channelIds) => {
|
|
7040
|
+
const getChannelByIds$1 = async (channelIds) => {
|
|
7031
7041
|
const client = getActiveClient();
|
|
7032
7042
|
client.log('channel/getChannelByIds', channelIds);
|
|
7033
7043
|
const encodedChannelIds = channelIds.map(channelId => encodeURIComponent(channelId));
|
|
@@ -7057,7 +7067,7 @@ const getChannelByIds = async (channelIds) => {
|
|
|
7057
7067
|
ingestInCache(data, { cachedAt });
|
|
7058
7068
|
fireEvent('local.channel.fetched', data.channels);
|
|
7059
7069
|
return {
|
|
7060
|
-
data: data.channels.map(channel =>
|
|
7070
|
+
data: data.channels.map(channel => constructChannelObject(channel)),
|
|
7061
7071
|
cachedAt,
|
|
7062
7072
|
};
|
|
7063
7073
|
};
|
|
@@ -7074,7 +7084,7 @@ const getChannelByIds = async (channelIds) => {
|
|
|
7074
7084
|
*
|
|
7075
7085
|
* @category Channel API
|
|
7076
7086
|
*/
|
|
7077
|
-
getChannelByIds.locally = (channelIds) => {
|
|
7087
|
+
getChannelByIds$1.locally = (channelIds) => {
|
|
7078
7088
|
var _a, _b;
|
|
7079
7089
|
const client = getActiveClient();
|
|
7080
7090
|
client.log('channel/getChannelByIds.locally', channelIds);
|
|
@@ -7088,7 +7098,7 @@ getChannelByIds.locally = (channelIds) => {
|
|
|
7088
7098
|
const channels = cached.map(({ data }) => data);
|
|
7089
7099
|
const oldest = (_b = cached.sort((a, b) => (a.cachedAt < b.cachedAt ? -1 : 1))) === null || _b === void 0 ? void 0 : _b[0];
|
|
7090
7100
|
return {
|
|
7091
|
-
data: channels.map(channel =>
|
|
7101
|
+
data: channels.map(channel => constructChannelObject(channel)),
|
|
7092
7102
|
cachedAt: oldest.cachedAt,
|
|
7093
7103
|
};
|
|
7094
7104
|
};
|
|
@@ -7377,7 +7387,7 @@ const initializeMessagePreviewSetting = async () => {
|
|
|
7377
7387
|
* 2. channel and subChannel which isDelete = true
|
|
7378
7388
|
*/
|
|
7379
7389
|
if (channelWithIsDeletedTrue.length !== 0)
|
|
7380
|
-
await getChannelByIds(channelWithIsDeletedTrue);
|
|
7390
|
+
await getChannelByIds$1(channelWithIsDeletedTrue);
|
|
7381
7391
|
if (subChannelWithIsDeletedTrue.length !== 0)
|
|
7382
7392
|
await getSubChannels$1(subChannelWithIsDeletedTrue);
|
|
7383
7393
|
}
|
|
@@ -7803,6 +7813,86 @@ const onOffline = (callback) => {
|
|
|
7803
7813
|
return () => console.error('Unsupported environment');
|
|
7804
7814
|
};
|
|
7805
7815
|
|
|
7816
|
+
/**
|
|
7817
|
+
* ```js
|
|
7818
|
+
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
7819
|
+
* const channels = await getChannelByIds(['foo', 'bar'])
|
|
7820
|
+
* ```
|
|
7821
|
+
*
|
|
7822
|
+
* Fetches a collection of {@link Amity.Channel} objects
|
|
7823
|
+
*
|
|
7824
|
+
* @param channelIds the IDs of the {@link Amity.Channel} to fetch
|
|
7825
|
+
* @returns the associated collection of {@link Amity.Channel} objects
|
|
7826
|
+
*
|
|
7827
|
+
* @category Channel API
|
|
7828
|
+
* @async
|
|
7829
|
+
*/
|
|
7830
|
+
const getChannelByIds = async (channelIds) => {
|
|
7831
|
+
const client = getActiveClient();
|
|
7832
|
+
client.log('channel/getChannelByIds', channelIds);
|
|
7833
|
+
const encodedChannelIds = channelIds.map(channelId => encodeURIComponent(channelId));
|
|
7834
|
+
let payload;
|
|
7835
|
+
try {
|
|
7836
|
+
// API-FIX: endpoint should not be /list, parameters should be querystring.
|
|
7837
|
+
const response = await client.http.get(`/api/v3/channels/list`, {
|
|
7838
|
+
params: { channelIds: encodedChannelIds },
|
|
7839
|
+
});
|
|
7840
|
+
payload = response.data;
|
|
7841
|
+
}
|
|
7842
|
+
catch (error) {
|
|
7843
|
+
channelIds.forEach(channelId => {
|
|
7844
|
+
if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
|
|
7845
|
+
// NOTE: use channelPublicId as tombstone cache key since we cannot get the channelPrivateId that come along with channel data from server
|
|
7846
|
+
pushToTombstone('channel', channelId);
|
|
7847
|
+
}
|
|
7848
|
+
});
|
|
7849
|
+
throw error;
|
|
7850
|
+
}
|
|
7851
|
+
const data = await prepareChannelPayload(payload);
|
|
7852
|
+
if (client.isUnreadCountEnabled && client.getMarkerSyncConsistentMode()) {
|
|
7853
|
+
await prepareUnreadCountInfo(payload);
|
|
7854
|
+
}
|
|
7855
|
+
const cachedAt = client.cache && Date.now();
|
|
7856
|
+
if (client.cache)
|
|
7857
|
+
ingestInCache(data, { cachedAt });
|
|
7858
|
+
fireEvent('local.channel.fetched', data.channels);
|
|
7859
|
+
return {
|
|
7860
|
+
data: data.channels,
|
|
7861
|
+
cachedAt,
|
|
7862
|
+
};
|
|
7863
|
+
};
|
|
7864
|
+
/**
|
|
7865
|
+
* ```js
|
|
7866
|
+
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
7867
|
+
* const channels = getChannelByIds.locally(['foo', 'bar']) ?? []
|
|
7868
|
+
* ```
|
|
7869
|
+
*
|
|
7870
|
+
* Fetches a collection of {@link Amity.Channel} objects from cache
|
|
7871
|
+
*
|
|
7872
|
+
* @param channelIds the IDs of the {@link Amity.Channel} to fetch
|
|
7873
|
+
* @returns the associated collection of {@link Amity.Channel} objects
|
|
7874
|
+
*
|
|
7875
|
+
* @category Channel API
|
|
7876
|
+
*/
|
|
7877
|
+
getChannelByIds.locally = (channelIds) => {
|
|
7878
|
+
var _a, _b;
|
|
7879
|
+
const client = getActiveClient();
|
|
7880
|
+
client.log('channel/getChannelByIds.locally', channelIds);
|
|
7881
|
+
if (!client.cache)
|
|
7882
|
+
return;
|
|
7883
|
+
const cached = (_a = queryCache(['channel', 'get'])) === null || _a === void 0 ? void 0 : _a.filter(({ data }) => {
|
|
7884
|
+
return channelIds.includes(data.channelPublicId);
|
|
7885
|
+
});
|
|
7886
|
+
if (!cached || (cached === null || cached === void 0 ? void 0 : cached.length) < channelIds.length)
|
|
7887
|
+
return;
|
|
7888
|
+
const channels = cached.map(({ data }) => data);
|
|
7889
|
+
const oldest = (_b = cached.sort((a, b) => (a.cachedAt < b.cachedAt ? -1 : 1))) === null || _b === void 0 ? void 0 : _b[0];
|
|
7890
|
+
return {
|
|
7891
|
+
data: channels,
|
|
7892
|
+
cachedAt: oldest.cachedAt,
|
|
7893
|
+
};
|
|
7894
|
+
};
|
|
7895
|
+
|
|
7806
7896
|
const resolveChannels = async (channelIds) => {
|
|
7807
7897
|
var _a, _b, _c;
|
|
7808
7898
|
await getChannelByIds(channelIds);
|
|
@@ -14847,9 +14937,13 @@ const createMessageOptimistic = (bundle) => {
|
|
|
14847
14937
|
if (subChannel) {
|
|
14848
14938
|
upsertInCache(['subChannel', 'get', bundle.subChannelId], Object.assign(Object.assign({}, subChannel.data), { messageCount: subChannel.data.messageCount + 1 }));
|
|
14849
14939
|
if (subChannel.data.channelId === subChannel.data.subChannelId) {
|
|
14850
|
-
const channel = pullFromCache([
|
|
14940
|
+
const channel = pullFromCache([
|
|
14941
|
+
'channel',
|
|
14942
|
+
'get',
|
|
14943
|
+
subChannel.data.channelId,
|
|
14944
|
+
]);
|
|
14851
14945
|
if (channel === null || channel === void 0 ? void 0 : channel.data) {
|
|
14852
|
-
upsertInCache(['channel', 'get', subChannel.data.channelId], Object.assign(Object.assign({}, channel.data), { messageCount: ((_a =
|
|
14946
|
+
upsertInCache(['channel', 'get', subChannel.data.channelId], Object.assign(Object.assign({}, channel.data), { messageCount: ((_a = channel.data.messageCount) !== null && _a !== void 0 ? _a : 0) + 1 }));
|
|
14853
14947
|
}
|
|
14854
14948
|
}
|
|
14855
14949
|
}
|
|
@@ -15821,7 +15915,6 @@ class MessageLiveCollectionController extends LiveCollectionController {
|
|
|
15821
15915
|
}
|
|
15822
15916
|
}
|
|
15823
15917
|
|
|
15824
|
-
/* eslint-disable no-use-before-define */
|
|
15825
15918
|
/* begin_public_function
|
|
15826
15919
|
id: message.query
|
|
15827
15920
|
*/
|
|
@@ -16455,9 +16548,7 @@ const getChannel = (channelId, callback) => {
|
|
|
16455
16548
|
const reactor = async (response) => {
|
|
16456
16549
|
if (!response.data)
|
|
16457
16550
|
return callback(response);
|
|
16458
|
-
const data = Object.assign(Object.assign({}, response), {
|
|
16459
|
-
// TODO: refactor to be a function to construct public channel object
|
|
16460
|
-
data: LinkedObject.channel(constructChannelDynamicValue(getChannelMessagePreviewWithUser(response.data))) });
|
|
16551
|
+
const data = Object.assign(Object.assign({}, response), { data: constructChannelObject(response.data) });
|
|
16461
16552
|
const newSnapshot = __rest(data, ["origin"]);
|
|
16462
16553
|
/**
|
|
16463
16554
|
* check equality of previous data and current data to avoid redundancy
|
|
@@ -16491,7 +16582,11 @@ const getChannel = (channelId, callback) => {
|
|
|
16491
16582
|
if (message.channelId !== channelId)
|
|
16492
16583
|
return;
|
|
16493
16584
|
// channelId from message is channelInternalId
|
|
16494
|
-
const channel = (_a = pullFromCache([
|
|
16585
|
+
const channel = (_a = pullFromCache([
|
|
16586
|
+
'channel',
|
|
16587
|
+
'get',
|
|
16588
|
+
channelId,
|
|
16589
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
16495
16590
|
if (!channel)
|
|
16496
16591
|
return;
|
|
16497
16592
|
updateChannelCache(channel, {
|
|
@@ -16514,7 +16609,11 @@ const getChannel = (channelId, callback) => {
|
|
|
16514
16609
|
if (message.channelId !== channelId)
|
|
16515
16610
|
return;
|
|
16516
16611
|
// channelId from message is channelInternalId
|
|
16517
|
-
const channel = (_a = pullFromCache([
|
|
16612
|
+
const channel = (_a = pullFromCache([
|
|
16613
|
+
'channel',
|
|
16614
|
+
'get',
|
|
16615
|
+
channelId,
|
|
16616
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
16518
16617
|
if (!channel)
|
|
16519
16618
|
return;
|
|
16520
16619
|
updateChannelCache(channel, {
|
|
@@ -16527,7 +16626,11 @@ const getChannel = (channelId, callback) => {
|
|
|
16527
16626
|
convertEventPayload((callback) => {
|
|
16528
16627
|
const updateMessagePreview = async (message) => {
|
|
16529
16628
|
var _a;
|
|
16530
|
-
const channel = (_a = pullFromCache([
|
|
16629
|
+
const channel = (_a = pullFromCache([
|
|
16630
|
+
'channel',
|
|
16631
|
+
'get',
|
|
16632
|
+
channelId,
|
|
16633
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
16531
16634
|
if (!channel || channel.messagePreviewId !== message.messageId)
|
|
16532
16635
|
return;
|
|
16533
16636
|
const messagePreviewSetting = await client.getMessagePreviewSetting(false);
|
|
@@ -16541,7 +16644,11 @@ const getChannel = (channelId, callback) => {
|
|
|
16541
16644
|
convertEventPayload((callback) => {
|
|
16542
16645
|
const updateMessagePreview = async (message) => {
|
|
16543
16646
|
var _a;
|
|
16544
|
-
const channel = (_a = pullFromCache([
|
|
16647
|
+
const channel = (_a = pullFromCache([
|
|
16648
|
+
'channel',
|
|
16649
|
+
'get',
|
|
16650
|
+
channelId,
|
|
16651
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
16545
16652
|
if (!channel || channel.messagePreviewId !== message.messageId)
|
|
16546
16653
|
return;
|
|
16547
16654
|
const messagePreviewSetting = await client.getMessagePreviewSetting(false);
|
|
@@ -16574,7 +16681,11 @@ const getChannel = (channelId, callback) => {
|
|
|
16574
16681
|
if (messagePreviewSetting === "no-message-preview" /* Amity.MessagePreviewSetting.NO_MESSAGE_PREVIEW */)
|
|
16575
16682
|
return;
|
|
16576
16683
|
await getChannel$1(channelId);
|
|
16577
|
-
const channel = (_b = pullFromCache([
|
|
16684
|
+
const channel = (_b = pullFromCache([
|
|
16685
|
+
'channel',
|
|
16686
|
+
'get',
|
|
16687
|
+
channelId,
|
|
16688
|
+
])) === null || _b === void 0 ? void 0 : _b.data;
|
|
16578
16689
|
if (!channel)
|
|
16579
16690
|
return;
|
|
16580
16691
|
callback(subChannel);
|
|
@@ -16596,7 +16707,11 @@ const getChannel = (channelId, callback) => {
|
|
|
16596
16707
|
if (!messagePreviewCache ||
|
|
16597
16708
|
messagePreviewCache.subChannelId !== subChannel.subChannelId)
|
|
16598
16709
|
return;
|
|
16599
|
-
const channel = (_b = pullFromCache([
|
|
16710
|
+
const channel = (_b = pullFromCache([
|
|
16711
|
+
'channel',
|
|
16712
|
+
'get',
|
|
16713
|
+
channelId,
|
|
16714
|
+
])) === null || _b === void 0 ? void 0 : _b.data;
|
|
16600
16715
|
if (!channel)
|
|
16601
16716
|
return;
|
|
16602
16717
|
callback(subChannel);
|
|
@@ -16792,12 +16907,7 @@ class ChannelLiveCollectionController extends LiveCollectionController {
|
|
|
16792
16907
|
.map(channelId => pullFromCache(['channel', 'get', channelId]))
|
|
16793
16908
|
.filter(Boolean)
|
|
16794
16909
|
.map(({ data }) => data)
|
|
16795
|
-
|
|
16796
|
-
.map(getChannelMessagePreviewWithUser)
|
|
16797
|
-
// construct getter value >> Amity.StaticInternalChannel -> Amity.Channel
|
|
16798
|
-
.map(constructChannelDynamicValue)
|
|
16799
|
-
// add markAsRead >> Amity.InternalChannel -> Amity.Channel
|
|
16800
|
-
.map(LinkedObject.channel)) !== null && _b !== void 0 ? _b : [];
|
|
16910
|
+
.map(constructChannelObject)) !== null && _b !== void 0 ? _b : [];
|
|
16801
16911
|
if (this.paginationController instanceof ChannelPaginationController) {
|
|
16802
16912
|
data = this.applyFilter(data);
|
|
16803
16913
|
}
|
|
@@ -17768,7 +17878,7 @@ var index$c = /*#__PURE__*/Object.freeze({
|
|
|
17768
17878
|
__proto__: null,
|
|
17769
17879
|
Membership: index$e,
|
|
17770
17880
|
Moderation: index$d,
|
|
17771
|
-
getChannelByIds: getChannelByIds,
|
|
17881
|
+
getChannelByIds: getChannelByIds$1,
|
|
17772
17882
|
createChannel: createChannel,
|
|
17773
17883
|
updateChannel: updateChannel,
|
|
17774
17884
|
deleteChannel: deleteChannel,
|
package/dist/index.esm.js
CHANGED
|
@@ -1318,7 +1318,7 @@ const MQTT_EVENTS = [
|
|
|
1318
1318
|
'video-streaming.didStop',
|
|
1319
1319
|
'video-streaming.didFlag',
|
|
1320
1320
|
'video-streaming.didTerminate',
|
|
1321
|
-
'user.didGlobalBan',
|
|
1321
|
+
// 'user.didGlobalBan' remove due to message event,
|
|
1322
1322
|
];
|
|
1323
1323
|
/** @hidden */
|
|
1324
1324
|
const createEventEmitter = () => {
|
|
@@ -23105,6 +23105,16 @@ const constructChannelDynamicValue = (channel) => {
|
|
|
23105
23105
|
});
|
|
23106
23106
|
};
|
|
23107
23107
|
|
|
23108
|
+
const constructChannelObject = (channel) => {
|
|
23109
|
+
/**
|
|
23110
|
+
* convert internal cache data to be public channel data
|
|
23111
|
+
* 1. [getChannelMessagePreviewWithUser] add messagePreview >> Amity.InternalChannel -> Amity.InternalChannel
|
|
23112
|
+
* 2. [constructChannelDynamicValue] construct getter value >> Amity.StaticInternalChannel -> Amity.Channel
|
|
23113
|
+
* 3. [LinkedObject.channel] add markAsRead >> Amity.InternalChannel -> Amity.Channel
|
|
23114
|
+
*/
|
|
23115
|
+
return LinkedObject.channel(constructChannelDynamicValue(getChannelMessagePreviewWithUser(channel)));
|
|
23116
|
+
};
|
|
23117
|
+
|
|
23108
23118
|
/**
|
|
23109
23119
|
* ```js
|
|
23110
23120
|
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
@@ -23119,7 +23129,7 @@ const constructChannelDynamicValue = (channel) => {
|
|
|
23119
23129
|
* @category Channel API
|
|
23120
23130
|
* @async
|
|
23121
23131
|
*/
|
|
23122
|
-
const getChannelByIds = async (channelIds) => {
|
|
23132
|
+
const getChannelByIds$1 = async (channelIds) => {
|
|
23123
23133
|
const client = getActiveClient();
|
|
23124
23134
|
client.log('channel/getChannelByIds', channelIds);
|
|
23125
23135
|
const encodedChannelIds = channelIds.map(channelId => encodeURIComponent(channelId));
|
|
@@ -23149,7 +23159,7 @@ const getChannelByIds = async (channelIds) => {
|
|
|
23149
23159
|
ingestInCache(data, { cachedAt });
|
|
23150
23160
|
fireEvent('local.channel.fetched', data.channels);
|
|
23151
23161
|
return {
|
|
23152
|
-
data: data.channels.map(channel =>
|
|
23162
|
+
data: data.channels.map(channel => constructChannelObject(channel)),
|
|
23153
23163
|
cachedAt,
|
|
23154
23164
|
};
|
|
23155
23165
|
};
|
|
@@ -23166,7 +23176,7 @@ const getChannelByIds = async (channelIds) => {
|
|
|
23166
23176
|
*
|
|
23167
23177
|
* @category Channel API
|
|
23168
23178
|
*/
|
|
23169
|
-
getChannelByIds.locally = (channelIds) => {
|
|
23179
|
+
getChannelByIds$1.locally = (channelIds) => {
|
|
23170
23180
|
var _a, _b;
|
|
23171
23181
|
const client = getActiveClient();
|
|
23172
23182
|
client.log('channel/getChannelByIds.locally', channelIds);
|
|
@@ -23180,7 +23190,7 @@ getChannelByIds.locally = (channelIds) => {
|
|
|
23180
23190
|
const channels = cached.map(({ data }) => data);
|
|
23181
23191
|
const oldest = (_b = cached.sort((a, b) => (a.cachedAt < b.cachedAt ? -1 : 1))) === null || _b === void 0 ? void 0 : _b[0];
|
|
23182
23192
|
return {
|
|
23183
|
-
data: channels.map(channel =>
|
|
23193
|
+
data: channels.map(channel => constructChannelObject(channel)),
|
|
23184
23194
|
cachedAt: oldest.cachedAt,
|
|
23185
23195
|
};
|
|
23186
23196
|
};
|
|
@@ -23469,7 +23479,7 @@ const initializeMessagePreviewSetting = async () => {
|
|
|
23469
23479
|
* 2. channel and subChannel which isDelete = true
|
|
23470
23480
|
*/
|
|
23471
23481
|
if (channelWithIsDeletedTrue.length !== 0)
|
|
23472
|
-
await getChannelByIds(channelWithIsDeletedTrue);
|
|
23482
|
+
await getChannelByIds$1(channelWithIsDeletedTrue);
|
|
23473
23483
|
if (subChannelWithIsDeletedTrue.length !== 0)
|
|
23474
23484
|
await getSubChannels$1(subChannelWithIsDeletedTrue);
|
|
23475
23485
|
}
|
|
@@ -23895,6 +23905,86 @@ const onOffline = (callback) => {
|
|
|
23895
23905
|
return () => console.error('Unsupported environment');
|
|
23896
23906
|
};
|
|
23897
23907
|
|
|
23908
|
+
/**
|
|
23909
|
+
* ```js
|
|
23910
|
+
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
23911
|
+
* const channels = await getChannelByIds(['foo', 'bar'])
|
|
23912
|
+
* ```
|
|
23913
|
+
*
|
|
23914
|
+
* Fetches a collection of {@link Amity.Channel} objects
|
|
23915
|
+
*
|
|
23916
|
+
* @param channelIds the IDs of the {@link Amity.Channel} to fetch
|
|
23917
|
+
* @returns the associated collection of {@link Amity.Channel} objects
|
|
23918
|
+
*
|
|
23919
|
+
* @category Channel API
|
|
23920
|
+
* @async
|
|
23921
|
+
*/
|
|
23922
|
+
const getChannelByIds = async (channelIds) => {
|
|
23923
|
+
const client = getActiveClient();
|
|
23924
|
+
client.log('channel/getChannelByIds', channelIds);
|
|
23925
|
+
const encodedChannelIds = channelIds.map(channelId => encodeURIComponent(channelId));
|
|
23926
|
+
let payload;
|
|
23927
|
+
try {
|
|
23928
|
+
// API-FIX: endpoint should not be /list, parameters should be querystring.
|
|
23929
|
+
const response = await client.http.get(`/api/v3/channels/list`, {
|
|
23930
|
+
params: { channelIds: encodedChannelIds },
|
|
23931
|
+
});
|
|
23932
|
+
payload = response.data;
|
|
23933
|
+
}
|
|
23934
|
+
catch (error) {
|
|
23935
|
+
channelIds.forEach(channelId => {
|
|
23936
|
+
if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
|
|
23937
|
+
// NOTE: use channelPublicId as tombstone cache key since we cannot get the channelPrivateId that come along with channel data from server
|
|
23938
|
+
pushToTombstone('channel', channelId);
|
|
23939
|
+
}
|
|
23940
|
+
});
|
|
23941
|
+
throw error;
|
|
23942
|
+
}
|
|
23943
|
+
const data = await prepareChannelPayload(payload);
|
|
23944
|
+
if (client.isUnreadCountEnabled && client.getMarkerSyncConsistentMode()) {
|
|
23945
|
+
await prepareUnreadCountInfo(payload);
|
|
23946
|
+
}
|
|
23947
|
+
const cachedAt = client.cache && Date.now();
|
|
23948
|
+
if (client.cache)
|
|
23949
|
+
ingestInCache(data, { cachedAt });
|
|
23950
|
+
fireEvent('local.channel.fetched', data.channels);
|
|
23951
|
+
return {
|
|
23952
|
+
data: data.channels,
|
|
23953
|
+
cachedAt,
|
|
23954
|
+
};
|
|
23955
|
+
};
|
|
23956
|
+
/**
|
|
23957
|
+
* ```js
|
|
23958
|
+
* import { getChannelByIds } from '@amityco/ts-sdk'
|
|
23959
|
+
* const channels = getChannelByIds.locally(['foo', 'bar']) ?? []
|
|
23960
|
+
* ```
|
|
23961
|
+
*
|
|
23962
|
+
* Fetches a collection of {@link Amity.Channel} objects from cache
|
|
23963
|
+
*
|
|
23964
|
+
* @param channelIds the IDs of the {@link Amity.Channel} to fetch
|
|
23965
|
+
* @returns the associated collection of {@link Amity.Channel} objects
|
|
23966
|
+
*
|
|
23967
|
+
* @category Channel API
|
|
23968
|
+
*/
|
|
23969
|
+
getChannelByIds.locally = (channelIds) => {
|
|
23970
|
+
var _a, _b;
|
|
23971
|
+
const client = getActiveClient();
|
|
23972
|
+
client.log('channel/getChannelByIds.locally', channelIds);
|
|
23973
|
+
if (!client.cache)
|
|
23974
|
+
return;
|
|
23975
|
+
const cached = (_a = queryCache(['channel', 'get'])) === null || _a === void 0 ? void 0 : _a.filter(({ data }) => {
|
|
23976
|
+
return channelIds.includes(data.channelPublicId);
|
|
23977
|
+
});
|
|
23978
|
+
if (!cached || (cached === null || cached === void 0 ? void 0 : cached.length) < channelIds.length)
|
|
23979
|
+
return;
|
|
23980
|
+
const channels = cached.map(({ data }) => data);
|
|
23981
|
+
const oldest = (_b = cached.sort((a, b) => (a.cachedAt < b.cachedAt ? -1 : 1))) === null || _b === void 0 ? void 0 : _b[0];
|
|
23982
|
+
return {
|
|
23983
|
+
data: channels,
|
|
23984
|
+
cachedAt: oldest.cachedAt,
|
|
23985
|
+
};
|
|
23986
|
+
};
|
|
23987
|
+
|
|
23898
23988
|
const resolveChannels = async (channelIds) => {
|
|
23899
23989
|
var _a, _b, _c;
|
|
23900
23990
|
await getChannelByIds(channelIds);
|
|
@@ -30939,9 +31029,13 @@ const createMessageOptimistic = (bundle) => {
|
|
|
30939
31029
|
if (subChannel) {
|
|
30940
31030
|
upsertInCache(['subChannel', 'get', bundle.subChannelId], Object.assign(Object.assign({}, subChannel.data), { messageCount: subChannel.data.messageCount + 1 }));
|
|
30941
31031
|
if (subChannel.data.channelId === subChannel.data.subChannelId) {
|
|
30942
|
-
const channel = pullFromCache([
|
|
31032
|
+
const channel = pullFromCache([
|
|
31033
|
+
'channel',
|
|
31034
|
+
'get',
|
|
31035
|
+
subChannel.data.channelId,
|
|
31036
|
+
]);
|
|
30943
31037
|
if (channel === null || channel === void 0 ? void 0 : channel.data) {
|
|
30944
|
-
upsertInCache(['channel', 'get', subChannel.data.channelId], Object.assign(Object.assign({}, channel.data), { messageCount: ((_a =
|
|
31038
|
+
upsertInCache(['channel', 'get', subChannel.data.channelId], Object.assign(Object.assign({}, channel.data), { messageCount: ((_a = channel.data.messageCount) !== null && _a !== void 0 ? _a : 0) + 1 }));
|
|
30945
31039
|
}
|
|
30946
31040
|
}
|
|
30947
31041
|
}
|
|
@@ -31913,7 +32007,6 @@ class MessageLiveCollectionController extends LiveCollectionController {
|
|
|
31913
32007
|
}
|
|
31914
32008
|
}
|
|
31915
32009
|
|
|
31916
|
-
/* eslint-disable no-use-before-define */
|
|
31917
32010
|
/* begin_public_function
|
|
31918
32011
|
id: message.query
|
|
31919
32012
|
*/
|
|
@@ -32547,9 +32640,7 @@ const getChannel = (channelId, callback) => {
|
|
|
32547
32640
|
const reactor = async (response) => {
|
|
32548
32641
|
if (!response.data)
|
|
32549
32642
|
return callback(response);
|
|
32550
|
-
const data = Object.assign(Object.assign({}, response), {
|
|
32551
|
-
// TODO: refactor to be a function to construct public channel object
|
|
32552
|
-
data: LinkedObject.channel(constructChannelDynamicValue(getChannelMessagePreviewWithUser(response.data))) });
|
|
32643
|
+
const data = Object.assign(Object.assign({}, response), { data: constructChannelObject(response.data) });
|
|
32553
32644
|
const newSnapshot = __rest(data, ["origin"]);
|
|
32554
32645
|
/**
|
|
32555
32646
|
* check equality of previous data and current data to avoid redundancy
|
|
@@ -32583,7 +32674,11 @@ const getChannel = (channelId, callback) => {
|
|
|
32583
32674
|
if (message.channelId !== channelId)
|
|
32584
32675
|
return;
|
|
32585
32676
|
// channelId from message is channelInternalId
|
|
32586
|
-
const channel = (_a = pullFromCache([
|
|
32677
|
+
const channel = (_a = pullFromCache([
|
|
32678
|
+
'channel',
|
|
32679
|
+
'get',
|
|
32680
|
+
channelId,
|
|
32681
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
32587
32682
|
if (!channel)
|
|
32588
32683
|
return;
|
|
32589
32684
|
updateChannelCache(channel, {
|
|
@@ -32606,7 +32701,11 @@ const getChannel = (channelId, callback) => {
|
|
|
32606
32701
|
if (message.channelId !== channelId)
|
|
32607
32702
|
return;
|
|
32608
32703
|
// channelId from message is channelInternalId
|
|
32609
|
-
const channel = (_a = pullFromCache([
|
|
32704
|
+
const channel = (_a = pullFromCache([
|
|
32705
|
+
'channel',
|
|
32706
|
+
'get',
|
|
32707
|
+
channelId,
|
|
32708
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
32610
32709
|
if (!channel)
|
|
32611
32710
|
return;
|
|
32612
32711
|
updateChannelCache(channel, {
|
|
@@ -32619,7 +32718,11 @@ const getChannel = (channelId, callback) => {
|
|
|
32619
32718
|
convertEventPayload((callback) => {
|
|
32620
32719
|
const updateMessagePreview = async (message) => {
|
|
32621
32720
|
var _a;
|
|
32622
|
-
const channel = (_a = pullFromCache([
|
|
32721
|
+
const channel = (_a = pullFromCache([
|
|
32722
|
+
'channel',
|
|
32723
|
+
'get',
|
|
32724
|
+
channelId,
|
|
32725
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
32623
32726
|
if (!channel || channel.messagePreviewId !== message.messageId)
|
|
32624
32727
|
return;
|
|
32625
32728
|
const messagePreviewSetting = await client.getMessagePreviewSetting(false);
|
|
@@ -32633,7 +32736,11 @@ const getChannel = (channelId, callback) => {
|
|
|
32633
32736
|
convertEventPayload((callback) => {
|
|
32634
32737
|
const updateMessagePreview = async (message) => {
|
|
32635
32738
|
var _a;
|
|
32636
|
-
const channel = (_a = pullFromCache([
|
|
32739
|
+
const channel = (_a = pullFromCache([
|
|
32740
|
+
'channel',
|
|
32741
|
+
'get',
|
|
32742
|
+
channelId,
|
|
32743
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
32637
32744
|
if (!channel || channel.messagePreviewId !== message.messageId)
|
|
32638
32745
|
return;
|
|
32639
32746
|
const messagePreviewSetting = await client.getMessagePreviewSetting(false);
|
|
@@ -32666,7 +32773,11 @@ const getChannel = (channelId, callback) => {
|
|
|
32666
32773
|
if (messagePreviewSetting === "no-message-preview" /* Amity.MessagePreviewSetting.NO_MESSAGE_PREVIEW */)
|
|
32667
32774
|
return;
|
|
32668
32775
|
await getChannel$1(channelId);
|
|
32669
|
-
const channel = (_b = pullFromCache([
|
|
32776
|
+
const channel = (_b = pullFromCache([
|
|
32777
|
+
'channel',
|
|
32778
|
+
'get',
|
|
32779
|
+
channelId,
|
|
32780
|
+
])) === null || _b === void 0 ? void 0 : _b.data;
|
|
32670
32781
|
if (!channel)
|
|
32671
32782
|
return;
|
|
32672
32783
|
callback(subChannel);
|
|
@@ -32688,7 +32799,11 @@ const getChannel = (channelId, callback) => {
|
|
|
32688
32799
|
if (!messagePreviewCache ||
|
|
32689
32800
|
messagePreviewCache.subChannelId !== subChannel.subChannelId)
|
|
32690
32801
|
return;
|
|
32691
|
-
const channel = (_b = pullFromCache([
|
|
32802
|
+
const channel = (_b = pullFromCache([
|
|
32803
|
+
'channel',
|
|
32804
|
+
'get',
|
|
32805
|
+
channelId,
|
|
32806
|
+
])) === null || _b === void 0 ? void 0 : _b.data;
|
|
32692
32807
|
if (!channel)
|
|
32693
32808
|
return;
|
|
32694
32809
|
callback(subChannel);
|
|
@@ -32884,12 +32999,7 @@ class ChannelLiveCollectionController extends LiveCollectionController {
|
|
|
32884
32999
|
.map(channelId => pullFromCache(['channel', 'get', channelId]))
|
|
32885
33000
|
.filter(Boolean)
|
|
32886
33001
|
.map(({ data }) => data)
|
|
32887
|
-
|
|
32888
|
-
.map(getChannelMessagePreviewWithUser)
|
|
32889
|
-
// construct getter value >> Amity.StaticInternalChannel -> Amity.Channel
|
|
32890
|
-
.map(constructChannelDynamicValue)
|
|
32891
|
-
// add markAsRead >> Amity.InternalChannel -> Amity.Channel
|
|
32892
|
-
.map(LinkedObject.channel)) !== null && _b !== void 0 ? _b : [];
|
|
33002
|
+
.map(constructChannelObject)) !== null && _b !== void 0 ? _b : [];
|
|
32893
33003
|
if (this.paginationController instanceof ChannelPaginationController) {
|
|
32894
33004
|
data = this.applyFilter(data);
|
|
32895
33005
|
}
|
|
@@ -33860,7 +33970,7 @@ var index$c = /*#__PURE__*/Object.freeze({
|
|
|
33860
33970
|
__proto__: null,
|
|
33861
33971
|
Membership: index$e,
|
|
33862
33972
|
Moderation: index$d,
|
|
33863
|
-
getChannelByIds: getChannelByIds,
|
|
33973
|
+
getChannelByIds: getChannelByIds$1,
|
|
33864
33974
|
createChannel: createChannel,
|
|
33865
33975
|
updateChannel: updateChannel,
|
|
33866
33976
|
deleteChannel: deleteChannel,
|