@amityco/ts-sdk 7.1.0 → 7.1.1-a5f8c762.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/channelRepository/events/onChannelUnreadUpdatedLocal.d.ts +12 -0
- 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 +401 -48
- package/dist/index.esm.js +401 -48
- 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/marker/events/onChannelUnreadUpdatedLocal.d.ts +1 -1
- package/dist/marker/events/onChannelUnreadUpdatedLocal.d.ts.map +1 -1
- 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 +10 -4
- package/src/channelRepository/events/onChannelLeft.ts +11 -3
- package/src/channelRepository/events/onChannelUnreadUpdatedLocal.ts +29 -0
- 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/marker/events/onChannelUnreadUpdatedLocal.ts +4 -4
- package/src/messageRepository/events/onMessageCreated.ts +34 -0
- package/src/messageRepository/utils/markReadMessage.ts +10 -3
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,17 @@ 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
|
+
dropFromCache(['channelUnread', 'get', channel.channelId]);
|
|
7929
|
+
}
|
|
7930
|
+
});
|
|
7659
7931
|
ingestInCache(data);
|
|
7660
7932
|
callbacks$b.forEach(cb => cb(data.channels[0]));
|
|
7661
7933
|
};
|
|
@@ -7769,6 +8041,25 @@ var readReceiptSyncEngineOnLoginHandler = () => {
|
|
|
7769
8041
|
};
|
|
7770
8042
|
};
|
|
7771
8043
|
|
|
8044
|
+
var legacyReadReceiptSyncEngineOnLoginHandler = () => {
|
|
8045
|
+
const readReceiptSyncEngine = LegacyReadReceiptSyncEngine.getInstance();
|
|
8046
|
+
readReceiptSyncEngine.startSyncReadReceipt();
|
|
8047
|
+
onSessionStateChange(state => {
|
|
8048
|
+
if (state === "established" /* Amity.SessionStates.ESTABLISHED */) {
|
|
8049
|
+
readReceiptSyncEngine.onSessionEstablished();
|
|
8050
|
+
}
|
|
8051
|
+
else if (state === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
8052
|
+
readReceiptSyncEngine.onTokenExpired();
|
|
8053
|
+
}
|
|
8054
|
+
else {
|
|
8055
|
+
readReceiptSyncEngine.onSessionDestroyed();
|
|
8056
|
+
}
|
|
8057
|
+
});
|
|
8058
|
+
return () => {
|
|
8059
|
+
readReceiptSyncEngine.onSessionDestroyed();
|
|
8060
|
+
};
|
|
8061
|
+
};
|
|
8062
|
+
|
|
7772
8063
|
const onOnline = (callback) => {
|
|
7773
8064
|
if (typeof window !== 'undefined' && window.addEventListener) {
|
|
7774
8065
|
window.addEventListener('online', callback);
|
|
@@ -8335,10 +8626,17 @@ const onChannelLeft = (callback) => {
|
|
|
8335
8626
|
const preparedPayload = await prepareChannelPayload(payload, {
|
|
8336
8627
|
isMessagePreviewUpdated: isLeftByMe,
|
|
8337
8628
|
});
|
|
8338
|
-
|
|
8629
|
+
const isConsistentMode = client.getMarkerSyncConsistentMode() && client.isUnreadCountEnabled;
|
|
8630
|
+
const isLegacyUnreadCount = client.useLegacyUnreadCount;
|
|
8631
|
+
if (isLeftByMe) {
|
|
8339
8632
|
preparedPayload.channels.forEach(channel => {
|
|
8340
|
-
|
|
8341
|
-
|
|
8633
|
+
if (isConsistentMode) {
|
|
8634
|
+
addFlagIsDeletedSubChannelUnreadByChannelId(channel.channelId);
|
|
8635
|
+
deleteChannelUnreadByChannelId(channel.channelId);
|
|
8636
|
+
}
|
|
8637
|
+
else if (isLegacyUnreadCount) {
|
|
8638
|
+
dropFromCache(['channelUnread', 'get', channel.channelId]);
|
|
8639
|
+
}
|
|
8342
8640
|
});
|
|
8343
8641
|
}
|
|
8344
8642
|
const { channels, channelUsers } = preparedPayload;
|
|
@@ -8606,6 +8904,29 @@ const onMessageCreatedMqtt = (callback) => {
|
|
|
8606
8904
|
reCalculateChannelUnreadInfo(message.channelId);
|
|
8607
8905
|
});
|
|
8608
8906
|
}
|
|
8907
|
+
if (client.useLegacyUnreadCount) {
|
|
8908
|
+
rawPayload.messages.forEach(message => {
|
|
8909
|
+
var _a, _b;
|
|
8910
|
+
const channelUnread = (_a = pullFromCache([
|
|
8911
|
+
'channelUnread',
|
|
8912
|
+
'get',
|
|
8913
|
+
message.channelId,
|
|
8914
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
8915
|
+
if (!channelUnread || channelUnread.lastSegment >= message.segment)
|
|
8916
|
+
return;
|
|
8917
|
+
const lastSegment = message.segment;
|
|
8918
|
+
const isMentionedInMessage = (_b = message.mentionedUsers) === null || _b === void 0 ? void 0 : _b.some(mention => {
|
|
8919
|
+
return (mention.type === 'channel' ||
|
|
8920
|
+
(mention.type === 'user' &&
|
|
8921
|
+
client.userId &&
|
|
8922
|
+
mention.userPublicIds.includes(client.userId)));
|
|
8923
|
+
});
|
|
8924
|
+
const lastMentionSegment = isMentionedInMessage
|
|
8925
|
+
? message.segment
|
|
8926
|
+
: channelUnread.lastMentionSegment;
|
|
8927
|
+
pushToCache(['channelUnread', 'get', message.channelId], Object.assign(Object.assign({}, channelUnread), { lastSegment, unreadCount: lastSegment - channelUnread.readToSegment, lastMentionSegment, isMentioned: !(channelUnread.readToSegment >= lastMentionSegment) }));
|
|
8928
|
+
});
|
|
8929
|
+
}
|
|
8609
8930
|
// Update in cache
|
|
8610
8931
|
ingestInCache(payload);
|
|
8611
8932
|
payload.messages.forEach(message => {
|
|
@@ -8781,6 +9102,7 @@ const enableUnreadCount = () => {
|
|
|
8781
9102
|
if (client.isUnreadCountEnabled)
|
|
8782
9103
|
return false;
|
|
8783
9104
|
client.isUnreadCountEnabled = true;
|
|
9105
|
+
client.useLegacyUnreadCount = false;
|
|
8784
9106
|
client.emitter.emit('unreadCountEnabled', true);
|
|
8785
9107
|
return true;
|
|
8786
9108
|
};
|
|
@@ -9096,7 +9418,12 @@ const login = async (params, sessionHandler, config) => {
|
|
|
9096
9418
|
// NOTE: This is a temporary solution to handle the channel marker when the user is forced to leave
|
|
9097
9419
|
// the channel because currently backend can't handle this, so every time a user is banned from
|
|
9098
9420
|
// 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(),
|
|
9421
|
+
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler());
|
|
9422
|
+
if (client.useLegacyUnreadCount) {
|
|
9423
|
+
subscriptions.push(readReceiptSyncEngineOnLoginHandler());
|
|
9424
|
+
}
|
|
9425
|
+
else
|
|
9426
|
+
subscriptions.push(legacyReadReceiptSyncEngineOnLoginHandler());
|
|
9100
9427
|
const markerSyncUnsubscriber = await startMarkerSync();
|
|
9101
9428
|
subscriptions.push(markerSyncUnsubscriber);
|
|
9102
9429
|
}
|
|
@@ -9277,6 +9604,8 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
|
|
|
9277
9604
|
const sessionState = "notLoggedIn" /* Amity.SessionStates.NOT_LOGGED_IN */;
|
|
9278
9605
|
const sessionHandler = undefined;
|
|
9279
9606
|
const isUnreadCountEnabled = false;
|
|
9607
|
+
// Legacy unread count is true by default
|
|
9608
|
+
const useLegacyUnreadCount = true;
|
|
9280
9609
|
const client = {
|
|
9281
9610
|
version: `${VERSION}`,
|
|
9282
9611
|
apiKey,
|
|
@@ -9306,6 +9635,7 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
|
|
|
9306
9635
|
getMessagePreviewSetting,
|
|
9307
9636
|
use: () => setActiveClient(client),
|
|
9308
9637
|
isUnreadCountEnabled,
|
|
9638
|
+
useLegacyUnreadCount,
|
|
9309
9639
|
getMarkerSyncConsistentMode,
|
|
9310
9640
|
/**
|
|
9311
9641
|
* Prefix for the deviceId key in the local storage or async storage.
|
|
@@ -16436,6 +16766,24 @@ var index$f = /*#__PURE__*/Object.freeze({
|
|
|
16436
16766
|
stopMessageReceiptSync: stopMessageReceiptSync
|
|
16437
16767
|
});
|
|
16438
16768
|
|
|
16769
|
+
/**
|
|
16770
|
+
* Internal used only
|
|
16771
|
+
*
|
|
16772
|
+
* Fired when an {@link Amity.userMessageFeedMarkers} has been resolved by Object Rsesolver
|
|
16773
|
+
*
|
|
16774
|
+
* @param callback The function to call when the event was fired
|
|
16775
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
16776
|
+
*
|
|
16777
|
+
* @category MessageMarker Events
|
|
16778
|
+
*/
|
|
16779
|
+
const onChannelUnreadInfoUpdatedLocal = (callback) => {
|
|
16780
|
+
const client = getActiveClient();
|
|
16781
|
+
const filter = (payload) => {
|
|
16782
|
+
callback(payload);
|
|
16783
|
+
};
|
|
16784
|
+
return createEventSubscriber(client, 'channelMarker/onChannelUnreadInfoUpdatedLocal', 'local.channelUnreadInfo.updated', filter);
|
|
16785
|
+
};
|
|
16786
|
+
|
|
16439
16787
|
/**
|
|
16440
16788
|
* Internal used only
|
|
16441
16789
|
*
|
|
@@ -16451,7 +16799,7 @@ const onChannelUnreadUpdatedLocal = (callback) => {
|
|
|
16451
16799
|
const filter = (payload) => {
|
|
16452
16800
|
callback(payload);
|
|
16453
16801
|
};
|
|
16454
|
-
return createEventSubscriber(client, '
|
|
16802
|
+
return createEventSubscriber(client, 'channel/onChannelUnreadUpdatedLocal', 'local.channelUnread.updated', filter);
|
|
16455
16803
|
};
|
|
16456
16804
|
|
|
16457
16805
|
/* begin_public_function
|
|
@@ -16653,6 +17001,7 @@ const getChannel = (channelId, callback) => {
|
|
|
16653
17001
|
return onSubChannelUpdated(updateMessagePreview);
|
|
16654
17002
|
}, 'channelId', 'channel'),
|
|
16655
17003
|
convertEventPayload(onSubChannelCreated, 'channelId', 'channel'),
|
|
17004
|
+
convertEventPayload(onChannelUnreadInfoUpdatedLocal, 'channelId', 'channel'),
|
|
16656
17005
|
convertEventPayload(onChannelUnreadUpdatedLocal, 'channelId', 'channel'),
|
|
16657
17006
|
], {
|
|
16658
17007
|
forceDispatch: true,
|
|
@@ -17166,6 +17515,10 @@ class ChannelLiveCollectionController extends LiveCollectionController {
|
|
|
17166
17515
|
},
|
|
17167
17516
|
action: "OnResolveUnread" /* Amity.ChannelActionType.OnResolveUnread */,
|
|
17168
17517
|
},
|
|
17518
|
+
{
|
|
17519
|
+
fn: convertEventPayload(onChannelUnreadInfoUpdatedLocal, 'channelId', 'channel'),
|
|
17520
|
+
action: "onUpdate" /* Amity.ChannelActionType.OnUpdate */,
|
|
17521
|
+
},
|
|
17169
17522
|
{
|
|
17170
17523
|
fn: convertEventPayload(onChannelUnreadUpdatedLocal, 'channelId', 'channel'),
|
|
17171
17524
|
action: "onUpdate" /* Amity.ChannelActionType.OnUpdate */,
|
|
@@ -23781,7 +24134,7 @@ var index$3 = /*#__PURE__*/Object.freeze({
|
|
|
23781
24134
|
getPoll: getPoll
|
|
23782
24135
|
});
|
|
23783
24136
|
|
|
23784
|
-
const privateKey = "-----BEGIN PRIVATE KEY-----\
|
|
24137
|
+
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
24138
|
/*
|
|
23786
24139
|
* The crypto algorithm used for importing key and signing string
|
|
23787
24140
|
*/
|