@amityco/ts-sdk 7.1.0 → 7.1.1-207e990f.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/.env +26 -26
- package/dist/@types/core/events.d.ts +2 -1
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/model.d.ts +2 -0
- package/dist/@types/core/model.d.ts.map +1 -1
- package/dist/@types/core/readReceipt.d.ts +12 -1
- package/dist/@types/core/readReceipt.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +10 -0
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +1 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/channelRepository/api/markChannelsAsReadBySegment.d.ts +16 -0
- package/dist/channelRepository/api/markChannelsAsReadBySegment.d.ts.map +1 -0
- package/dist/channelRepository/events/onChannelDeleted.d.ts.map +1 -1
- package/dist/channelRepository/events/onChannelLeft.d.ts.map +1 -1
- package/dist/{marker → channelRepository}/events/onChannelUnreadUpdatedLocal.d.ts +2 -2
- package/dist/channelRepository/events/onChannelUnreadUpdatedLocal.d.ts.map +1 -0
- 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/constructChannelDynamicValue.d.ts.map +1 -1
- package/dist/channelRepository/utils/getLegacyChannelUnread.d.ts +2 -0
- package/dist/channelRepository/utils/getLegacyChannelUnread.d.ts.map +1 -0
- package/dist/channelRepository/utils/prepareChannelPayload.d.ts.map +1 -1
- package/dist/client/api/createClient.d.ts.map +1 -1
- package/dist/client/api/enableUnreadCount.d.ts.map +1 -1
- package/dist/client/api/login.d.ts.map +1 -1
- package/dist/client/utils/ReadReceiptSync/legacyReadReceiptSyncEngine.d.ts +33 -0
- package/dist/client/utils/ReadReceiptSync/legacyReadReceiptSyncEngine.d.ts.map +1 -0
- package/dist/client/utils/ReadReceiptSync/legacyReadReceiptSyncEngineOnLoginHandler.d.ts +3 -0
- package/dist/client/utils/ReadReceiptSync/legacyReadReceiptSyncEngineOnLoginHandler.d.ts.map +1 -0
- package/dist/client/utils/ReadReceiptSync/readReceiptSyncEngine.d.ts +2 -4
- package/dist/client/utils/ReadReceiptSync/readReceiptSyncEngine.d.ts.map +1 -1
- package/dist/core/events.d.ts +3 -3
- package/dist/core/events.d.ts.map +1 -1
- package/dist/core/model/idResolvers.d.ts.map +1 -1
- package/dist/index.cjs.js +407 -50
- package/dist/index.esm.js +407 -50
- package/dist/index.umd.js +4 -4
- package/dist/marker/events/onChannelUnreadInfoUpdatedLocal.d.ts +12 -0
- package/dist/marker/events/onChannelUnreadInfoUpdatedLocal.d.ts.map +1 -0
- package/dist/messageRepository/events/onMessageCreated.d.ts.map +1 -1
- package/dist/messageRepository/utils/markReadMessage.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/@types/core/events.ts +2 -1
- package/src/@types/core/model.ts +4 -0
- package/src/@types/core/readReceipt.ts +14 -1
- package/src/@types/domains/channel.ts +13 -0
- package/src/@types/domains/client.ts +2 -0
- package/src/channelRepository/api/markChannelsAsReadBySegment.ts +29 -0
- package/src/channelRepository/events/onChannelDeleted.ts +17 -4
- package/src/channelRepository/events/onChannelLeft.ts +11 -3
- package/src/{marker → channelRepository}/events/onChannelUnreadUpdatedLocal.ts +3 -3
- package/src/channelRepository/observers/getChannel.ts +3 -1
- package/src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts +6 -1
- package/src/channelRepository/utils/constructChannelDynamicValue.ts +12 -2
- package/src/channelRepository/utils/getLegacyChannelUnread.ts +5 -0
- package/src/channelRepository/utils/prepareChannelPayload.ts +57 -17
- package/src/client/api/createClient.ts +3 -0
- package/src/client/api/enableUnreadCount.ts +1 -0
- package/src/client/api/login.ts +5 -1
- package/src/client/utils/ReadReceiptSync/legacyReadReceiptSyncEngine.ts +267 -0
- package/src/client/utils/ReadReceiptSync/legacyReadReceiptSyncEngineOnLoginHandler.ts +21 -0
- package/src/client/utils/ReadReceiptSync/readReceiptSyncEngine.ts +70 -99
- package/src/core/model/idResolvers.ts +2 -0
- package/src/marker/events/onChannelUnreadInfoUpdatedLocal.ts +29 -0
- package/src/messageRepository/events/onMessageCreated.ts +34 -0
- package/src/messageRepository/utils/markReadMessage.ts +10 -3
- package/dist/marker/events/onChannelUnreadUpdatedLocal.d.ts.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -516,6 +516,7 @@ const idResolvers = {
|
|
|
516
516
|
messagePreviewSubChannel: ({ subChannelId }) => `${subChannelId}`,
|
|
517
517
|
channelUnreadInfo: ({ channelId }) => channelId,
|
|
518
518
|
subChannelUnreadInfo: ({ subChannelId }) => subChannelId,
|
|
519
|
+
channelUnread: ({ channelId }) => channelId,
|
|
519
520
|
channelMarker: ({ entityId, userId }) => `${entityId}#${userId}`,
|
|
520
521
|
subChannelMarker: ({ entityId, feedId, userId }) => `${entityId}#${feedId}#${userId}`,
|
|
521
522
|
messageMarker: ({ feedId, contentId, creatorId }) => `${feedId}#${contentId}#${creatorId}`,
|
|
@@ -1609,13 +1610,13 @@ class NetworkActivitiesWatcher {
|
|
|
1609
1610
|
this._listener.clear();
|
|
1610
1611
|
}
|
|
1611
1612
|
}
|
|
1612
|
-
let instance$
|
|
1613
|
+
let instance$6;
|
|
1613
1614
|
var NetworkActivitiesWatcher$1 = {
|
|
1614
1615
|
getInstance: () => {
|
|
1615
|
-
if (!instance$
|
|
1616
|
-
instance$
|
|
1616
|
+
if (!instance$6) {
|
|
1617
|
+
instance$6 = new NetworkActivitiesWatcher();
|
|
1617
1618
|
}
|
|
1618
|
-
return instance$
|
|
1619
|
+
return instance$6;
|
|
1619
1620
|
},
|
|
1620
1621
|
};
|
|
1621
1622
|
|
|
@@ -5148,13 +5149,13 @@ class AnalyticsEngine {
|
|
|
5148
5149
|
this._eventCapturer.resetAllBuckets();
|
|
5149
5150
|
}
|
|
5150
5151
|
}
|
|
5151
|
-
let instance$
|
|
5152
|
+
let instance$5;
|
|
5152
5153
|
var AnalyticsEngine$1 = {
|
|
5153
5154
|
getInstance: () => {
|
|
5154
|
-
if (!instance$
|
|
5155
|
-
instance$
|
|
5155
|
+
if (!instance$5) {
|
|
5156
|
+
instance$5 = new AnalyticsEngine();
|
|
5156
5157
|
}
|
|
5157
|
-
return instance$
|
|
5158
|
+
return instance$5;
|
|
5158
5159
|
},
|
|
5159
5160
|
};
|
|
5160
5161
|
|
|
@@ -5580,6 +5581,221 @@ const getMessageReadCount = (message, marker) => {
|
|
|
5580
5581
|
getCachedMarker$2(message)) !== null && _a !== void 0 ? _a : { readCount: 0, deliveredCount: 0 };
|
|
5581
5582
|
}; // and if not found in cache use default value `0`
|
|
5582
5583
|
|
|
5584
|
+
/**
|
|
5585
|
+
*
|
|
5586
|
+
* Mark subChannel as read by readToSegment
|
|
5587
|
+
*
|
|
5588
|
+
* @param subChannelIds the IDs of the {@link Amity.SubChannel} to update
|
|
5589
|
+
* @param readToSegment the segment to mark as read
|
|
5590
|
+
* @returns a success boolean if the {@link Amity.SubChannel} was updated
|
|
5591
|
+
*
|
|
5592
|
+
* @category Channel API
|
|
5593
|
+
* @async
|
|
5594
|
+
*/
|
|
5595
|
+
const markChannelsAsReadBySegment = async (readings) => {
|
|
5596
|
+
const client = getActiveClient();
|
|
5597
|
+
try {
|
|
5598
|
+
await client.http.post('api/v3/channels/seen', { channels: readings });
|
|
5599
|
+
return true;
|
|
5600
|
+
}
|
|
5601
|
+
catch (e) {
|
|
5602
|
+
return false;
|
|
5603
|
+
}
|
|
5604
|
+
};
|
|
5605
|
+
|
|
5606
|
+
class MessageReadReceiptSyncEngine {
|
|
5607
|
+
constructor() {
|
|
5608
|
+
this.isActive = true;
|
|
5609
|
+
this.MAX_RETRY = 3;
|
|
5610
|
+
this.JOB_QUEUE_SIZE = 120;
|
|
5611
|
+
this.jobQueue = [];
|
|
5612
|
+
// Interval for message read receipt sync in seconds
|
|
5613
|
+
this.RECEIPT_SYNC_INTERVAL = 1;
|
|
5614
|
+
this.client = getActiveClient();
|
|
5615
|
+
// Get remaining unsync read receipts from cache
|
|
5616
|
+
this.getUnsyncJobs();
|
|
5617
|
+
}
|
|
5618
|
+
// Call this when client call client.login
|
|
5619
|
+
startSyncReadReceipt() {
|
|
5620
|
+
// Start timer when start receipt sync
|
|
5621
|
+
this.timer = setInterval(() => {
|
|
5622
|
+
this.syncReadReceipts();
|
|
5623
|
+
}, this.RECEIPT_SYNC_INTERVAL * 1000);
|
|
5624
|
+
}
|
|
5625
|
+
// Read receipt observer handling
|
|
5626
|
+
syncReadReceipts() {
|
|
5627
|
+
if (this.jobQueue.length === 0 || this.isActive === false)
|
|
5628
|
+
return;
|
|
5629
|
+
const readReceipts = this.getReadReceipts();
|
|
5630
|
+
if (readReceipts) {
|
|
5631
|
+
this.markReadApi(readReceipts);
|
|
5632
|
+
}
|
|
5633
|
+
}
|
|
5634
|
+
getUnsyncJobs() {
|
|
5635
|
+
var _a;
|
|
5636
|
+
// Get all read receipts that has latestSyncSegment < latestSegment
|
|
5637
|
+
const readReceipts = (_a = queryCache(['readReceipt'])) === null || _a === void 0 ? void 0 : _a.filter(({ data }) => {
|
|
5638
|
+
return data.latestSyncSegment < data.latestSegment;
|
|
5639
|
+
});
|
|
5640
|
+
// Enqueue unsync read receipts to the job queue
|
|
5641
|
+
readReceipts === null || readReceipts === void 0 ? void 0 : readReceipts.forEach(({ data: readReceipt }) => {
|
|
5642
|
+
this.enqueueReadReceipt(readReceipt.channelId, readReceipt.latestSegment);
|
|
5643
|
+
});
|
|
5644
|
+
}
|
|
5645
|
+
getReadReceipts() {
|
|
5646
|
+
// get all read receipts from queue, now the queue is empty
|
|
5647
|
+
const syncJob = this.jobQueue.splice(0, this.jobQueue.length);
|
|
5648
|
+
if (syncJob.length === 0)
|
|
5649
|
+
return;
|
|
5650
|
+
return syncJob.filter(job => {
|
|
5651
|
+
var _a;
|
|
5652
|
+
const readReceipt = (_a = pullFromCache(['readReceipt', job.channelId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
5653
|
+
if (!readReceipt)
|
|
5654
|
+
return false;
|
|
5655
|
+
if (readReceipt.latestSegment > readReceipt.latestSyncSegment)
|
|
5656
|
+
return true;
|
|
5657
|
+
return false;
|
|
5658
|
+
});
|
|
5659
|
+
}
|
|
5660
|
+
async markReadApi(syncJobs) {
|
|
5661
|
+
var _a;
|
|
5662
|
+
// constuct payload
|
|
5663
|
+
// example: [{ channelId: 'channelId', readToSegment: 2 }]
|
|
5664
|
+
const syncJobsPayload = syncJobs.map(job => {
|
|
5665
|
+
return {
|
|
5666
|
+
channelId: job.channelId,
|
|
5667
|
+
readToSegment: job.segment,
|
|
5668
|
+
};
|
|
5669
|
+
});
|
|
5670
|
+
const response = await markChannelsAsReadBySegment(syncJobsPayload);
|
|
5671
|
+
if (response) {
|
|
5672
|
+
for (let i = 0; i < syncJobs.length; i += 1) {
|
|
5673
|
+
// update lastestSyncSegment in read receipt cache
|
|
5674
|
+
const cacheKey = ['readReceipt', syncJobs[i].channelId];
|
|
5675
|
+
const readReceiptCache = (_a = pullFromCache(cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
5676
|
+
pushToCache(cacheKey, Object.assign(Object.assign({}, readReceiptCache), { latestSyncSegment: syncJobs[i].segment }));
|
|
5677
|
+
}
|
|
5678
|
+
}
|
|
5679
|
+
else {
|
|
5680
|
+
for (let i = 0; i < syncJobs.length; i += 1) {
|
|
5681
|
+
// push them back to queue if the syncing is failed and retry count is less than max retry
|
|
5682
|
+
if (syncJobs[i].retryCount >= this.MAX_RETRY)
|
|
5683
|
+
return;
|
|
5684
|
+
const updatedJob = Object.assign(Object.assign({}, syncJobs[i]), { syncState: "create" /* Amity.ReadReceiptSyncState.CREATED */, retryCount: syncJobs[i].retryCount + 1 });
|
|
5685
|
+
this.enqueueJob(updatedJob);
|
|
5686
|
+
}
|
|
5687
|
+
}
|
|
5688
|
+
}
|
|
5689
|
+
startObservingReadReceiptQueue() {
|
|
5690
|
+
if (this.client.useLegacyUnreadCount) {
|
|
5691
|
+
this.isActive = true;
|
|
5692
|
+
this.startSyncReadReceipt();
|
|
5693
|
+
}
|
|
5694
|
+
}
|
|
5695
|
+
stopObservingReadReceiptQueue() {
|
|
5696
|
+
this.isActive = false;
|
|
5697
|
+
this.jobQueue.map(job => {
|
|
5698
|
+
if (job.syncState === "syncing" /* Amity.ReadReceiptSyncState.SYNCING */) {
|
|
5699
|
+
return Object.assign(Object.assign({}, job), { syncState: "create" /* Amity.ReadReceiptSyncState.CREATED */ });
|
|
5700
|
+
}
|
|
5701
|
+
return job;
|
|
5702
|
+
});
|
|
5703
|
+
if (this.timer)
|
|
5704
|
+
clearInterval(this.timer);
|
|
5705
|
+
}
|
|
5706
|
+
// Session Management
|
|
5707
|
+
onSessionEstablished() {
|
|
5708
|
+
this.startObservingReadReceiptQueue();
|
|
5709
|
+
}
|
|
5710
|
+
onSessionDestroyed() {
|
|
5711
|
+
this.stopObservingReadReceiptQueue();
|
|
5712
|
+
this.jobQueue = [];
|
|
5713
|
+
}
|
|
5714
|
+
onTokenExpired() {
|
|
5715
|
+
this.stopObservingReadReceiptQueue();
|
|
5716
|
+
}
|
|
5717
|
+
// Network Connection Management
|
|
5718
|
+
onNetworkOffline() {
|
|
5719
|
+
// Stop observing to the read receipt queue.
|
|
5720
|
+
this.stopObservingReadReceiptQueue();
|
|
5721
|
+
}
|
|
5722
|
+
onNetworkOnline() {
|
|
5723
|
+
// Resume observing to the read receipt queue.
|
|
5724
|
+
this.startObservingReadReceiptQueue();
|
|
5725
|
+
}
|
|
5726
|
+
markRead(channelId, segment) {
|
|
5727
|
+
var _a;
|
|
5728
|
+
// Step 1: Optimistic update of channelUnread.readToSegment to message.segment and update unreadCount value
|
|
5729
|
+
const cacheKey = ['channelUnread', 'get', channelId];
|
|
5730
|
+
const channelUnread = (_a = pullFromCache(cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
5731
|
+
if (channelUnread && segment > channelUnread.readToSegment) {
|
|
5732
|
+
channelUnread.readToSegment = segment;
|
|
5733
|
+
channelUnread.unreadCount = Math.max(channelUnread.lastSegment - segment, 0);
|
|
5734
|
+
pushToCache(cacheKey, channelUnread);
|
|
5735
|
+
fireEvent('local.channelUnread.updated', channelUnread);
|
|
5736
|
+
}
|
|
5737
|
+
// Step 2: Enqueue the read receipt
|
|
5738
|
+
this.enqueueReadReceipt(channelId, segment);
|
|
5739
|
+
}
|
|
5740
|
+
enqueueReadReceipt(channelId, segment) {
|
|
5741
|
+
var _a;
|
|
5742
|
+
const readReceipt = (_a = pullFromCache(['readReceipt', channelId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
5743
|
+
// Create new read receipt if it's not exists and add the job to queue
|
|
5744
|
+
if (!readReceipt) {
|
|
5745
|
+
const readReceiptChannel = {
|
|
5746
|
+
channelId,
|
|
5747
|
+
latestSegment: segment,
|
|
5748
|
+
latestSyncSegment: 0,
|
|
5749
|
+
};
|
|
5750
|
+
pushToCache(['readReceipt', channelId], readReceiptChannel);
|
|
5751
|
+
}
|
|
5752
|
+
else if (readReceipt.latestSegment < segment) {
|
|
5753
|
+
// Update latestSegment in read receipt cache
|
|
5754
|
+
pushToCache(['readReceipt', channelId], Object.assign(Object.assign({}, readReceipt), { latestSegment: segment }));
|
|
5755
|
+
}
|
|
5756
|
+
else if (readReceipt.latestSyncSegment >= segment) {
|
|
5757
|
+
// Skip the job when lastSyncSegment > = segment
|
|
5758
|
+
return;
|
|
5759
|
+
}
|
|
5760
|
+
let syncJob = this.getSyncJob(channelId);
|
|
5761
|
+
if (syncJob === null || syncJob.syncState === "syncing" /* Amity.ReadReceiptSyncState.SYNCING */) {
|
|
5762
|
+
syncJob = {
|
|
5763
|
+
channelId,
|
|
5764
|
+
segment,
|
|
5765
|
+
syncState: "create" /* Amity.ReadReceiptSyncState.CREATED */,
|
|
5766
|
+
retryCount: 0,
|
|
5767
|
+
};
|
|
5768
|
+
this.enqueueJob(syncJob);
|
|
5769
|
+
}
|
|
5770
|
+
else if (syncJob.segment < segment) {
|
|
5771
|
+
syncJob.segment = segment;
|
|
5772
|
+
}
|
|
5773
|
+
}
|
|
5774
|
+
getSyncJob(channelId) {
|
|
5775
|
+
const { jobQueue } = this;
|
|
5776
|
+
const targetJob = jobQueue.find(job => job.channelId === channelId);
|
|
5777
|
+
return targetJob || null;
|
|
5778
|
+
}
|
|
5779
|
+
enqueueJob(syncJob) {
|
|
5780
|
+
if (this.jobQueue.length < this.JOB_QUEUE_SIZE) {
|
|
5781
|
+
this.jobQueue.push(syncJob);
|
|
5782
|
+
}
|
|
5783
|
+
else {
|
|
5784
|
+
// Remove oldest job when queue reach maximum capacity
|
|
5785
|
+
this.jobQueue.shift();
|
|
5786
|
+
this.jobQueue.push(syncJob);
|
|
5787
|
+
}
|
|
5788
|
+
}
|
|
5789
|
+
}
|
|
5790
|
+
let instance$4 = null;
|
|
5791
|
+
var ReadReceiptSyncEngine = {
|
|
5792
|
+
getInstance: () => {
|
|
5793
|
+
if (!instance$4)
|
|
5794
|
+
instance$4 = new MessageReadReceiptSyncEngine();
|
|
5795
|
+
return instance$4;
|
|
5796
|
+
},
|
|
5797
|
+
};
|
|
5798
|
+
|
|
5583
5799
|
/**
|
|
5584
5800
|
*
|
|
5585
5801
|
* Mark subChannel as read by readToSegment
|
|
@@ -5628,7 +5844,7 @@ const reCalculateChannelUnreadInfo = (channelId) => {
|
|
|
5628
5844
|
return channelUnreadInfo;
|
|
5629
5845
|
};
|
|
5630
5846
|
|
|
5631
|
-
class
|
|
5847
|
+
class LegacyMessageReadReceiptSyncEngine {
|
|
5632
5848
|
constructor() {
|
|
5633
5849
|
this.isActive = true;
|
|
5634
5850
|
this.MAX_RETRY = 3;
|
|
@@ -5659,7 +5875,7 @@ class MessageReadReceiptSyncEngine {
|
|
|
5659
5875
|
getUnsyncJobs() {
|
|
5660
5876
|
var _a;
|
|
5661
5877
|
// Get all read receipts that has latestSyncSegment < latestSegment
|
|
5662
|
-
const readReceipts = (_a = queryCache(['
|
|
5878
|
+
const readReceipts = (_a = queryCache(['legacyReadReceipt'])) === null || _a === void 0 ? void 0 : _a.filter(({ data }) => {
|
|
5663
5879
|
return data.latestSyncSegment < data.latestSegment;
|
|
5664
5880
|
});
|
|
5665
5881
|
// Enqueue unsync read receipts to the job queue
|
|
@@ -5678,7 +5894,7 @@ class MessageReadReceiptSyncEngine {
|
|
|
5678
5894
|
return;
|
|
5679
5895
|
// Get readReceipt from cache by subChannelId
|
|
5680
5896
|
const readReceipt = (_a = pullFromCache([
|
|
5681
|
-
'
|
|
5897
|
+
'legacyReadReceipt',
|
|
5682
5898
|
syncJob.subChannelId,
|
|
5683
5899
|
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
5684
5900
|
if (!readReceipt)
|
|
@@ -5701,10 +5917,10 @@ class MessageReadReceiptSyncEngine {
|
|
|
5701
5917
|
if (response) {
|
|
5702
5918
|
this.removeSynedReceipt(syncJob.subChannelId, syncJob.segment);
|
|
5703
5919
|
const readReceiptCache = (_a = pullFromCache([
|
|
5704
|
-
'
|
|
5920
|
+
'legacyReadReceipt',
|
|
5705
5921
|
subChannelId,
|
|
5706
5922
|
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
5707
|
-
pushToCache(['
|
|
5923
|
+
pushToCache(['legacyReadReceipt', subChannelId], Object.assign(Object.assign({}, readReceiptCache), { latestSyncSegment: segment }));
|
|
5708
5924
|
}
|
|
5709
5925
|
else if (!response) {
|
|
5710
5926
|
if (newSyncJob.retryCount > this.MAX_RETRY) {
|
|
@@ -5771,7 +5987,7 @@ class MessageReadReceiptSyncEngine {
|
|
|
5771
5987
|
subChannelUnreadInfo.readToSegment = segment;
|
|
5772
5988
|
subChannelUnreadInfo.unreadCount = Math.max(subChannelUnreadInfo.lastSegment - segment, 0);
|
|
5773
5989
|
const channelUnreadInfo = reCalculateChannelUnreadInfo(subChannelUnreadInfo.channelId);
|
|
5774
|
-
fireEvent('local.
|
|
5990
|
+
fireEvent('local.channelUnreadInfo.updated', channelUnreadInfo);
|
|
5775
5991
|
pushToCache(cacheKey, subChannelUnreadInfo);
|
|
5776
5992
|
fireEvent('local.subChannelUnread.updated', subChannelUnreadInfo);
|
|
5777
5993
|
}
|
|
@@ -5780,7 +5996,10 @@ class MessageReadReceiptSyncEngine {
|
|
|
5780
5996
|
}
|
|
5781
5997
|
enqueueReadReceipt(subChannelId, segment) {
|
|
5782
5998
|
var _a;
|
|
5783
|
-
const readReceipt = (_a = pullFromCache([
|
|
5999
|
+
const readReceipt = (_a = pullFromCache([
|
|
6000
|
+
'legacyReadReceipt',
|
|
6001
|
+
subChannelId,
|
|
6002
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
5784
6003
|
// Create new read receipt if it's not exists and add job to queue
|
|
5785
6004
|
if (!readReceipt) {
|
|
5786
6005
|
const readReceiptSubChannel = {
|
|
@@ -5788,10 +6007,10 @@ class MessageReadReceiptSyncEngine {
|
|
|
5788
6007
|
latestSegment: segment,
|
|
5789
6008
|
latestSyncSegment: 0,
|
|
5790
6009
|
};
|
|
5791
|
-
pushToCache(['
|
|
6010
|
+
pushToCache(['legacyReadReceipt', subChannelId], readReceiptSubChannel);
|
|
5792
6011
|
}
|
|
5793
6012
|
else if (readReceipt.latestSegment < segment) {
|
|
5794
|
-
pushToCache(['
|
|
6013
|
+
pushToCache(['legacyReadReceipt', subChannelId], Object.assign(Object.assign({}, readReceipt), { latestSegment: segment }));
|
|
5795
6014
|
}
|
|
5796
6015
|
else if (readReceipt.latestSyncSegment >= segment) {
|
|
5797
6016
|
// Skip the job when lastSyncSegment > = segment
|
|
@@ -5834,18 +6053,24 @@ class MessageReadReceiptSyncEngine {
|
|
|
5834
6053
|
}
|
|
5835
6054
|
}
|
|
5836
6055
|
let instance$3 = null;
|
|
5837
|
-
var
|
|
6056
|
+
var LegacyReadReceiptSyncEngine = {
|
|
5838
6057
|
getInstance: () => {
|
|
5839
6058
|
if (!instance$3)
|
|
5840
|
-
instance$3 = new
|
|
6059
|
+
instance$3 = new LegacyMessageReadReceiptSyncEngine();
|
|
5841
6060
|
return instance$3;
|
|
5842
6061
|
},
|
|
5843
6062
|
};
|
|
5844
6063
|
|
|
5845
6064
|
const markReadMessage = (message) => {
|
|
5846
|
-
const
|
|
5847
|
-
|
|
5848
|
-
|
|
6065
|
+
const client = getActiveClient();
|
|
6066
|
+
if (client.useLegacyUnreadCount) {
|
|
6067
|
+
const markReadReceiptEngine = ReadReceiptSyncEngine.getInstance();
|
|
6068
|
+
markReadReceiptEngine.markRead(message.channelId, message.channelSegment);
|
|
6069
|
+
}
|
|
6070
|
+
else {
|
|
6071
|
+
const markReadReceiptEngine = LegacyReadReceiptSyncEngine.getInstance();
|
|
6072
|
+
markReadReceiptEngine.markRead(message.subChannelId, message.channelSegment);
|
|
6073
|
+
}
|
|
5849
6074
|
};
|
|
5850
6075
|
|
|
5851
6076
|
const messageLinkedObject = (message) => {
|
|
@@ -6833,6 +7058,24 @@ const preUpdateChannelCache = (rawPayload, options = { isMessagePreviewUpdated:
|
|
|
6833
7058
|
channels: rawPayload.channels.map(channel => convertFromRaw(channel, { isMessagePreviewUpdated: options.isMessagePreviewUpdated })),
|
|
6834
7059
|
});
|
|
6835
7060
|
};
|
|
7061
|
+
const updateChannelUnread = ({ currentUserId, channels, channelUsers, }) => {
|
|
7062
|
+
for (let i = 0; i < channels.length; i += 1) {
|
|
7063
|
+
const cacheKey = ['channelUnread', 'get', channels[i].channelId];
|
|
7064
|
+
const { readToSegment, lastMentionedSegment } = channelUsers.find(channelUser => channelUser.channelId === channels[i].channelId && channelUser.userId === currentUserId) || {
|
|
7065
|
+
readToSegment: 0,
|
|
7066
|
+
lastMentionedSegment: 0,
|
|
7067
|
+
};
|
|
7068
|
+
pushToCache(cacheKey, {
|
|
7069
|
+
channelId: channels[i].channelId,
|
|
7070
|
+
lastSegment: channels[i].messageCount,
|
|
7071
|
+
readToSegment,
|
|
7072
|
+
lastMentionedSegment,
|
|
7073
|
+
unreadCount: channels[i].messageCount - readToSegment,
|
|
7074
|
+
isMentioned: lastMentionedSegment > readToSegment,
|
|
7075
|
+
isDeleted: channels[i].isDeleted,
|
|
7076
|
+
});
|
|
7077
|
+
}
|
|
7078
|
+
};
|
|
6836
7079
|
const prepareChannelPayload = async (rawPayload, options = { isMessagePreviewUpdated: true }) => {
|
|
6837
7080
|
const client = getActiveClient();
|
|
6838
7081
|
const networkPreviewSetting = await client.getMessagePreviewSetting(false);
|
|
@@ -6842,23 +7085,34 @@ const prepareChannelPayload = async (rawPayload, options = { isMessagePreviewUpd
|
|
|
6842
7085
|
rawPayload.messagePreviews.length > 0) {
|
|
6843
7086
|
updateChannelMessagePreviewCache(rawPayload);
|
|
6844
7087
|
}
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
7088
|
+
if (client.useLegacyUnreadCount) {
|
|
7089
|
+
updateChannelUnread({
|
|
7090
|
+
channels: rawPayload.channels,
|
|
7091
|
+
channelUsers: rawPayload.channelUsers,
|
|
7092
|
+
currentUserId: client.userId,
|
|
7093
|
+
});
|
|
7094
|
+
}
|
|
7095
|
+
else {
|
|
7096
|
+
const markerIds = rawPayload.channels
|
|
7097
|
+
// filter channel by type. Only conversation, community and broadcast type are included.
|
|
7098
|
+
.filter(isUnreadCountSupport)
|
|
7099
|
+
.map(({ channelInternalId }) => channelInternalId);
|
|
7100
|
+
if (markerIds.length > 0) {
|
|
7101
|
+
// since the get markers method requires a channel cache to function with the reducer.
|
|
7102
|
+
preUpdateChannelCache(rawPayload, {
|
|
7103
|
+
isMessagePreviewUpdated: options.isMessagePreviewUpdated,
|
|
7104
|
+
});
|
|
7105
|
+
try {
|
|
7106
|
+
await getChannelMarkers(markerIds);
|
|
7107
|
+
}
|
|
7108
|
+
catch (e) {
|
|
7109
|
+
// empty block (from the spec, allow marker fetch to fail without having to do anything)
|
|
7110
|
+
}
|
|
6857
7111
|
}
|
|
6858
7112
|
}
|
|
6859
|
-
//
|
|
7113
|
+
// convert raw channel to internal channel
|
|
6860
7114
|
const channels = rawPayload.channels.map(payload => convertFromRaw(payload, { isMessagePreviewUpdated: options.isMessagePreviewUpdated }));
|
|
6861
|
-
// user
|
|
7115
|
+
// convert raw channel user to membership (add user object)
|
|
6862
7116
|
const channelUsers = rawPayload.channelUsers.map(channelUser => {
|
|
6863
7117
|
return convertRawMembershipToMembership(channelUser);
|
|
6864
7118
|
});
|
|
@@ -6985,15 +7239,28 @@ const getSubChannelsUnreadCount = (channel, marker) => {
|
|
|
6985
7239
|
return (_e = (_c = marker === null || marker === void 0 ? void 0 : marker.unreadCount) !== null && _c !== void 0 ? _c : (_d = getCachedMarker(channel.channelInternalId)) === null || _d === void 0 ? void 0 : _d.unreadCount) !== null && _e !== void 0 ? _e : 0;
|
|
6986
7240
|
};
|
|
6987
7241
|
|
|
7242
|
+
const getLegacyChannelUnread = (channelId) => {
|
|
7243
|
+
var _a;
|
|
7244
|
+
return (_a = pullFromCache(['channelUnread', 'get', channelId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
7245
|
+
};
|
|
7246
|
+
|
|
6988
7247
|
const constructChannelDynamicValue = (channel) => {
|
|
7248
|
+
const client = getActiveClient();
|
|
6989
7249
|
const rest = __rest(channel, ["messageCount"]);
|
|
6990
7250
|
return shallowClone(rest, {
|
|
6991
|
-
get
|
|
6992
|
-
|
|
7251
|
+
get unreadCount() {
|
|
7252
|
+
var _a, _b;
|
|
7253
|
+
return (_b = (_a = getLegacyChannelUnread(rest.channelId)) === null || _a === void 0 ? void 0 : _a.unreadCount) !== null && _b !== void 0 ? _b : 0;
|
|
6993
7254
|
},
|
|
6994
7255
|
get subChannelsUnreadCount() {
|
|
6995
7256
|
return getSubChannelsUnreadCount(rest);
|
|
6996
7257
|
},
|
|
7258
|
+
get isMentioned() {
|
|
7259
|
+
var _a, _b;
|
|
7260
|
+
if (client.useLegacyUnreadCount)
|
|
7261
|
+
return (_b = (_a = getLegacyChannelUnread(rest.channelId)) === null || _a === void 0 ? void 0 : _a.isMentioned) !== null && _b !== void 0 ? _b : false;
|
|
7262
|
+
return getChannelIsMentioned(rest);
|
|
7263
|
+
},
|
|
6997
7264
|
});
|
|
6998
7265
|
};
|
|
6999
7266
|
|
|
@@ -7650,12 +7917,21 @@ const onChannelDeleted = (callback) => {
|
|
|
7650
7917
|
const client = getActiveClient();
|
|
7651
7918
|
const filter = async (payload) => {
|
|
7652
7919
|
const data = await prepareChannelPayload(payload);
|
|
7653
|
-
|
|
7654
|
-
|
|
7920
|
+
const isConsistentMode = client.getMarkerSyncConsistentMode() && client.isUnreadCountEnabled;
|
|
7921
|
+
const isLegacyUnreadCount = client.useLegacyUnreadCount;
|
|
7922
|
+
data.channels.forEach(channel => {
|
|
7923
|
+
if (isConsistentMode) {
|
|
7655
7924
|
addFlagIsDeletedSubChannelUnreadByChannelId(channel.channelId);
|
|
7656
7925
|
deleteChannelUnreadByChannelId(channel.channelId);
|
|
7657
|
-
}
|
|
7658
|
-
|
|
7926
|
+
}
|
|
7927
|
+
else if (isLegacyUnreadCount) {
|
|
7928
|
+
const cacheKey = ['channelUnread', 'get', channel.channelId];
|
|
7929
|
+
const cache = pullFromCache(cacheKey);
|
|
7930
|
+
if (cache) {
|
|
7931
|
+
pushToCache(cacheKey, Object.assign(Object.assign({}, cache), { isDeleted: true }));
|
|
7932
|
+
}
|
|
7933
|
+
}
|
|
7934
|
+
});
|
|
7659
7935
|
ingestInCache(data);
|
|
7660
7936
|
callbacks$b.forEach(cb => cb(data.channels[0]));
|
|
7661
7937
|
};
|
|
@@ -7769,6 +8045,25 @@ var readReceiptSyncEngineOnLoginHandler = () => {
|
|
|
7769
8045
|
};
|
|
7770
8046
|
};
|
|
7771
8047
|
|
|
8048
|
+
var legacyReadReceiptSyncEngineOnLoginHandler = () => {
|
|
8049
|
+
const readReceiptSyncEngine = LegacyReadReceiptSyncEngine.getInstance();
|
|
8050
|
+
readReceiptSyncEngine.startSyncReadReceipt();
|
|
8051
|
+
onSessionStateChange(state => {
|
|
8052
|
+
if (state === "established" /* Amity.SessionStates.ESTABLISHED */) {
|
|
8053
|
+
readReceiptSyncEngine.onSessionEstablished();
|
|
8054
|
+
}
|
|
8055
|
+
else if (state === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
8056
|
+
readReceiptSyncEngine.onTokenExpired();
|
|
8057
|
+
}
|
|
8058
|
+
else {
|
|
8059
|
+
readReceiptSyncEngine.onSessionDestroyed();
|
|
8060
|
+
}
|
|
8061
|
+
});
|
|
8062
|
+
return () => {
|
|
8063
|
+
readReceiptSyncEngine.onSessionDestroyed();
|
|
8064
|
+
};
|
|
8065
|
+
};
|
|
8066
|
+
|
|
7772
8067
|
const onOnline = (callback) => {
|
|
7773
8068
|
if (typeof window !== 'undefined' && window.addEventListener) {
|
|
7774
8069
|
window.addEventListener('online', callback);
|
|
@@ -8335,10 +8630,17 @@ const onChannelLeft = (callback) => {
|
|
|
8335
8630
|
const preparedPayload = await prepareChannelPayload(payload, {
|
|
8336
8631
|
isMessagePreviewUpdated: isLeftByMe,
|
|
8337
8632
|
});
|
|
8338
|
-
|
|
8633
|
+
const isConsistentMode = client.getMarkerSyncConsistentMode() && client.isUnreadCountEnabled;
|
|
8634
|
+
const isLegacyUnreadCount = client.useLegacyUnreadCount;
|
|
8635
|
+
if (isLeftByMe) {
|
|
8339
8636
|
preparedPayload.channels.forEach(channel => {
|
|
8340
|
-
|
|
8341
|
-
|
|
8637
|
+
if (isConsistentMode) {
|
|
8638
|
+
addFlagIsDeletedSubChannelUnreadByChannelId(channel.channelId);
|
|
8639
|
+
deleteChannelUnreadByChannelId(channel.channelId);
|
|
8640
|
+
}
|
|
8641
|
+
else if (isLegacyUnreadCount) {
|
|
8642
|
+
dropFromCache(['channelUnread', 'get', channel.channelId]);
|
|
8643
|
+
}
|
|
8342
8644
|
});
|
|
8343
8645
|
}
|
|
8344
8646
|
const { channels, channelUsers } = preparedPayload;
|
|
@@ -8606,6 +8908,29 @@ const onMessageCreatedMqtt = (callback) => {
|
|
|
8606
8908
|
reCalculateChannelUnreadInfo(message.channelId);
|
|
8607
8909
|
});
|
|
8608
8910
|
}
|
|
8911
|
+
if (client.useLegacyUnreadCount) {
|
|
8912
|
+
rawPayload.messages.forEach(message => {
|
|
8913
|
+
var _a, _b;
|
|
8914
|
+
const channelUnread = (_a = pullFromCache([
|
|
8915
|
+
'channelUnread',
|
|
8916
|
+
'get',
|
|
8917
|
+
message.channelId,
|
|
8918
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
8919
|
+
if (!channelUnread || channelUnread.lastSegment >= message.segment)
|
|
8920
|
+
return;
|
|
8921
|
+
const lastSegment = message.segment;
|
|
8922
|
+
const isMentionedInMessage = (_b = message.mentionedUsers) === null || _b === void 0 ? void 0 : _b.some(mention => {
|
|
8923
|
+
return (mention.type === 'channel' ||
|
|
8924
|
+
(mention.type === 'user' &&
|
|
8925
|
+
client.userId &&
|
|
8926
|
+
mention.userPublicIds.includes(client.userId)));
|
|
8927
|
+
});
|
|
8928
|
+
const lastMentionSegment = isMentionedInMessage
|
|
8929
|
+
? message.segment
|
|
8930
|
+
: channelUnread.lastMentionSegment;
|
|
8931
|
+
pushToCache(['channelUnread', 'get', message.channelId], Object.assign(Object.assign({}, channelUnread), { lastSegment, unreadCount: lastSegment - channelUnread.readToSegment, lastMentionSegment, isMentioned: !(channelUnread.readToSegment >= lastMentionSegment) }));
|
|
8932
|
+
});
|
|
8933
|
+
}
|
|
8609
8934
|
// Update in cache
|
|
8610
8935
|
ingestInCache(payload);
|
|
8611
8936
|
payload.messages.forEach(message => {
|
|
@@ -8781,6 +9106,7 @@ const enableUnreadCount = () => {
|
|
|
8781
9106
|
if (client.isUnreadCountEnabled)
|
|
8782
9107
|
return false;
|
|
8783
9108
|
client.isUnreadCountEnabled = true;
|
|
9109
|
+
client.useLegacyUnreadCount = false;
|
|
8784
9110
|
client.emitter.emit('unreadCountEnabled', true);
|
|
8785
9111
|
return true;
|
|
8786
9112
|
};
|
|
@@ -9096,7 +9422,12 @@ const login = async (params, sessionHandler, config) => {
|
|
|
9096
9422
|
// NOTE: This is a temporary solution to handle the channel marker when the user is forced to leave
|
|
9097
9423
|
// the channel because currently backend can't handle this, so every time a user is banned from
|
|
9098
9424
|
// a channel or the channel is deleted the channel's unread count will not be reset to zero
|
|
9099
|
-
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(),
|
|
9425
|
+
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler());
|
|
9426
|
+
if (client.useLegacyUnreadCount) {
|
|
9427
|
+
subscriptions.push(readReceiptSyncEngineOnLoginHandler());
|
|
9428
|
+
}
|
|
9429
|
+
else
|
|
9430
|
+
subscriptions.push(legacyReadReceiptSyncEngineOnLoginHandler());
|
|
9100
9431
|
const markerSyncUnsubscriber = await startMarkerSync();
|
|
9101
9432
|
subscriptions.push(markerSyncUnsubscriber);
|
|
9102
9433
|
}
|
|
@@ -9277,6 +9608,8 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
|
|
|
9277
9608
|
const sessionState = "notLoggedIn" /* Amity.SessionStates.NOT_LOGGED_IN */;
|
|
9278
9609
|
const sessionHandler = undefined;
|
|
9279
9610
|
const isUnreadCountEnabled = false;
|
|
9611
|
+
// Legacy unread count is true by default
|
|
9612
|
+
const useLegacyUnreadCount = true;
|
|
9280
9613
|
const client = {
|
|
9281
9614
|
version: `${VERSION}`,
|
|
9282
9615
|
apiKey,
|
|
@@ -9306,6 +9639,7 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
|
|
|
9306
9639
|
getMessagePreviewSetting,
|
|
9307
9640
|
use: () => setActiveClient(client),
|
|
9308
9641
|
isUnreadCountEnabled,
|
|
9642
|
+
useLegacyUnreadCount,
|
|
9309
9643
|
getMarkerSyncConsistentMode,
|
|
9310
9644
|
/**
|
|
9311
9645
|
* Prefix for the deviceId key in the local storage or async storage.
|
|
@@ -16439,19 +16773,37 @@ var index$f = /*#__PURE__*/Object.freeze({
|
|
|
16439
16773
|
/**
|
|
16440
16774
|
* Internal used only
|
|
16441
16775
|
*
|
|
16442
|
-
* Fired when an {@link Amity.
|
|
16776
|
+
* Fired when an {@link Amity.channelUnreadInfo} has been updated.
|
|
16443
16777
|
*
|
|
16444
16778
|
* @param callback The function to call when the event was fired
|
|
16445
16779
|
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
16446
16780
|
*
|
|
16447
|
-
* @category
|
|
16781
|
+
* @category ChannelMarker Events
|
|
16782
|
+
*/
|
|
16783
|
+
const onChannelUnreadInfoUpdatedLocal = (callback) => {
|
|
16784
|
+
const client = getActiveClient();
|
|
16785
|
+
const filter = (payload) => {
|
|
16786
|
+
callback(payload);
|
|
16787
|
+
};
|
|
16788
|
+
return createEventSubscriber(client, 'channelMarker/onChannelUnreadInfoUpdatedLocal', 'local.channelUnreadInfo.updated', filter);
|
|
16789
|
+
};
|
|
16790
|
+
|
|
16791
|
+
/**
|
|
16792
|
+
* Internal used only
|
|
16793
|
+
*
|
|
16794
|
+
* Fired when an {@link Amity.ChannelUnread} has been updated.
|
|
16795
|
+
*
|
|
16796
|
+
* @param callback The function to call when the event was fired
|
|
16797
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
16798
|
+
*
|
|
16799
|
+
* @category Channel Events
|
|
16448
16800
|
*/
|
|
16449
16801
|
const onChannelUnreadUpdatedLocal = (callback) => {
|
|
16450
16802
|
const client = getActiveClient();
|
|
16451
16803
|
const filter = (payload) => {
|
|
16452
16804
|
callback(payload);
|
|
16453
16805
|
};
|
|
16454
|
-
return createEventSubscriber(client, '
|
|
16806
|
+
return createEventSubscriber(client, 'channel/onChannelUnreadUpdatedLocal', 'local.channelUnread.updated', filter);
|
|
16455
16807
|
};
|
|
16456
16808
|
|
|
16457
16809
|
/* begin_public_function
|
|
@@ -16653,6 +17005,7 @@ const getChannel = (channelId, callback) => {
|
|
|
16653
17005
|
return onSubChannelUpdated(updateMessagePreview);
|
|
16654
17006
|
}, 'channelId', 'channel'),
|
|
16655
17007
|
convertEventPayload(onSubChannelCreated, 'channelId', 'channel'),
|
|
17008
|
+
convertEventPayload(onChannelUnreadInfoUpdatedLocal, 'channelId', 'channel'),
|
|
16656
17009
|
convertEventPayload(onChannelUnreadUpdatedLocal, 'channelId', 'channel'),
|
|
16657
17010
|
], {
|
|
16658
17011
|
forceDispatch: true,
|
|
@@ -17166,6 +17519,10 @@ class ChannelLiveCollectionController extends LiveCollectionController {
|
|
|
17166
17519
|
},
|
|
17167
17520
|
action: "OnResolveUnread" /* Amity.ChannelActionType.OnResolveUnread */,
|
|
17168
17521
|
},
|
|
17522
|
+
{
|
|
17523
|
+
fn: convertEventPayload(onChannelUnreadInfoUpdatedLocal, 'channelId', 'channel'),
|
|
17524
|
+
action: "onUpdate" /* Amity.ChannelActionType.OnUpdate */,
|
|
17525
|
+
},
|
|
17169
17526
|
{
|
|
17170
17527
|
fn: convertEventPayload(onChannelUnreadUpdatedLocal, 'channelId', 'channel'),
|
|
17171
17528
|
action: "onUpdate" /* Amity.ChannelActionType.OnUpdate */,
|
|
@@ -23781,7 +24138,7 @@ var index$3 = /*#__PURE__*/Object.freeze({
|
|
|
23781
24138
|
getPoll: getPoll
|
|
23782
24139
|
});
|
|
23783
24140
|
|
|
23784
|
-
const privateKey = "-----BEGIN PRIVATE KEY-----\
|
|
24141
|
+
const privateKey = "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDAARz+hmBgi8pJ\nQb8LeY41gtHhk+ACMwRfhsn7GqpqRQNG2qU0755mzZuVDUqjQMGSo8THJB7O+OJs\nflbZRkFXlFoFOVNw1UpNOgwEQZ6wB9oRwzepTJAfF1sVhm/o/ixvXh1zDFNDy6yZ\npXyiiJHUVxqyjllZhxnwdvjoVtDs6hW6awG09bB9nh/TTejlUKXoAgzqVwu/1QMu\nUVViET495elEe19aUarEy+oL2iKeXCEvqda/pWNBdbieFyJvvZ08HN8dPuT88wq2\njZLEAth1vrwQ2IAa4ktaLcBQdLJgIkrbDvAiVZ8lQAjS/bq5vXQikTGvoPlC5bbn\nvuOM/3eLAgMBAAECggEAVZ+peHAghq2QVj71nX5lxsNCKaCyYwixSJBpfouTt7Rz\nE6PpzMOXFi1W1o+I22jDakuSM2SOQKqI/u0QefB0r0O/KVk5NrZHXk0mkrdYtxOp\nUgaGyf8UvmjB+8VqHrNKyZdk9qtmbnNj01kTTcAtmE4H39zPR7eR/8Rul94vaZbs\nwCnKJS3mLT3JxyGug6lxanveKkjG+CKC1nJQYWaxCJxaFSzbwXQPvDhB+TvrIbee\npd5v4EAyEJohpr+T9oDGGJkb/KARBZCtwLyB976PKJwwBA8MRVL1i5QwawuMiMq5\nUtnOnbGKtCeFzaLbNU0Qi8bqyims84EQxC6DOu1fkQKBgQDdvsoBsEhsOXV7hlIJ\naEd0eSJZVkdqimxH8uGoMM2FeNaOrcB6yBXqTSP0R3OIyf8eaY6yjRvP30ZNXcll\n/gD3O1Mu6YmWQdt1W2WA6pKOsUuPXasf0pdOF7IiFZKlSabz5YHXFqwVuqm8loaj\nsXel3YWqPVdHiankE7tz+3ssnQKBgQDdqi4TNdD1MdEpihx19jr0QjUiXW3939FK\nqp30HESPEGDGQzXdmJgif9HhZb+cJSuWaHEbjgBrYahvgCF+y6LbEpOD+D/dmT+s\nDEAQaR84sah6dokwPjV8fjBSrcVFjCS+doxv0d3p/9OUEeyUhFrY03nxtIEYkLIE\n/Zvn37b4RwKBgQCLENVFe9XfsaVhQ5r9dV2iyTlmh7qgMZG5CbTFs12hQGhm8McO\n+Z7s41YSJCFr/yq1WwP4LJDtrBw99vyQr1zRsG35tNLp3gGRNzGQSQyC2uQFVHw2\np+7mNewsfhUK/gbrXNsyFnDz6635rPlhfbII3sWuP2wWXFqkxE9CbMwR7QKBgQC6\nawDMzxmo2/iYArrkyevSuEuPVxvFwpF1RgAI6C0QVCnPE38dmdN4UB7mfHekje4W\nVEercMURidPp0cxZolCYBQtilUjAyL0vqC3In1/Ogjq6oy3FEMxSop1pKxMY5j+Q\nnoqFD+6deLUrddeNH7J3X4LSr4dSbX4JjG+tlgt+yQKBgQCuwTL4hA6KqeInQ0Ta\n9VQX5Qr8hFlqJz1gpymi/k63tW/Ob8yedbg3WWNWyShwRMFYyY9S81ITFWM95uL6\nvF3x9rmRjwElJw9PMwVu6dmf/CO0Z1wzXSp2VVD12gbrUD/0/d7MUoJ9LgC8X8f/\nn0txLHYGHbx+nf95+JUg6lV3hg==\n-----END PRIVATE KEY-----";
|
|
23785
24142
|
/*
|
|
23786
24143
|
* The crypto algorithm used for importing key and signing string
|
|
23787
24144
|
*/
|