@amityco/ts-sdk 7.17.1-f640fa9.0 → 7.18.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/@types/domains/content.d.ts +1 -1
- package/dist/cache/api/ingestInCache.d.ts.map +1 -1
- package/dist/client/api/setupLoginSubscriptions.d.ts.map +1 -1
- package/dist/commentRepository/api/tests/integration/createComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/createComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/deleteComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/deleteComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/flagComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/flagComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/getComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/getComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/getCommentByIds.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/getCommentByIds.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/getComments.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/getComments.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/hardDeleteComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/hardDeleteComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/isCommentFlaggedByMe.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/isCommentFlaggedByMe.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/queryComments.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/queryComments.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/softDeleteComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/softDeleteComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/unflagComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/unflagComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/api/tests/integration/updateComment.integration.test.d.ts +2 -0
- package/dist/commentRepository/api/tests/integration/updateComment.integration.test.d.ts.map +1 -0
- package/dist/commentRepository/events/utils.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersPaginationController.d.ts.map +1 -1
- package/dist/index.cjs.js +198 -76
- package/dist/index.esm.js +198 -76
- package/dist/index.umd.js +3 -3
- package/dist/postRepository/api/tests/integration/pinProduct.integration.test.d.ts +2 -0
- package/dist/postRepository/api/tests/integration/pinProduct.integration.test.d.ts.map +1 -0
- package/dist/postRepository/api/tests/integration/setup.d.ts +2 -0
- package/dist/postRepository/api/tests/integration/setup.d.ts.map +1 -1
- package/dist/postRepository/api/tests/integration/unpinProduct.integration.test.d.ts +2 -0
- package/dist/postRepository/api/tests/integration/unpinProduct.integration.test.d.ts.map +1 -0
- package/dist/postRepository/api/tests/integration/updateProductTags.integration.test.d.ts +2 -0
- package/dist/postRepository/api/tests/integration/updateProductTags.integration.test.d.ts.map +1 -0
- package/dist/productRepository/tests/integration/productAnalytics.integration.test.d.ts +2 -0
- package/dist/productRepository/tests/integration/productAnalytics.integration.test.d.ts.map +1 -0
- package/dist/roomRepository/api/tests/integration/setup.d.ts +11 -0
- package/dist/roomRepository/api/tests/integration/setup.d.ts.map +1 -0
- package/dist/roomRepository/api/tests/integration/updateCohostPermission.integration.test.d.ts +2 -0
- package/dist/roomRepository/api/tests/integration/updateCohostPermission.integration.test.d.ts.map +1 -0
- package/dist/userRepository/api/getAllBlockedUsers.d.ts +17 -0
- package/dist/userRepository/api/getAllBlockedUsers.d.ts.map +1 -0
- package/dist/userRepository/api/index.d.ts +1 -1
- package/dist/userRepository/api/index.d.ts.map +1 -1
- package/dist/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngine.d.ts +55 -0
- package/dist/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngine.d.ts.map +1 -0
- package/dist/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngineOnLoginHandler.d.ts +3 -0
- package/dist/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngineOnLoginHandler.d.ts.map +1 -0
- package/package.json +3 -2
- package/dist/userRepository/api/getBlockedUsersList.d.ts +0 -22
- package/dist/userRepository/api/getBlockedUsersList.d.ts.map +0 -1
|
@@ -11,7 +11,7 @@ export declare enum ContentFlagReasonEnum {
|
|
|
11
11
|
SelfHarmOrSuicide = "Self-harm or suicide",
|
|
12
12
|
ViolenceOrThreateningContent = "Violence or threatening content",
|
|
13
13
|
SellingRestrictedItems = "Selling and promoting restricted items",
|
|
14
|
-
SexualContentOrNudity = "Sexual
|
|
14
|
+
SexualContentOrNudity = "Sexual content or nudity",
|
|
15
15
|
SpamOrScams = "Spam or scams",
|
|
16
16
|
FalseInformation = "False information or misinformation",
|
|
17
17
|
Others = "Others"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestInCache.d.ts","sourceRoot":"","sources":["../../../src/cache/api/ingestInCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AAK1D;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,aACf,OAAO,MAAM,oBAAoB,EAAE,MAAM,KAAK,EAAE,CAAC,YAChD,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"ingestInCache.d.ts","sourceRoot":"","sources":["../../../src/cache/api/ingestInCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AAK1D;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,aACf,OAAO,MAAM,oBAAoB,EAAE,MAAM,KAAK,EAAE,CAAC,YAChD,MAAM,YAAY,4BAe7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupLoginSubscriptions.d.ts","sourceRoot":"","sources":["../../../src/client/api/setupLoginSubscriptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupLoginSubscriptions.d.ts","sourceRoot":"","sources":["../../../src/client/api/setupLoginSubscriptions.ts"],"names":[],"mappings":"AAmBA;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,YAAY,KAAG,MAAM,YAAY,EA4D5F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/createComment.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/deleteComment.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flagComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/flagComment.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/getComment.integration.test.ts"],"names":[],"mappings":""}
|
package/dist/commentRepository/api/tests/integration/getCommentByIds.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCommentByIds.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/getCommentByIds.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getComments.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/getComments.integration.test.ts"],"names":[],"mappings":""}
|
package/dist/commentRepository/api/tests/integration/hardDeleteComment.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardDeleteComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/hardDeleteComment.integration.test.ts"],"names":[],"mappings":""}
|
package/dist/commentRepository/api/tests/integration/isCommentFlaggedByMe.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isCommentFlaggedByMe.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/isCommentFlaggedByMe.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryComments.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/queryComments.integration.test.ts"],"names":[],"mappings":""}
|
package/dist/commentRepository/api/tests/integration/softDeleteComment.integration.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softDeleteComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/softDeleteComment.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unflagComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/unflagComment.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateComment.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/commentRepository/api/tests/integration/updateComment.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/events/utils.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,4BAA4B,UAChC,MAAM,MAAM,iBAAiB,YAC1B,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBA0FhD,CAAC;AAEF,eAAO,MAAM,iCAAiC,UACrC,MAAM,KACX,MAAM,kBAAkB,EACxB,2BAA2B,GAAG,8BAA8B,CAC7D,YACS,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/commentRepository/events/utils.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,4BAA4B,UAChC,MAAM,MAAM,iBAAiB,YAC1B,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBA0FhD,CAAC;AAEF,eAAO,MAAM,iCAAiC,UACrC,MAAM,KACX,MAAM,kBAAkB,EACxB,2BAA2B,GAAG,8BAA8B,CAC7D,YACS,MAAM,QAAQ,CAAC,MAAM,eAAe,CAAC,uBAqIhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommunityMembersPaginationController.d.ts","sourceRoot":"","sources":["../../../../../src/communityRepository/communityMembership/observers/getMembers/CommunityMembersPaginationController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF;;;GAGG;AACH,qBAAa,oCAAqC,SAAQ,oBAAoB,CAC5E,eAAe,EACf,KAAK,CAAC,6BAA6B,CACpC;IACO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,6BAA6B,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"CommunityMembersPaginationController.d.ts","sourceRoot":"","sources":["../../../../../src/communityRepository/communityMembership/observers/getMembers/CommunityMembersPaginationController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF;;;GAGG;AACH,qBAAa,oCAAqC,SAAQ,oBAAoB,CAC5E,eAAe,EACf,KAAK,CAAC,6BAA6B,CACpC;IACO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,6BAA6B,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;CAsB7F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchCommunityMembersPaginationController.d.ts","sourceRoot":"","sources":["../../../../../src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersPaginationController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF;;;GAGG;AACH,qBAAa,0CAA2C,SAAQ,oBAAoB,CAClF,eAAe,EACf,KAAK,CAAC,mCAAmC,CAC1C;IACO,UAAU,CACd,WAAW,EAAE,KAAK,CAAC,mCAAmC,EACtD,KAAK,EAAE,MAAM,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"SearchCommunityMembersPaginationController.d.ts","sourceRoot":"","sources":["../../../../../src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersPaginationController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF;;;GAGG;AACH,qBAAa,0CAA2C,SAAQ,oBAAoB,CAClF,eAAe,EACf,KAAK,CAAC,mCAAmC,CAC1C;IACO,UAAU,CACd,WAAW,EAAE,KAAK,CAAC,mCAAmC,EACtD,KAAK,EAAE,MAAM,GAAG,SAAS;CAuB5B"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -114,7 +114,7 @@ exports.ContentFlagReasonEnum = void 0;
|
|
|
114
114
|
ContentFlagReasonEnum["SelfHarmOrSuicide"] = "Self-harm or suicide";
|
|
115
115
|
ContentFlagReasonEnum["ViolenceOrThreateningContent"] = "Violence or threatening content";
|
|
116
116
|
ContentFlagReasonEnum["SellingRestrictedItems"] = "Selling and promoting restricted items";
|
|
117
|
-
ContentFlagReasonEnum["SexualContentOrNudity"] = "Sexual
|
|
117
|
+
ContentFlagReasonEnum["SexualContentOrNudity"] = "Sexual content or nudity";
|
|
118
118
|
ContentFlagReasonEnum["SpamOrScams"] = "Spam or scams";
|
|
119
119
|
ContentFlagReasonEnum["FalseInformation"] = "False information or misinformation";
|
|
120
120
|
ContentFlagReasonEnum["Others"] = "Others";
|
|
@@ -257,8 +257,8 @@ exports.AnalyticsSourceTypeEnum = void 0;
|
|
|
257
257
|
|
|
258
258
|
function getVersion() {
|
|
259
259
|
try {
|
|
260
|
-
// the string ''v7.
|
|
261
|
-
return 'v7.
|
|
260
|
+
// the string ''v7.18.0-cjs'' should be replaced by actual value by @rollup/plugin-replace
|
|
261
|
+
return 'v7.18.0-cjs';
|
|
262
262
|
}
|
|
263
263
|
catch (error) {
|
|
264
264
|
return '__dev__';
|
|
@@ -1848,13 +1848,13 @@ class NetworkActivitiesWatcher {
|
|
|
1848
1848
|
this._listener.clear();
|
|
1849
1849
|
}
|
|
1850
1850
|
}
|
|
1851
|
-
let instance$
|
|
1851
|
+
let instance$9;
|
|
1852
1852
|
var NetworkActivitiesWatcher$1 = {
|
|
1853
1853
|
getInstance: () => {
|
|
1854
|
-
if (!instance$
|
|
1855
|
-
instance$
|
|
1854
|
+
if (!instance$9) {
|
|
1855
|
+
instance$9 = new NetworkActivitiesWatcher();
|
|
1856
1856
|
}
|
|
1857
|
-
return instance$
|
|
1857
|
+
return instance$9;
|
|
1858
1858
|
},
|
|
1859
1859
|
};
|
|
1860
1860
|
|
|
@@ -4879,6 +4879,8 @@ const ingestInCache = (payload = {}, options, replace = true) => {
|
|
|
4879
4879
|
const resolver = getResolver(type);
|
|
4880
4880
|
if (!resolver)
|
|
4881
4881
|
return;
|
|
4882
|
+
if (!models)
|
|
4883
|
+
return;
|
|
4882
4884
|
models.forEach(model => {
|
|
4883
4885
|
(replace ? pushToCache : upsertInCache)([type, 'get', resolver(model)], model, options);
|
|
4884
4886
|
});
|
|
@@ -6913,13 +6915,13 @@ class SessionWatcher {
|
|
|
6913
6915
|
this._listener.clear();
|
|
6914
6916
|
}
|
|
6915
6917
|
}
|
|
6916
|
-
let instance$
|
|
6918
|
+
let instance$8;
|
|
6917
6919
|
var SessionWatcher$1 = {
|
|
6918
6920
|
getInstance: () => {
|
|
6919
|
-
if (!instance$
|
|
6920
|
-
instance$
|
|
6921
|
+
if (!instance$8) {
|
|
6922
|
+
instance$8 = new SessionWatcher();
|
|
6921
6923
|
}
|
|
6922
|
-
return instance$
|
|
6924
|
+
return instance$8;
|
|
6923
6925
|
},
|
|
6924
6926
|
};
|
|
6925
6927
|
|
|
@@ -7981,13 +7983,13 @@ class AnalyticsEngine {
|
|
|
7981
7983
|
this._eventCapturer.resetAllBuckets();
|
|
7982
7984
|
}
|
|
7983
7985
|
}
|
|
7984
|
-
let instance$
|
|
7986
|
+
let instance$7;
|
|
7985
7987
|
var AnalyticsEngine$1 = {
|
|
7986
7988
|
getInstance: () => {
|
|
7987
|
-
if (!instance$
|
|
7988
|
-
instance$
|
|
7989
|
+
if (!instance$7) {
|
|
7990
|
+
instance$7 = new AnalyticsEngine();
|
|
7989
7991
|
}
|
|
7990
|
-
return instance$
|
|
7992
|
+
return instance$7;
|
|
7991
7993
|
},
|
|
7992
7994
|
};
|
|
7993
7995
|
|
|
@@ -8215,12 +8217,12 @@ class MessageReadReceiptSyncEngine {
|
|
|
8215
8217
|
}
|
|
8216
8218
|
}
|
|
8217
8219
|
}
|
|
8218
|
-
let instance$
|
|
8220
|
+
let instance$6 = null;
|
|
8219
8221
|
var ReadReceiptSyncEngine = {
|
|
8220
8222
|
getInstance: () => {
|
|
8221
|
-
if (!instance$
|
|
8222
|
-
instance$
|
|
8223
|
-
return instance$
|
|
8223
|
+
if (!instance$6)
|
|
8224
|
+
instance$6 = new MessageReadReceiptSyncEngine();
|
|
8225
|
+
return instance$6;
|
|
8224
8226
|
},
|
|
8225
8227
|
};
|
|
8226
8228
|
|
|
@@ -8474,12 +8476,12 @@ class LegacyMessageReadReceiptSyncEngine {
|
|
|
8474
8476
|
}
|
|
8475
8477
|
}
|
|
8476
8478
|
}
|
|
8477
|
-
let instance$
|
|
8479
|
+
let instance$5 = null;
|
|
8478
8480
|
var LegacyReadReceiptSyncEngine = {
|
|
8479
8481
|
getInstance: () => {
|
|
8480
|
-
if (!instance$
|
|
8481
|
-
instance$
|
|
8482
|
-
return instance$
|
|
8482
|
+
if (!instance$5)
|
|
8483
|
+
instance$5 = new LegacyMessageReadReceiptSyncEngine();
|
|
8484
|
+
return instance$5;
|
|
8483
8485
|
},
|
|
8484
8486
|
};
|
|
8485
8487
|
|
|
@@ -8725,12 +8727,12 @@ class ObjectResolverEngine {
|
|
|
8725
8727
|
this.stopResolver();
|
|
8726
8728
|
}
|
|
8727
8729
|
}
|
|
8728
|
-
let instance$
|
|
8730
|
+
let instance$4 = null;
|
|
8729
8731
|
var ObjectResolverEngine$1 = {
|
|
8730
8732
|
getInstance: () => {
|
|
8731
|
-
if (!instance$
|
|
8732
|
-
instance$
|
|
8733
|
-
return instance$
|
|
8733
|
+
if (!instance$4)
|
|
8734
|
+
instance$4 = new ObjectResolverEngine();
|
|
8735
|
+
return instance$4;
|
|
8734
8736
|
},
|
|
8735
8737
|
};
|
|
8736
8738
|
|
|
@@ -8880,13 +8882,13 @@ class LiveReactionSyncEngine {
|
|
|
8880
8882
|
this.stopReactionsSync();
|
|
8881
8883
|
}
|
|
8882
8884
|
}
|
|
8883
|
-
let instance$
|
|
8885
|
+
let instance$3;
|
|
8884
8886
|
var ReactionSyncEngine = {
|
|
8885
8887
|
getInstance: () => {
|
|
8886
|
-
if (!instance$
|
|
8887
|
-
instance$
|
|
8888
|
+
if (!instance$3) {
|
|
8889
|
+
instance$3 = new LiveReactionSyncEngine();
|
|
8888
8890
|
}
|
|
8889
|
-
return instance$
|
|
8891
|
+
return instance$3;
|
|
8890
8892
|
},
|
|
8891
8893
|
};
|
|
8892
8894
|
|
|
@@ -8908,6 +8910,148 @@ var reactionSyncEngineOnLoginHandler = () => {
|
|
|
8908
8910
|
};
|
|
8909
8911
|
};
|
|
8910
8912
|
|
|
8913
|
+
function prepareBlockedUserPayload(response) {
|
|
8914
|
+
const { users, follows } = response, rest = __rest(response, ["users", "follows"]);
|
|
8915
|
+
return Object.assign(Object.assign({}, rest), { follows: follows.map(follow => {
|
|
8916
|
+
const followUser = users.find(user => user.userId === follow.from);
|
|
8917
|
+
return Object.assign(Object.assign({}, follow), { user: convertRawUserToInternalUser(followUser) });
|
|
8918
|
+
}), users: users.map(convertRawUserToInternalUser) });
|
|
8919
|
+
}
|
|
8920
|
+
|
|
8921
|
+
const BLOCK_LIST_LIMIT = 100;
|
|
8922
|
+
const TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
8923
|
+
/**
|
|
8924
|
+
* Session-scoped singleton engine that manages TTL-based fetching and caching
|
|
8925
|
+
* of blocked users. Provides a lazy `ensureFetched()` gate for the
|
|
8926
|
+
* `getAllBlockedUsers()` API.
|
|
8927
|
+
*
|
|
8928
|
+
* Key behaviours:
|
|
8929
|
+
* - `establish()` is a no-op — fetch is lazy, triggered only by consumer call
|
|
8930
|
+
* - `destroy()` resets `lastFetchedAt` to null (ensures fresh fetch on next session)
|
|
8931
|
+
* - `ensureFetched()` fetches from server only when cache is expired or never fetched
|
|
8932
|
+
* - `lastFetchedAt` is only updated on successful fetch
|
|
8933
|
+
* - `blockedUserIds` is kept in sync with each successful fetch
|
|
8934
|
+
*
|
|
8935
|
+
* @internal
|
|
8936
|
+
*/
|
|
8937
|
+
class BlockedUserSyncEngine {
|
|
8938
|
+
constructor() {
|
|
8939
|
+
/** Epoch ms of last successful fetch. null = never fetched in this session. */
|
|
8940
|
+
this.lastFetchedAt = null;
|
|
8941
|
+
/** Ordered list of userId strings from the most recent successful fetch. */
|
|
8942
|
+
this.blockedUserIds = [];
|
|
8943
|
+
}
|
|
8944
|
+
// ---------------------------------------------------------------------------
|
|
8945
|
+
// SessionComponent lifecycle
|
|
8946
|
+
// ---------------------------------------------------------------------------
|
|
8947
|
+
/** No-op — fetch is lazy, triggered by consumer calling getAllBlockedUsers(). */
|
|
8948
|
+
// eslint-disable-next-line class-methods-use-this
|
|
8949
|
+
onSessionEstablished() {
|
|
8950
|
+
// intentionally empty
|
|
8951
|
+
}
|
|
8952
|
+
/** Resets state so the next session starts with a cold cache. */
|
|
8953
|
+
onSessionDestroyed() {
|
|
8954
|
+
this.lastFetchedAt = null;
|
|
8955
|
+
this.blockedUserIds = [];
|
|
8956
|
+
}
|
|
8957
|
+
/** No-op for this engine. */
|
|
8958
|
+
// eslint-disable-next-line class-methods-use-this
|
|
8959
|
+
onTokenExpired() {
|
|
8960
|
+
// intentionally empty
|
|
8961
|
+
}
|
|
8962
|
+
// ---------------------------------------------------------------------------
|
|
8963
|
+
// Cache helpers
|
|
8964
|
+
// ---------------------------------------------------------------------------
|
|
8965
|
+
isCacheExpired() {
|
|
8966
|
+
if (this.lastFetchedAt === null)
|
|
8967
|
+
return true;
|
|
8968
|
+
return Date.now() - this.lastFetchedAt > TTL_MS;
|
|
8969
|
+
}
|
|
8970
|
+
// ---------------------------------------------------------------------------
|
|
8971
|
+
// Core fetch gate
|
|
8972
|
+
// ---------------------------------------------------------------------------
|
|
8973
|
+
/**
|
|
8974
|
+
* Ensures the local store is populated with fresh blocked-user data.
|
|
8975
|
+
*
|
|
8976
|
+
* - If the cache is still within the 5-minute TTL window: resolves immediately
|
|
8977
|
+
* (no server call).
|
|
8978
|
+
* - If the cache is expired (or never fetched): fetches from the server,
|
|
8979
|
+
* persists the payload to the cache, and updates `lastFetchedAt`.
|
|
8980
|
+
*
|
|
8981
|
+
* On failure the error propagates to the caller and `lastFetchedAt` is NOT
|
|
8982
|
+
* updated, so the next call will retry.
|
|
8983
|
+
*/
|
|
8984
|
+
async ensureFetched() {
|
|
8985
|
+
if (!this.isCacheExpired())
|
|
8986
|
+
return;
|
|
8987
|
+
const client = getActiveClient();
|
|
8988
|
+
const { data } = await client.http.get('/api/v4/me/user-blocks', { params: { options: { limit: BLOCK_LIST_LIMIT }, isDeleted: false } });
|
|
8989
|
+
const cachedAt = client.cache && Date.now();
|
|
8990
|
+
const payload = prepareBlockedUserPayload(data);
|
|
8991
|
+
if (client.cache) {
|
|
8992
|
+
ingestInCache(payload, { cachedAt });
|
|
8993
|
+
}
|
|
8994
|
+
// Keep the ordered list of blocked user IDs for getCachedUsers()
|
|
8995
|
+
this.blockedUserIds = payload.users.map(u => u.userId);
|
|
8996
|
+
// Only update timestamp on success — failure leaves it unchanged so the
|
|
8997
|
+
// next call retries.
|
|
8998
|
+
this.lastFetchedAt = Date.now();
|
|
8999
|
+
}
|
|
9000
|
+
// ---------------------------------------------------------------------------
|
|
9001
|
+
// Local store read
|
|
9002
|
+
// ---------------------------------------------------------------------------
|
|
9003
|
+
/**
|
|
9004
|
+
* Returns blocked {@link Amity.InternalUser} objects from the in-memory cache.
|
|
9005
|
+
*
|
|
9006
|
+
* Applies the spec-mandated filter:
|
|
9007
|
+
* - Only users whose `isDeleted` is false or null
|
|
9008
|
+
* - Hard limit of 100 results
|
|
9009
|
+
*
|
|
9010
|
+
* This always reads the latest local state, so changes made by `blockUser()`
|
|
9011
|
+
* and `unblockUser()` are reflected even within the TTL window.
|
|
9012
|
+
*/
|
|
9013
|
+
getCachedUsers() {
|
|
9014
|
+
const client = getActiveClient();
|
|
9015
|
+
if (!client.cache) {
|
|
9016
|
+
// No cache available — fall back to the in-memory list from the last fetch
|
|
9017
|
+
return [];
|
|
9018
|
+
}
|
|
9019
|
+
return this.blockedUserIds
|
|
9020
|
+
.map(id => { var _a; return (_a = pullFromCache(['user', 'get', id])) === null || _a === void 0 ? void 0 : _a.data; })
|
|
9021
|
+
.filter((user) => user != null && user.isDeleted !== true)
|
|
9022
|
+
.slice(0, BLOCK_LIST_LIMIT);
|
|
9023
|
+
}
|
|
9024
|
+
}
|
|
9025
|
+
// ---------------------------------------------------------------------------
|
|
9026
|
+
// Module-level singleton
|
|
9027
|
+
// ---------------------------------------------------------------------------
|
|
9028
|
+
let instance$2 = null;
|
|
9029
|
+
var BlockedUserSyncEngine$1 = {
|
|
9030
|
+
getInstance: () => {
|
|
9031
|
+
if (!instance$2)
|
|
9032
|
+
instance$2 = new BlockedUserSyncEngine();
|
|
9033
|
+
return instance$2;
|
|
9034
|
+
},
|
|
9035
|
+
};
|
|
9036
|
+
|
|
9037
|
+
var blockedUserSyncEngineOnLoginHandler = () => {
|
|
9038
|
+
const blockedUserSyncEngine = BlockedUserSyncEngine$1.getInstance();
|
|
9039
|
+
onSessionStateChange(state => {
|
|
9040
|
+
if (state === "established" /* Amity.SessionStates.ESTABLISHED */) {
|
|
9041
|
+
blockedUserSyncEngine.onSessionEstablished();
|
|
9042
|
+
}
|
|
9043
|
+
else if (state === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
9044
|
+
blockedUserSyncEngine.onTokenExpired();
|
|
9045
|
+
}
|
|
9046
|
+
else {
|
|
9047
|
+
blockedUserSyncEngine.onSessionDestroyed();
|
|
9048
|
+
}
|
|
9049
|
+
});
|
|
9050
|
+
return () => {
|
|
9051
|
+
blockedUserSyncEngine.onSessionDestroyed();
|
|
9052
|
+
};
|
|
9053
|
+
};
|
|
9054
|
+
|
|
8911
9055
|
const EVENTS = [
|
|
8912
9056
|
'disconnected',
|
|
8913
9057
|
'error',
|
|
@@ -9073,7 +9217,7 @@ const setupLoginSubscriptions = (unsubWatcher) => {
|
|
|
9073
9217
|
// NOTE: This is a temporary solution to handle the channel marker when the user is forced to leave
|
|
9074
9218
|
// the channel because currently backend can't handle this, so every time a user is banned from
|
|
9075
9219
|
// a channel or the channel is deleted the channel's unread count will not be reset to zero
|
|
9076
|
-
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler(), reactionSyncEngineOnLoginHandler());
|
|
9220
|
+
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler(), reactionSyncEngineOnLoginHandler(), blockedUserSyncEngineOnLoginHandler());
|
|
9077
9221
|
if (client.useLegacyUnreadCount) {
|
|
9078
9222
|
subscriptions.push(readReceiptSyncEngineOnLoginHandler());
|
|
9079
9223
|
}
|
|
@@ -13051,7 +13195,7 @@ const getWatchSessionStorage = () => {
|
|
|
13051
13195
|
return storageInstance;
|
|
13052
13196
|
};
|
|
13053
13197
|
|
|
13054
|
-
const privateKey = "
|
|
13198
|
+
const privateKey = "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDHo80SecH7FuF2\nhFYnb+l26/VN8UMLXAQFLnxciNTEwkGVFMpdezlH8rU2HtUJL4RETogbAOLVY0XM\njs6sPn8G1nALmh9qeDpUtVqFOVtBHxEZ910TLOtQiunjqJKO5nWdqZ71EC3OFluR\niGQkO84BiIFbv37ub7xl3S8XarbtKoLcyVpkDHi+1wx1pgCAn6gtBUgckPL5NR8j\nLseabl3HAXQfhTCKo4tmOFM2Dxwl1IUMmIJrJg/aIU/U0tj/1Eoo7mG0JcNWX19l\nW3EecCbi0ncCJOrkUdwlBrcjaMayaX/ubEwyUeTGiLdyc4L3GRLHjyK8xgVNXRMH\nbZWJ2a5NAgMBAAECggEASxuE+35zTFO/XydKgmvIGcWL9FbgMlXb7Vcf0nBoG945\nbiz0NVc2paraIhJXc608xbYF3qLmtAE1MVBI0ORyRdBHNxY024l/6H6SH60Ed+uI\nM4ysp5ourY6Vj+DLwpdRiI9YDjqYAQDIUmhNxJP7XPhOMoZI6st+xZQBM34ic/bv\nAMSJm9OZphSp3+qXVkFZztr2mxD2EZSJJLYxi8BCdgM2qhazalbcJ6zDKHCZWVWm\n8RRxDGldyMb/237JxETzP40tAlzOZDmBAbUgEnurDJ93RVDIE3rbZUshwgeQd18a\nem096mWgvB1AIKYgsTAR3pw+V19YWAjq/glP6fz8wQKBgQD/oQq+ukKF0PRgBeM5\ngeTjSwsdGppQLmf5ndujvoiz/TpdjDEPu6R8kigQr1rG2t4K/yfdZoI8RdmJD1al\n3Q7N9hofooSy4rj6E3txzWZCHJjHad2cnCp/O26HiReGAl7wTcfTmNdiFHhZQzm5\nJBkvWAiwuvQMNfEbnXxw6/vIDwKBgQDH7fX8gsc77JLvAWgp1MaQN/sbqVb6JeT1\nFQfR8E/WFCSmzQBtNzd5KgYuCeelwr/8DyYytvN2BzCYZXp73gI1jF3YlW5jVn74\nOY6TwQ095digwo6Z0yuxopdIOApKgAkL9PRKgNrqAf3NAyMua6lOGifzjDojC3KU\nfylQmxMn4wKBgHp2B9O/H0dEBw5JQ8W0+JX6yWQz7mEjGiR2/1W+XXb8hQ1zr709\nw1r6Gb+EghRpnZ3fBpYGGbYOMFx8wKHM+N6qW3F0ReX8v2juFGE8aRSa5oYBrWzt\nU16Idjbv8hj84cZ1PJmdyvDtpYn9rpWHOZl4rxEbPvbqkIsOMyNVqdT5AoGAOSge\nmwIIU2le2FVeohbibXiToWTYKMuMmURZ5/r72AgKMmWJKbAPe+Q3wBG01/7FRBpQ\noU8Ma0HC8s6QJbliiEyIx9JwrJWd1vkdecBHONrtA4ibm/5zD2WcOllLF+FitLhi\n3qnX6+6F0IaFGFBPJrTzlv0P4dTz/OAdv52V7GECgYEA2TttOKBAqWllgOaZOkql\nLVMJVmgR7s6tLi1+cEP8ZcapV9aRbRzTAKXm4f8AEhtlG9F9kCOvHYCYGi6JaiWJ\nZkHjeex3T+eE6Di6y5Bm/Ift5jtVhJ4jCVwHOKTMej79NPUFTJfv8hCo29haBDv6\nRXFrv+T21KCcw8k3sJeJWWQ=\n-----END PRIVATE KEY-----";
|
|
13055
13199
|
/*
|
|
13056
13200
|
* The crypto algorithm used for importing key and signing string
|
|
13057
13201
|
*/
|
|
@@ -15562,56 +15706,32 @@ const isUserFlaggedByMe = async (userId) => {
|
|
|
15562
15706
|
};
|
|
15563
15707
|
/* end_public_function */
|
|
15564
15708
|
|
|
15565
|
-
function prepareBlockedUserPayload(response) {
|
|
15566
|
-
const { users, follows } = response, rest = __rest(response, ["users", "follows"]);
|
|
15567
|
-
return Object.assign(Object.assign({}, rest), { follows: follows.map(follow => {
|
|
15568
|
-
const followUser = users.find(user => user.userId === follow.from);
|
|
15569
|
-
return Object.assign(Object.assign({}, follow), { user: convertRawUserToInternalUser(followUser) });
|
|
15570
|
-
}), users: users.map(convertRawUserToInternalUser) });
|
|
15571
|
-
}
|
|
15572
|
-
|
|
15573
|
-
const BLOCK_LIST_DEFAULT_PAGE_LIMIT = 100;
|
|
15574
15709
|
/* begin_public_function
|
|
15575
|
-
id: user.
|
|
15710
|
+
id: user.get_all_blocked_users
|
|
15576
15711
|
*/
|
|
15577
15712
|
/**
|
|
15578
15713
|
* ```js
|
|
15579
15714
|
* import { UserRepository } from '@amityco/ts-sdk'
|
|
15580
|
-
* const blockedUsers = await UserRepository.
|
|
15581
|
-
* // or with a limit on total results:
|
|
15582
|
-
* const blockedUsers = await UserRepository.getBlockedUsersList({ limit: 3 })
|
|
15715
|
+
* const blockedUsers = await UserRepository.getAllBlockedUsers()
|
|
15583
15716
|
* ```
|
|
15584
15717
|
*
|
|
15585
|
-
*
|
|
15586
|
-
*
|
|
15718
|
+
* Returns all blocked users as a non-paginated list (limit 100) with TTL-based caching (5-minute window).
|
|
15719
|
+
* Within the TTL window, subsequent calls resolve instantly from the local store without any server call.
|
|
15720
|
+
* After the TTL expires, the next call triggers a fresh server fetch.
|
|
15587
15721
|
*
|
|
15588
|
-
* @
|
|
15589
|
-
* @param params.limit Maximum total number of blocked users to return (max: 100). Fetches all if not specified.
|
|
15590
|
-
* @returns Array of blocked {@link Amity.User} objects
|
|
15722
|
+
* @returns A promise that resolves to an array of blocked {@link Amity.User} objects
|
|
15591
15723
|
*
|
|
15592
15724
|
* @category Block API
|
|
15593
15725
|
* @async
|
|
15594
15726
|
*/
|
|
15595
|
-
const
|
|
15596
|
-
const client = getActiveClient();
|
|
15597
|
-
client.log('user/
|
|
15598
|
-
const
|
|
15599
|
-
|
|
15600
|
-
|
|
15601
|
-
|
|
15602
|
-
|
|
15603
|
-
const options = token ? { token } : { limit: remaining };
|
|
15604
|
-
// eslint-disable-next-line no-await-in-loop
|
|
15605
|
-
const { data } = await client.http.get('/api/v4/me/user-blocks', { params: { options, isDeleted: false } });
|
|
15606
|
-
const cachedAt = client.cache && Date.now();
|
|
15607
|
-
const payload = prepareBlockedUserPayload(data);
|
|
15608
|
-
if (client.cache) {
|
|
15609
|
-
ingestInCache(payload, { cachedAt });
|
|
15610
|
-
}
|
|
15611
|
-
allUsers.push(...payload.users);
|
|
15612
|
-
token = data.paging.next;
|
|
15613
|
-
} while (token && (maxResults === undefined || allUsers.length < maxResults));
|
|
15614
|
-
return allUsers.map(userLinkedObject);
|
|
15727
|
+
const getAllBlockedUsers = async () => {
|
|
15728
|
+
const client = getActiveClient();
|
|
15729
|
+
client.log('user/getAllBlockedUsers');
|
|
15730
|
+
const engine = BlockedUserSyncEngine$1.getInstance();
|
|
15731
|
+
// Ensure data is fetched (no-op if cache is fresh)
|
|
15732
|
+
await engine.ensureFetched();
|
|
15733
|
+
// Read from the engine's bounded ID list — O(blocked users) not O(cache size)
|
|
15734
|
+
return engine.getCachedUsers();
|
|
15615
15735
|
};
|
|
15616
15736
|
/* end_public_function */
|
|
15617
15737
|
|
|
@@ -16422,7 +16542,7 @@ var index$q = /*#__PURE__*/Object.freeze({
|
|
|
16422
16542
|
flagUser: flagUser,
|
|
16423
16543
|
unflagUser: unflagUser,
|
|
16424
16544
|
isUserFlaggedByMe: isUserFlaggedByMe,
|
|
16425
|
-
|
|
16545
|
+
getAllBlockedUsers: getAllBlockedUsers,
|
|
16426
16546
|
onUserUpdated: onUserUpdated,
|
|
16427
16547
|
onUserDeleted: onUserDeleted$2,
|
|
16428
16548
|
onUserFlagged: onUserFlagged,
|
|
@@ -18102,8 +18222,10 @@ const createLocalCommentEventSubscriber = (event, callback) => {
|
|
|
18102
18222
|
else {
|
|
18103
18223
|
const postCacheKey = ['post', 'get', comments[0].referenceId];
|
|
18104
18224
|
const postCache = (_d = pullFromCache(postCacheKey)) === null || _d === void 0 ? void 0 : _d.data;
|
|
18105
|
-
|
|
18106
|
-
|
|
18225
|
+
if (postCache) {
|
|
18226
|
+
const updatedPost = Object.assign(Object.assign({}, postCache), { comments: postCache === null || postCache === void 0 ? void 0 : postCache.comments.filter(commentId => { var _a; return commentId !== ((_a = comments[0]) === null || _a === void 0 ? void 0 : _a.commentId); }) });
|
|
18227
|
+
pushToCache(postCacheKey, updatedPost);
|
|
18228
|
+
}
|
|
18107
18229
|
}
|
|
18108
18230
|
const queries = (_e = queryCache(['comment', 'query'])) === null || _e === void 0 ? void 0 : _e.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
|
|
18109
18231
|
queries === null || queries === void 0 ? void 0 : queries.map(({ key, data }) => upsertInCache(key, data, { cachedAt: -1 }));
|
|
@@ -23190,7 +23312,7 @@ const removeMembers = async (communityId, userIds) => {
|
|
|
23190
23312
|
*/
|
|
23191
23313
|
class CommunityMembersPaginationController extends PaginationController {
|
|
23192
23314
|
async getRequest(queryParams, token) {
|
|
23193
|
-
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, includeDeleted } = queryParams, params = __rest(queryParams, ["limit", "includeDeleted"]);
|
|
23315
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, includeDeleted, excludingRoles: _excludingRoles } = queryParams, params = __rest(queryParams, ["limit", "includeDeleted", "excludingRoles"]);
|
|
23194
23316
|
const options = token ? { token } : { limit };
|
|
23195
23317
|
const isDeleted = includeDeleted === false ? false : undefined;
|
|
23196
23318
|
const { data: queryResponse } = await this.http.get(`/api/v3/communities/${params.communityId}/users`, {
|
|
@@ -23839,7 +23961,7 @@ const getMembers = (params, callback, config) => {
|
|
|
23839
23961
|
*/
|
|
23840
23962
|
class SearchCommunityMembersPaginationController extends PaginationController {
|
|
23841
23963
|
async getRequest(queryParams, token) {
|
|
23842
|
-
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, includeDeleted } = queryParams, params = __rest(queryParams, ["limit", "includeDeleted"]);
|
|
23964
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, includeDeleted, excludingRoles } = queryParams, params = __rest(queryParams, ["limit", "includeDeleted", "excludingRoles"]);
|
|
23843
23965
|
const options = token ? { token } : { limit };
|
|
23844
23966
|
const isDeleted = includeDeleted === false ? false : undefined;
|
|
23845
23967
|
const { data: queryResponse } = await this.http.get(`/api/v3/communities/${params.communityId}/users`, {
|