@amityco/ts-sdk-react-native 6.26.3-3e5fb0d.0 → 6.26.4-2eb3673.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/commentRepository/observers/getComments/CommentLiveCollectionController.d.ts.map +1 -1
- package/dist/commentRepository/observers/getComments/CommentQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers.d.ts.map +1 -1
- package/dist/index.cjs.js +36 -10
- package/dist/index.esm.js +36 -10
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
- package/src/commentRepository/observers/getComments/CommentLiveCollectionController.ts +32 -2
- package/src/commentRepository/observers/getComments/CommentQueryStreamController.ts +8 -2
- package/src/communityRepository/communityMembership/observers/getMembers.ts +0 -1
- package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +1 -1
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.ts +1 -1
package/dist/commentRepository/observers/getComments/CommentLiveCollectionController.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentLiveCollectionController.d.ts","sourceRoot":"","sources":["../../../../src/commentRepository/observers/getComments/CommentLiveCollectionController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAgB1F,qBAAa,+BAAgC,SAAQ,wBAAwB,CAC3E,SAAS,EACT,KAAK,CAAC,qBAAqB,EAC3B,KAAK,CAAC,OAAO,EACb,2BAA2B,CAC5B;IACC,OAAO,CAAC,qBAAqB,CAA+B;IAE5D,OAAO,CAAC,KAAK,CAA8B;gBAGzC,KAAK,EAAE,KAAK,CAAC,qBAAqB,EAClC,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC;IAoBvD,SAAS,CAAC,KAAK;cAUC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,UAAU;IAIlF,SAAS,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,KAAK,CAAC,sCAAsC,CAAC,SAAS,CAAC;IAI1D,iBAAiB;IAYjB,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,0BAA0B;IAsBzE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"CommentLiveCollectionController.d.ts","sourceRoot":"","sources":["../../../../src/commentRepository/observers/getComments/CommentLiveCollectionController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAgB1F,qBAAa,+BAAgC,SAAQ,wBAAwB,CAC3E,SAAS,EACT,KAAK,CAAC,qBAAqB,EAC3B,KAAK,CAAC,OAAO,EACb,2BAA2B,CAC5B;IACC,OAAO,CAAC,qBAAqB,CAA+B;IAE5D,OAAO,CAAC,KAAK,CAA8B;gBAGzC,KAAK,EAAE,KAAK,CAAC,qBAAqB,EAClC,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC;IAoBvD,SAAS,CAAC,KAAK;cAUC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,UAAU;IAIlF,SAAS,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,KAAK,CAAC,sCAAsC,CAAC,SAAS,CAAC;IAI1D,iBAAiB;IAYjB,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,0BAA0B;IAsBzE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,eAAe,EAAE;CAqD1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentQueryStreamController.d.ts","sourceRoot":"","sources":["../../../../src/commentRepository/observers/getComments/CommentQueryStreamController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAKpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,4BAA6B,SAAQ,qBAAqB,CACrE,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,qBAAqB,CAC5B;IACC,OAAO,CAAC,YAAY,CAAqD;IAEzE,OAAO,CAAC,cAAc,CAAoE;gBAGxF,KAAK,EAAE,KAAK,CAAC,qBAAqB,EAClC,QAAQ,EAAE,MAAM,EAAE,EAClB,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,0BAA0B,KAAK,IAAI,EAChE,cAAc,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,uBAAuB;IAO7E,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc;IAWjD,mBAAmB,CACjB,QAAQ,EAAE,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAC1D,SAAS,EAAE,KAAK,CAAC,2BAA2B,EAC5C,OAAO,UAAQ;IAkBjB,OAAO,CAAC,MAAM,EAAE,kBAAkB,aACf,MAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"CommentQueryStreamController.d.ts","sourceRoot":"","sources":["../../../../src/commentRepository/observers/getComments/CommentQueryStreamController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAKpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,4BAA6B,SAAQ,qBAAqB,CACrE,KAAK,CAAC,cAAc,EACpB,KAAK,CAAC,qBAAqB,CAC5B;IACC,OAAO,CAAC,YAAY,CAAqD;IAEzE,OAAO,CAAC,cAAc,CAAoE;gBAGxF,KAAK,EAAE,KAAK,CAAC,qBAAqB,EAClC,QAAQ,EAAE,MAAM,EAAE,EAClB,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,0BAA0B,KAAK,IAAI,EAChE,cAAc,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,uBAAuB;IAO7E,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc;IAWjD,mBAAmB,CACjB,QAAQ,EAAE,KAAK,CAAC,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAC1D,SAAS,EAAE,KAAK,CAAC,2BAA2B,EAC5C,OAAO,UAAQ;IAkBjB,OAAO,CAAC,MAAM,EAAE,kBAAkB,aACf,MAAM,eAAe;IA4BxC,YAAY,CACV,gBAAgB,EAAE;QAChB,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,eAAe,KAAK,IAAI,KAAK,KAAK,CAAC,YAAY,CAAC;QAC9E,MAAM,EAAE,kBAAkB,CAAC;KAC5B,EAAE;CAIN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMembers.d.ts","sourceRoot":"","sources":["../../../../src/communityRepository/communityMembership/observers/getMembers.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,WAAW,+DAEd,MAAM,6BAA6B,QAqB5C,CAAC;AAKF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,WACb,MAAM,6BAA6B,YACjC,MAAM,sBAAsB,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,WAC5D,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"getMembers.d.ts","sourceRoot":"","sources":["../../../../src/communityRepository/communityMembership/observers/getMembers.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,WAAW,+DAEd,MAAM,6BAA6B,QAqB5C,CAAC;AAKF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,WACb,MAAM,6BAA6B,YACjC,MAAM,sBAAsB,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,WAC5D,MAAM,oBAAoB,eA6BpC,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -118,8 +118,8 @@ const PostContentType = Object.freeze({
|
|
|
118
118
|
|
|
119
119
|
function getVersion() {
|
|
120
120
|
try {
|
|
121
|
-
// the string ''v6.26.
|
|
122
|
-
return 'v6.26.
|
|
121
|
+
// the string ''v6.26.3-cjs'' should be replaced by actual value by @rollup/plugin-replace
|
|
122
|
+
return 'v6.26.3-cjs';
|
|
123
123
|
}
|
|
124
124
|
catch (error) {
|
|
125
125
|
return '__dev__';
|
|
@@ -19063,7 +19063,6 @@ const getMembers = (params, callback, config) => {
|
|
|
19063
19063
|
const timestamp = Date.now();
|
|
19064
19064
|
log(`getMembers(tmpid: ${timestamp}) > listen`);
|
|
19065
19065
|
const communityMemberLiveCollection = new CommunityMembersLiveCollectionController(params, resp => {
|
|
19066
|
-
console.log('resp', resp);
|
|
19067
19066
|
callback(resp);
|
|
19068
19067
|
});
|
|
19069
19068
|
const disposers = communityMemberLiveCollection.startSubscription();
|
|
@@ -19354,7 +19353,7 @@ class SearchCommunityLiveCollectionController extends LiveCollectionController {
|
|
|
19354
19353
|
applyFilter(data) {
|
|
19355
19354
|
const { userId } = getActiveClient();
|
|
19356
19355
|
let communities = data;
|
|
19357
|
-
if (this.query.includeDeleted) {
|
|
19356
|
+
if (!this.query.includeDeleted) {
|
|
19358
19357
|
communities = filterByPropEquality(communities, 'isDeleted', false);
|
|
19359
19358
|
}
|
|
19360
19359
|
if (this.query.categoryId) {
|
|
@@ -19540,7 +19539,7 @@ class CommunityLiveCollectionController extends LiveCollectionController {
|
|
|
19540
19539
|
applyFilter(data) {
|
|
19541
19540
|
const { userId } = getActiveClient();
|
|
19542
19541
|
let communities = data;
|
|
19543
|
-
if (this.query.includeDeleted) {
|
|
19542
|
+
if (!this.query.includeDeleted) {
|
|
19544
19543
|
communities = filterByPropEquality(communities, 'isDeleted', false);
|
|
19545
19544
|
}
|
|
19546
19545
|
if (this.query.categoryId) {
|
|
@@ -21766,12 +21765,15 @@ class CommentQueryStreamController extends QueryStreamController {
|
|
|
21766
21765
|
!collection) {
|
|
21767
21766
|
return;
|
|
21768
21767
|
}
|
|
21768
|
+
if (this.query.parentId && this.query.parentId !== comment.parentId) {
|
|
21769
|
+
return;
|
|
21770
|
+
}
|
|
21771
|
+
if (!this.query.parentId && comment.parentId) {
|
|
21772
|
+
return;
|
|
21773
|
+
}
|
|
21769
21774
|
if (action === EnumCommentActions.OnCommentCreated) {
|
|
21770
21775
|
collection.data = [...new Set([comment.commentId, ...collection.data])];
|
|
21771
21776
|
}
|
|
21772
|
-
else if (action === EnumCommentActions.OnCommentDeleted) {
|
|
21773
|
-
collection.data = collection.data.filter(p => p !== comment.commentId);
|
|
21774
|
-
}
|
|
21775
21777
|
pushToCache(this.cacheKey, collection);
|
|
21776
21778
|
this.notifyChange({ origin: "event" /* Amity.LiveDataOrigin.EVENT */, loading: false });
|
|
21777
21779
|
};
|
|
@@ -21836,7 +21838,7 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
21836
21838
|
if (!collection)
|
|
21837
21839
|
return;
|
|
21838
21840
|
const data = this.applyFilter((_b = collection.data
|
|
21839
|
-
.map(id => pullFromCache(['
|
|
21841
|
+
.map(id => pullFromCache(['comment', 'get', id]))
|
|
21840
21842
|
.filter(isNonNullable)
|
|
21841
21843
|
.map(({ data }) => data)) !== null && _b !== void 0 ? _b : []).map(LinkedObject.comment);
|
|
21842
21844
|
if (!this.shouldNotify(data) && origin === 'event')
|
|
@@ -21851,12 +21853,36 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
21851
21853
|
}
|
|
21852
21854
|
applyFilter(data) {
|
|
21853
21855
|
let comments = data;
|
|
21854
|
-
if (this.query.includeDeleted) {
|
|
21856
|
+
if (!this.query.includeDeleted) {
|
|
21855
21857
|
comments = filterByPropEquality(comments, 'isDeleted', false);
|
|
21856
21858
|
}
|
|
21857
21859
|
if (this.query.parentId) {
|
|
21858
21860
|
comments = comments.filter(comment => comment.parentId === this.query.parentId);
|
|
21859
21861
|
}
|
|
21862
|
+
if (typeof this.query.hasFlag === 'boolean') {
|
|
21863
|
+
if (this.query.hasFlag) {
|
|
21864
|
+
comments = comments.filter(comment => comment.hashFlag != null);
|
|
21865
|
+
}
|
|
21866
|
+
else {
|
|
21867
|
+
comments = comments.filter(comment => comment.hashFlag == null);
|
|
21868
|
+
}
|
|
21869
|
+
}
|
|
21870
|
+
if (this.query.dataTypes) {
|
|
21871
|
+
if (this.query.dataTypes.matchType === 'exact') {
|
|
21872
|
+
comments = comments.filter(comment => {
|
|
21873
|
+
var _a, _b;
|
|
21874
|
+
const sortedDataTypesQueryValue = ((_a = this.query.dataTypes) === null || _a === void 0 ? void 0 : _a.values.sort()) || [];
|
|
21875
|
+
const sortedDataTypesCommentValue = ((_b = comment.dataTypes) === null || _b === void 0 ? void 0 : _b.sort()) || [];
|
|
21876
|
+
if (sortedDataTypesCommentValue.length !== sortedDataTypesQueryValue.length) {
|
|
21877
|
+
return false;
|
|
21878
|
+
}
|
|
21879
|
+
return sortedDataTypesQueryValue.every((value, index) => value === sortedDataTypesCommentValue[index]);
|
|
21880
|
+
});
|
|
21881
|
+
}
|
|
21882
|
+
if (this.query.dataTypes.matchType === 'any') {
|
|
21883
|
+
comments = comments.filter(comment => { var _a; return (_a = this.query.dataTypes) === null || _a === void 0 ? void 0 : _a.values.some(value => { var _a; return (_a = comment.dataTypes) === null || _a === void 0 ? void 0 : _a.includes(value); }); });
|
|
21884
|
+
}
|
|
21885
|
+
}
|
|
21860
21886
|
switch (this.query.sortBy) {
|
|
21861
21887
|
case 'firstCreated':
|
|
21862
21888
|
comments = comments.sort(sortByFirstCreated);
|
package/dist/index.esm.js
CHANGED
|
@@ -84,8 +84,8 @@ const PostContentType = Object.freeze({
|
|
|
84
84
|
|
|
85
85
|
function getVersion() {
|
|
86
86
|
try {
|
|
87
|
-
// the string ''v6.26.
|
|
88
|
-
return 'v6.26.
|
|
87
|
+
// the string ''v6.26.3-esm'' should be replaced by actual value by @rollup/plugin-replace
|
|
88
|
+
return 'v6.26.3-esm';
|
|
89
89
|
}
|
|
90
90
|
catch (error) {
|
|
91
91
|
return '__dev__';
|
|
@@ -35134,7 +35134,6 @@ const getMembers = (params, callback, config) => {
|
|
|
35134
35134
|
const timestamp = Date.now();
|
|
35135
35135
|
log(`getMembers(tmpid: ${timestamp}) > listen`);
|
|
35136
35136
|
const communityMemberLiveCollection = new CommunityMembersLiveCollectionController(params, resp => {
|
|
35137
|
-
console.log('resp', resp);
|
|
35138
35137
|
callback(resp);
|
|
35139
35138
|
});
|
|
35140
35139
|
const disposers = communityMemberLiveCollection.startSubscription();
|
|
@@ -35425,7 +35424,7 @@ class SearchCommunityLiveCollectionController extends LiveCollectionController {
|
|
|
35425
35424
|
applyFilter(data) {
|
|
35426
35425
|
const { userId } = getActiveClient();
|
|
35427
35426
|
let communities = data;
|
|
35428
|
-
if (this.query.includeDeleted) {
|
|
35427
|
+
if (!this.query.includeDeleted) {
|
|
35429
35428
|
communities = filterByPropEquality(communities, 'isDeleted', false);
|
|
35430
35429
|
}
|
|
35431
35430
|
if (this.query.categoryId) {
|
|
@@ -35611,7 +35610,7 @@ class CommunityLiveCollectionController extends LiveCollectionController {
|
|
|
35611
35610
|
applyFilter(data) {
|
|
35612
35611
|
const { userId } = getActiveClient();
|
|
35613
35612
|
let communities = data;
|
|
35614
|
-
if (this.query.includeDeleted) {
|
|
35613
|
+
if (!this.query.includeDeleted) {
|
|
35615
35614
|
communities = filterByPropEquality(communities, 'isDeleted', false);
|
|
35616
35615
|
}
|
|
35617
35616
|
if (this.query.categoryId) {
|
|
@@ -37837,12 +37836,15 @@ class CommentQueryStreamController extends QueryStreamController {
|
|
|
37837
37836
|
!collection) {
|
|
37838
37837
|
return;
|
|
37839
37838
|
}
|
|
37839
|
+
if (this.query.parentId && this.query.parentId !== comment.parentId) {
|
|
37840
|
+
return;
|
|
37841
|
+
}
|
|
37842
|
+
if (!this.query.parentId && comment.parentId) {
|
|
37843
|
+
return;
|
|
37844
|
+
}
|
|
37840
37845
|
if (action === EnumCommentActions.OnCommentCreated) {
|
|
37841
37846
|
collection.data = [...new Set([comment.commentId, ...collection.data])];
|
|
37842
37847
|
}
|
|
37843
|
-
else if (action === EnumCommentActions.OnCommentDeleted) {
|
|
37844
|
-
collection.data = collection.data.filter(p => p !== comment.commentId);
|
|
37845
|
-
}
|
|
37846
37848
|
pushToCache(this.cacheKey, collection);
|
|
37847
37849
|
this.notifyChange({ origin: "event" /* Amity.LiveDataOrigin.EVENT */, loading: false });
|
|
37848
37850
|
};
|
|
@@ -37907,7 +37909,7 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
37907
37909
|
if (!collection)
|
|
37908
37910
|
return;
|
|
37909
37911
|
const data = this.applyFilter((_b = collection.data
|
|
37910
|
-
.map(id => pullFromCache(['
|
|
37912
|
+
.map(id => pullFromCache(['comment', 'get', id]))
|
|
37911
37913
|
.filter(isNonNullable)
|
|
37912
37914
|
.map(({ data }) => data)) !== null && _b !== void 0 ? _b : []).map(LinkedObject.comment);
|
|
37913
37915
|
if (!this.shouldNotify(data) && origin === 'event')
|
|
@@ -37922,12 +37924,36 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
37922
37924
|
}
|
|
37923
37925
|
applyFilter(data) {
|
|
37924
37926
|
let comments = data;
|
|
37925
|
-
if (this.query.includeDeleted) {
|
|
37927
|
+
if (!this.query.includeDeleted) {
|
|
37926
37928
|
comments = filterByPropEquality(comments, 'isDeleted', false);
|
|
37927
37929
|
}
|
|
37928
37930
|
if (this.query.parentId) {
|
|
37929
37931
|
comments = comments.filter(comment => comment.parentId === this.query.parentId);
|
|
37930
37932
|
}
|
|
37933
|
+
if (typeof this.query.hasFlag === 'boolean') {
|
|
37934
|
+
if (this.query.hasFlag) {
|
|
37935
|
+
comments = comments.filter(comment => comment.hashFlag != null);
|
|
37936
|
+
}
|
|
37937
|
+
else {
|
|
37938
|
+
comments = comments.filter(comment => comment.hashFlag == null);
|
|
37939
|
+
}
|
|
37940
|
+
}
|
|
37941
|
+
if (this.query.dataTypes) {
|
|
37942
|
+
if (this.query.dataTypes.matchType === 'exact') {
|
|
37943
|
+
comments = comments.filter(comment => {
|
|
37944
|
+
var _a, _b;
|
|
37945
|
+
const sortedDataTypesQueryValue = ((_a = this.query.dataTypes) === null || _a === void 0 ? void 0 : _a.values.sort()) || [];
|
|
37946
|
+
const sortedDataTypesCommentValue = ((_b = comment.dataTypes) === null || _b === void 0 ? void 0 : _b.sort()) || [];
|
|
37947
|
+
if (sortedDataTypesCommentValue.length !== sortedDataTypesQueryValue.length) {
|
|
37948
|
+
return false;
|
|
37949
|
+
}
|
|
37950
|
+
return sortedDataTypesQueryValue.every((value, index) => value === sortedDataTypesCommentValue[index]);
|
|
37951
|
+
});
|
|
37952
|
+
}
|
|
37953
|
+
if (this.query.dataTypes.matchType === 'any') {
|
|
37954
|
+
comments = comments.filter(comment => { var _a; return (_a = this.query.dataTypes) === null || _a === void 0 ? void 0 : _a.values.some(value => { var _a; return (_a = comment.dataTypes) === null || _a === void 0 ? void 0 : _a.includes(value); }); });
|
|
37955
|
+
}
|
|
37956
|
+
}
|
|
37931
37957
|
switch (this.query.sortBy) {
|
|
37932
37958
|
case 'firstCreated':
|
|
37933
37959
|
comments = comments.sort(sortByFirstCreated);
|