@stream-io/feeds-client 0.3.36 → 0.3.38
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/CHANGELOG.md +15 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +11 -5
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +11 -5
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-BAM-n--9.mjs → feeds-client-B5rMw7wy.mjs} +36 -14
- package/dist/feeds-client-B5rMw7wy.mjs.map +1 -0
- package/dist/{feeds-client-DxM97oeZ.js → feeds-client-eEru7Ibh.js} +36 -14
- package/dist/feeds-client-eEru7Ibh.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +3 -3
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity-updater.d.ts +1 -0
- package/dist/types/feed/event-handlers/activity-updater.d.ts.map +1 -1
- package/dist/types/feeds-client/feeds-client.d.ts +7 -1
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts +1 -0
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +4 -0
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +23 -12
- package/src/feeds-client/feeds-client.ts +43 -15
- package/src/gen/feeds/FeedsApi.ts +3 -0
- package/src/gen/model-decoders/decoders.ts +4 -0
- package/src/gen/models/index.ts +8 -0
- package/dist/feeds-client-BAM-n--9.mjs.map +0 -1
- package/dist/feeds-client-DxM97oeZ.js.map +0 -1
|
@@ -526,6 +526,7 @@ decoders.CommentResponse = (input) => {
|
|
|
526
526
|
own_reactions: { type: "FeedsReactionResponse", isSingle: false },
|
|
527
527
|
user: { type: "UserResponse", isSingle: true },
|
|
528
528
|
deleted_at: { type: "DatetimeType", isSingle: true },
|
|
529
|
+
edited_at: { type: "DatetimeType", isSingle: true },
|
|
529
530
|
latest_reactions: { type: "FeedsReactionResponse", isSingle: false },
|
|
530
531
|
reaction_groups: { type: "ReactionGroupResponse", isSingle: false }
|
|
531
532
|
};
|
|
@@ -1390,6 +1391,7 @@ decoders.ThreadedCommentResponse = (input) => {
|
|
|
1390
1391
|
own_reactions: { type: "FeedsReactionResponse", isSingle: false },
|
|
1391
1392
|
user: { type: "UserResponse", isSingle: true },
|
|
1392
1393
|
deleted_at: { type: "DatetimeType", isSingle: true },
|
|
1394
|
+
edited_at: { type: "DatetimeType", isSingle: true },
|
|
1393
1395
|
latest_reactions: { type: "FeedsReactionResponse", isSingle: false },
|
|
1394
1396
|
replies: { type: "ThreadedCommentResponse", isSingle: false },
|
|
1395
1397
|
reaction_groups: { type: "ReactionGroupResponse", isSingle: false }
|
|
@@ -1744,6 +1746,7 @@ class FeedsApi {
|
|
|
1744
1746
|
async deleteActivities(request) {
|
|
1745
1747
|
const body = {
|
|
1746
1748
|
ids: request?.ids,
|
|
1749
|
+
delete_notification_activity: request?.delete_notification_activity,
|
|
1747
1750
|
hard_delete: request?.hard_delete
|
|
1748
1751
|
};
|
|
1749
1752
|
const response = await this.apiClient.sendRequest(
|
|
@@ -1953,7 +1956,8 @@ class FeedsApi {
|
|
|
1953
1956
|
}
|
|
1954
1957
|
async deleteActivity(request) {
|
|
1955
1958
|
const queryParams = {
|
|
1956
|
-
hard_delete: request?.hard_delete
|
|
1959
|
+
hard_delete: request?.hard_delete,
|
|
1960
|
+
delete_notification_activity: request?.delete_notification_activity
|
|
1957
1961
|
};
|
|
1958
1962
|
const pathParams = {
|
|
1959
1963
|
id: request?.id
|
|
@@ -3981,7 +3985,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
|
|
|
3981
3985
|
};
|
|
3982
3986
|
return result;
|
|
3983
3987
|
};
|
|
3984
|
-
const version = "0.3.
|
|
3988
|
+
const version = "0.3.38";
|
|
3985
3989
|
const axios = axiosImport.default ?? axiosImport;
|
|
3986
3990
|
class ApiClient {
|
|
3987
3991
|
constructor(apiKey, tokenManager, connectionIdManager, options) {
|
|
@@ -7369,10 +7373,22 @@ class FeedsClient extends FeedsApi {
|
|
|
7369
7373
|
}
|
|
7370
7374
|
};
|
|
7371
7375
|
this.pollFromState = (id) => this.polls_by_id.get(id);
|
|
7376
|
+
this.connectAnonymous = () => {
|
|
7377
|
+
this.checkIfUserIsConnected();
|
|
7378
|
+
this.connectionIdManager.resolveConnectionidPromise();
|
|
7379
|
+
this.tokenManager.setTokenOrProvider(void 0);
|
|
7380
|
+
this.setGetBatchOwnFieldsThrottlingInterval(
|
|
7381
|
+
this.query_batch_own_fields_throttling_interval
|
|
7382
|
+
);
|
|
7383
|
+
this.state.partialNext({
|
|
7384
|
+
connected_user: void 0,
|
|
7385
|
+
is_anonymous: true,
|
|
7386
|
+
is_ws_connection_healthy: false
|
|
7387
|
+
});
|
|
7388
|
+
return Promise.resolve();
|
|
7389
|
+
};
|
|
7372
7390
|
this.connectUser = async (user, tokenProvider) => {
|
|
7373
|
-
|
|
7374
|
-
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
7375
|
-
}
|
|
7391
|
+
this.checkIfUserIsConnected();
|
|
7376
7392
|
this.tokenManager.setTokenOrProvider(tokenProvider);
|
|
7377
7393
|
this.setGetBatchOwnFieldsThrottlingInterval(
|
|
7378
7394
|
this.query_batch_own_fields_throttling_interval
|
|
@@ -7545,10 +7561,7 @@ class FeedsClient extends FeedsApi {
|
|
|
7545
7561
|
this.polls_by_id.clear();
|
|
7546
7562
|
this.activeActivities = [];
|
|
7547
7563
|
this.activeFeeds = {};
|
|
7548
|
-
this.state.partialNext(
|
|
7549
|
-
connected_user: void 0,
|
|
7550
|
-
is_ws_connection_healthy: false
|
|
7551
|
-
});
|
|
7564
|
+
this.state.partialNext(this.initialState);
|
|
7552
7565
|
this.cancelGetBatchOwnFieldsTimer();
|
|
7553
7566
|
clearQueuedFeeds();
|
|
7554
7567
|
};
|
|
@@ -7640,10 +7653,7 @@ class FeedsClient extends FeedsApi {
|
|
|
7640
7653
|
}
|
|
7641
7654
|
return feed;
|
|
7642
7655
|
};
|
|
7643
|
-
this.state = new stateStore.StateStore(
|
|
7644
|
-
connected_user: void 0,
|
|
7645
|
-
is_ws_connection_healthy: false
|
|
7646
|
-
});
|
|
7656
|
+
this.state = new stateStore.StateStore(this.initialState);
|
|
7647
7657
|
this.moderation = new ModerationClient(apiClient);
|
|
7648
7658
|
this.tokenManager = tokenManager;
|
|
7649
7659
|
this.connectionIdManager = connectionIdManager;
|
|
@@ -7962,6 +7972,18 @@ class FeedsClient extends FeedsApi {
|
|
|
7962
7972
|
feeds.forEach((f) => handleFollowDeleted.bind(f)({ follow }, false));
|
|
7963
7973
|
});
|
|
7964
7974
|
}
|
|
7975
|
+
get initialState() {
|
|
7976
|
+
return {
|
|
7977
|
+
connected_user: void 0,
|
|
7978
|
+
is_anonymous: false,
|
|
7979
|
+
is_ws_connection_healthy: false
|
|
7980
|
+
};
|
|
7981
|
+
}
|
|
7982
|
+
checkIfUserIsConnected() {
|
|
7983
|
+
if (this.state.getLatestValue().connected_user !== void 0 || this.wsConnection || this.state.getLatestValue().is_anonymous) {
|
|
7984
|
+
throw new Error(`Can't connect a new user, call "disconnectUser" first`);
|
|
7985
|
+
}
|
|
7986
|
+
}
|
|
7965
7987
|
}
|
|
7966
7988
|
exports.ActivityWithStateUpdates = ActivityWithStateUpdates;
|
|
7967
7989
|
exports.Constants = Constants;
|
|
@@ -7984,4 +8006,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
|
|
|
7984
8006
|
exports.shouldUpdateState = shouldUpdateState;
|
|
7985
8007
|
exports.uniqueArrayMerge = uniqueArrayMerge;
|
|
7986
8008
|
exports.updateEntityInArray = updateEntityInArray;
|
|
7987
|
-
//# sourceMappingURL=feeds-client-
|
|
8009
|
+
//# sourceMappingURL=feeds-client-eEru7Ibh.js.map
|