@connectedxm/client 2.1.0 → 2.2.1
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/index.cjs +176 -230
- package/dist/index.d.cts +72 -47
- package/dist/index.d.ts +72 -47
- package/dist/index.js +169 -224
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -49,6 +49,7 @@ __export(index_exports, {
|
|
|
49
49
|
AcceptGroupInvitation: () => AcceptGroupInvitation,
|
|
50
50
|
AcceptGroupRequest: () => AcceptGroupRequest,
|
|
51
51
|
AccountType: () => AccountType,
|
|
52
|
+
ActivityEntityType: () => ActivityEntityType,
|
|
52
53
|
AddChannelCollectionContent: () => AddChannelCollectionContent,
|
|
53
54
|
AddChannelInterest: () => AddChannelInterest,
|
|
54
55
|
AddContentInterest: () => AddContentInterest,
|
|
@@ -102,6 +103,7 @@ __export(index_exports, {
|
|
|
102
103
|
ConnectedXMProvider: () => ConnectedXMProvider,
|
|
103
104
|
ContentGuestType: () => ContentGuestType,
|
|
104
105
|
CouponType: () => CouponType,
|
|
106
|
+
CreateActivity: () => CreateActivity,
|
|
105
107
|
CreateChannel: () => CreateChannel,
|
|
106
108
|
CreateChannelCollection: () => CreateChannelCollection,
|
|
107
109
|
CreateChannelContent: () => CreateChannelContent,
|
|
@@ -141,7 +143,6 @@ __export(index_exports, {
|
|
|
141
143
|
DeleteListingQuestion: () => DeleteListingQuestion,
|
|
142
144
|
DeleteListingSession: () => DeleteListingSession,
|
|
143
145
|
DeleteListingSpeaker: () => DeleteListingSpeaker,
|
|
144
|
-
DeleteReshare: () => DeleteReshare,
|
|
145
146
|
DeleteSelf: () => DeleteSelf,
|
|
146
147
|
DeleteSelfAddress: () => DeleteSelfAddress,
|
|
147
148
|
DeleteSelfChatChannel: () => DeleteSelfChatChannel,
|
|
@@ -301,6 +302,7 @@ __export(index_exports, {
|
|
|
301
302
|
GetLevel: () => GetLevel,
|
|
302
303
|
GetLevelSponsors: () => GetLevelSponsors,
|
|
303
304
|
GetLevels: () => GetLevels,
|
|
305
|
+
GetLinkPreview: () => GetLinkPreview,
|
|
304
306
|
GetListingAttendeePassQuestionSections: () => GetListingAttendeePassQuestionSections,
|
|
305
307
|
GetManagedChannel: () => GetManagedChannel,
|
|
306
308
|
GetManagedChannelCollection: () => GetManagedChannelCollection,
|
|
@@ -417,6 +419,7 @@ __export(index_exports, {
|
|
|
417
419
|
LEVELS_QUERY_KEY: () => LEVELS_QUERY_KEY,
|
|
418
420
|
LEVEL_QUERY_KEY: () => LEVEL_QUERY_KEY,
|
|
419
421
|
LEVEL_SPONSORS_QUERY_KEY: () => LEVEL_SPONSORS_QUERY_KEY,
|
|
422
|
+
LINK_PREVIEW_QUERY_KEY: () => LINK_PREVIEW_QUERY_KEY,
|
|
420
423
|
LISTINGS_QUERY_KEY: () => LISTINGS_QUERY_KEY,
|
|
421
424
|
LISTING_ANNOUNCEMENTS_QUERY_KEY: () => LISTING_ANNOUNCEMENTS_QUERY_KEY,
|
|
422
425
|
LISTING_ANNOUNCEMENT_QUERY_KEY: () => LISTING_ANNOUNCEMENT_QUERY_KEY,
|
|
@@ -479,7 +482,6 @@ __export(index_exports, {
|
|
|
479
482
|
RemoveSelfEventSession: () => RemoveSelfEventSession,
|
|
480
483
|
RemoveThreadMessageReaction: () => RemoveThreadMessageReaction,
|
|
481
484
|
ReportActivity: () => ReportActivity,
|
|
482
|
-
ReshareActivity: () => ReshareActivity,
|
|
483
485
|
SELF_ACTIVITIES_QUERY_KEY: () => SELF_ACTIVITIES_QUERY_KEY,
|
|
484
486
|
SELF_ADDRESSES_QUERY_KEY: () => SELF_ADDRESSES_QUERY_KEY,
|
|
485
487
|
SELF_ADDRESS_QUERY_KEY: () => SELF_ADDRESS_QUERY_KEY,
|
|
@@ -608,6 +610,7 @@ __export(index_exports, {
|
|
|
608
610
|
SET_LEVELS_QUERY_DATA: () => SET_LEVELS_QUERY_DATA,
|
|
609
611
|
SET_LEVEL_QUERY_DATA: () => SET_LEVEL_QUERY_DATA,
|
|
610
612
|
SET_LEVEL_SPONSORS_QUERY_DATA: () => SET_LEVEL_SPONSORS_QUERY_DATA,
|
|
613
|
+
SET_LINK_PREVIEW_QUERY_DATA: () => SET_LINK_PREVIEW_QUERY_DATA,
|
|
611
614
|
SET_LISTING_ANNOUNCEMENT_QUERY_KEY: () => SET_LISTING_ANNOUNCEMENT_QUERY_KEY,
|
|
612
615
|
SET_LISTING_ATTENDEE_PASS_QUESTION_SECTIONS_QUERY_DATA: () => SET_LISTING_ATTENDEE_PASS_QUESTION_SECTIONS_QUERY_DATA,
|
|
613
616
|
SET_LISTING_ATTENDEE_QUERY_KEY: () => SET_LISTING_ATTENDEE_QUERY_KEY,
|
|
@@ -667,7 +670,6 @@ __export(index_exports, {
|
|
|
667
670
|
SURVEY_SUBMISSION_QUERY_KEY: () => SURVEY_SUBMISSION_QUERY_KEY,
|
|
668
671
|
SURVEY_SUBMISSION_SECTIONS_QUERY_KEY: () => SURVEY_SUBMISSION_SECTIONS_QUERY_KEY,
|
|
669
672
|
SelectSelfEventRegistrationCoupon: () => SelectSelfEventRegistrationCoupon,
|
|
670
|
-
SelfCreateActivity: () => SelfCreateActivity,
|
|
671
673
|
SelfUpdateGroupMembership: () => SelfUpdateGroupMembership,
|
|
672
674
|
SetContentPublishSchedule: () => SetContentPublishSchedule,
|
|
673
675
|
StartSurvey: () => StartSurvey,
|
|
@@ -802,6 +804,7 @@ __export(index_exports, {
|
|
|
802
804
|
useConnectedMutation: () => useConnectedMutation,
|
|
803
805
|
useConnectedSingleQuery: () => useConnectedSingleQuery,
|
|
804
806
|
useConnectedXM: () => useConnectedXM,
|
|
807
|
+
useCreateActivity: () => useCreateActivity,
|
|
805
808
|
useCreateChannel: () => useCreateChannel,
|
|
806
809
|
useCreateChannelCollection: () => useCreateChannelCollection,
|
|
807
810
|
useCreateChannelContent: () => useCreateChannelContent,
|
|
@@ -838,7 +841,6 @@ __export(index_exports, {
|
|
|
838
841
|
useDeleteListingQuestion: () => useDeleteListingQuestion,
|
|
839
842
|
useDeleteListingSession: () => useDeleteListingSession,
|
|
840
843
|
useDeleteListingSpeaker: () => useDeleteListingSpeaker,
|
|
841
|
-
useDeleteReshare: () => useDeleteReshare,
|
|
842
844
|
useDeleteSelf: () => useDeleteSelf,
|
|
843
845
|
useDeleteSelfAddress: () => useDeleteSelfAddress,
|
|
844
846
|
useDeleteSelfChatChannel: () => useDeleteSelfChatChannel,
|
|
@@ -941,6 +943,7 @@ __export(index_exports, {
|
|
|
941
943
|
useGetLevel: () => useGetLevel,
|
|
942
944
|
useGetLevelSponsors: () => useGetLevelSponsors,
|
|
943
945
|
useGetLevels: () => useGetLevels,
|
|
946
|
+
useGetLinkPreview: () => useGetLinkPreview,
|
|
944
947
|
useGetListingAttendeePassQuestionSections: () => useGetListingAttendeePassQuestionSections,
|
|
945
948
|
useGetManagedChannel: () => useGetManagedChannel,
|
|
946
949
|
useGetManagedChannelCollection: () => useGetManagedChannelCollection,
|
|
@@ -1067,9 +1070,7 @@ __export(index_exports, {
|
|
|
1067
1070
|
useRemoveSelfEventSession: () => useRemoveSelfEventSession,
|
|
1068
1071
|
useRemoveThreadMessageReaction: () => useRemoveThreadMessageReaction,
|
|
1069
1072
|
useReportActivity: () => useReportActivity,
|
|
1070
|
-
useReshareActivity: () => useReshareActivity,
|
|
1071
1073
|
useSelectSelfEventRegistrationCoupon: () => useSelectSelfEventRegistrationCoupon,
|
|
1072
|
-
useSelfCreateActivity: () => useSelfCreateActivity,
|
|
1073
1074
|
useSelfUpdateGroupMembership: () => useSelfUpdateGroupMembership,
|
|
1074
1075
|
useSetContentPublishSchedule: () => useSetContentPublishSchedule,
|
|
1075
1076
|
useStartSurvey: () => useStartSurvey,
|
|
@@ -1235,6 +1236,13 @@ var IntegrationType = /* @__PURE__ */ ((IntegrationType2) => {
|
|
|
1235
1236
|
IntegrationType2["snagtag"] = "snagtag";
|
|
1236
1237
|
return IntegrationType2;
|
|
1237
1238
|
})(IntegrationType || {});
|
|
1239
|
+
var ActivityEntityType = /* @__PURE__ */ ((ActivityEntityType2) => {
|
|
1240
|
+
ActivityEntityType2["mention"] = "mention";
|
|
1241
|
+
ActivityEntityType2["interest"] = "interest";
|
|
1242
|
+
ActivityEntityType2["link"] = "link";
|
|
1243
|
+
ActivityEntityType2["segment"] = "segment";
|
|
1244
|
+
return ActivityEntityType2;
|
|
1245
|
+
})(ActivityEntityType || {});
|
|
1238
1246
|
var ImageType = /* @__PURE__ */ ((ImageType2) => {
|
|
1239
1247
|
ImageType2["admin"] = "admin";
|
|
1240
1248
|
ImageType2["people"] = "people";
|
|
@@ -9722,6 +9730,41 @@ var useGetSurveyQuestionSearchValues = (surveyId = "", questionId = "", params =
|
|
|
9722
9730
|
);
|
|
9723
9731
|
};
|
|
9724
9732
|
|
|
9733
|
+
// src/queries/link-previews/useGetLinkPreview.ts
|
|
9734
|
+
var LINK_PREVIEW_QUERY_KEY = (href) => [
|
|
9735
|
+
"LINK_PREVIEW",
|
|
9736
|
+
encodeURIComponent(href)
|
|
9737
|
+
];
|
|
9738
|
+
var SET_LINK_PREVIEW_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
|
|
9739
|
+
client.setQueryData(
|
|
9740
|
+
[
|
|
9741
|
+
...LINK_PREVIEW_QUERY_KEY(...keyParams),
|
|
9742
|
+
...GetBaseSingleQueryKeys(...baseKeys)
|
|
9743
|
+
],
|
|
9744
|
+
response
|
|
9745
|
+
);
|
|
9746
|
+
};
|
|
9747
|
+
var GetLinkPreview = async ({
|
|
9748
|
+
href,
|
|
9749
|
+
clientApiParams
|
|
9750
|
+
}) => {
|
|
9751
|
+
const clientApi = await GetClientAPI(clientApiParams);
|
|
9752
|
+
const { data } = await clientApi.get(
|
|
9753
|
+
`/storage/link-preview?href=${encodeURIComponent(href)}`
|
|
9754
|
+
);
|
|
9755
|
+
return data;
|
|
9756
|
+
};
|
|
9757
|
+
var useGetLinkPreview = (href = "", options = {}) => {
|
|
9758
|
+
return useConnectedSingleQuery(
|
|
9759
|
+
LINK_PREVIEW_QUERY_KEY(href),
|
|
9760
|
+
(_params) => GetLinkPreview({ href, ..._params }),
|
|
9761
|
+
{
|
|
9762
|
+
...options,
|
|
9763
|
+
enabled: !!href && (options?.enabled ?? true)
|
|
9764
|
+
}
|
|
9765
|
+
);
|
|
9766
|
+
};
|
|
9767
|
+
|
|
9725
9768
|
// src/mutations/useConnectedMutation.ts
|
|
9726
9769
|
var import_react_query4 = require("@tanstack/react-query");
|
|
9727
9770
|
var useConnectedMutation = (mutation, options) => {
|
|
@@ -9897,21 +9940,21 @@ var useUnblockAccount = (options = {}) => {
|
|
|
9897
9940
|
return useConnectedMutation_default(UnblockAccount, options);
|
|
9898
9941
|
};
|
|
9899
9942
|
|
|
9900
|
-
// src/mutations/activities/optimistic/
|
|
9943
|
+
// src/mutations/activities/optimistic/UpdateComments.ts
|
|
9901
9944
|
var import_immer4 = require("immer");
|
|
9902
|
-
var
|
|
9945
|
+
var UpdateCommentsSingle = (increment, queryClient, KEY) => {
|
|
9903
9946
|
queryClient.setQueryData(
|
|
9904
9947
|
KEY,
|
|
9905
9948
|
(originalData) => (0, import_immer4.produce)(originalData, (draft) => {
|
|
9906
9949
|
if (!draft?.data) {
|
|
9907
9950
|
return;
|
|
9908
9951
|
}
|
|
9909
|
-
draft.data._count.
|
|
9910
|
-
draft.data.
|
|
9952
|
+
draft.data._count.comments += increment ? 1 : -1;
|
|
9953
|
+
draft.data.comments = increment ? [{ id: Date.now().toString() }] : [];
|
|
9911
9954
|
})
|
|
9912
9955
|
);
|
|
9913
9956
|
};
|
|
9914
|
-
var
|
|
9957
|
+
var UpdateCommentsInfinite = (increment, queryClient, KEY, activityId) => {
|
|
9915
9958
|
queryClient.setQueriesData(
|
|
9916
9959
|
{ queryKey: KEY, exact: false },
|
|
9917
9960
|
(originalData) => (0, import_immer4.produce)(originalData, (draft) => {
|
|
@@ -9921,8 +9964,8 @@ var UpdateResharesInfinite = (increment, queryClient, KEY, activityId) => {
|
|
|
9921
9964
|
for (const page of draft.pages) {
|
|
9922
9965
|
for (const activity of page.data) {
|
|
9923
9966
|
if (activity.id === activityId) {
|
|
9924
|
-
activity._count.
|
|
9925
|
-
activity.
|
|
9967
|
+
activity._count.comments += increment ? 1 : -1;
|
|
9968
|
+
activity.comments = increment ? [{ id: Date.now().toString() }] : [];
|
|
9926
9969
|
}
|
|
9927
9970
|
}
|
|
9928
9971
|
}
|
|
@@ -9930,32 +9973,125 @@ var UpdateResharesInfinite = (increment, queryClient, KEY, activityId) => {
|
|
|
9930
9973
|
);
|
|
9931
9974
|
};
|
|
9932
9975
|
|
|
9933
|
-
// src/mutations/activities/
|
|
9934
|
-
var
|
|
9935
|
-
|
|
9976
|
+
// src/mutations/activities/useCreateActivity.ts
|
|
9977
|
+
var CreateActivity = async ({
|
|
9978
|
+
activity,
|
|
9936
9979
|
clientApiParams,
|
|
9937
9980
|
queryClient
|
|
9938
9981
|
}) => {
|
|
9939
9982
|
if (queryClient) {
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9983
|
+
if (activity.commentedId) {
|
|
9984
|
+
UpdateCommentsSingle(true, queryClient, [
|
|
9985
|
+
...ACTIVITY_QUERY_KEY(activity.commentedId),
|
|
9986
|
+
...GetBaseSingleQueryKeys(clientApiParams.locale)
|
|
9987
|
+
]);
|
|
9988
|
+
UpdateCommentsInfinite(
|
|
9989
|
+
true,
|
|
9990
|
+
queryClient,
|
|
9991
|
+
[...ACTIVITIES_QUERY_KEY(), clientApiParams.locale],
|
|
9992
|
+
activity.commentedId
|
|
9993
|
+
);
|
|
9994
|
+
}
|
|
9950
9995
|
}
|
|
9996
|
+
const clientApi = await GetClientAPI(clientApiParams);
|
|
9997
|
+
const { data } = await clientApi.post(
|
|
9998
|
+
`/self/activities`,
|
|
9999
|
+
activity
|
|
10000
|
+
);
|
|
10001
|
+
if (queryClient && data.status === "ok") {
|
|
10002
|
+
let nested = false;
|
|
10003
|
+
if (activity.commentedId) {
|
|
10004
|
+
nested = true;
|
|
10005
|
+
AppendInfiniteQuery(
|
|
10006
|
+
queryClient,
|
|
10007
|
+
[
|
|
10008
|
+
...ACTIVITY_COMMENTS_QUERY_KEY(activity.commentedId),
|
|
10009
|
+
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
10010
|
+
],
|
|
10011
|
+
data.data
|
|
10012
|
+
);
|
|
10013
|
+
}
|
|
10014
|
+
if (activity.contentId && data.data.content) {
|
|
10015
|
+
nested = true;
|
|
10016
|
+
AppendInfiniteQuery(
|
|
10017
|
+
queryClient,
|
|
10018
|
+
[
|
|
10019
|
+
...CHANNEL_CONTENT_ACTIVITIES_QUERY_KEY(
|
|
10020
|
+
data.data.content.channel.slug,
|
|
10021
|
+
activity.contentId
|
|
10022
|
+
),
|
|
10023
|
+
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
10024
|
+
],
|
|
10025
|
+
data.data
|
|
10026
|
+
);
|
|
10027
|
+
AppendInfiniteQuery(
|
|
10028
|
+
queryClient,
|
|
10029
|
+
[
|
|
10030
|
+
...CHANNEL_CONTENT_ACTIVITIES_QUERY_KEY(
|
|
10031
|
+
data.data.content.channel.id,
|
|
10032
|
+
activity.contentId
|
|
10033
|
+
),
|
|
10034
|
+
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
10035
|
+
],
|
|
10036
|
+
data.data
|
|
10037
|
+
);
|
|
10038
|
+
}
|
|
10039
|
+
if (activity.eventId) {
|
|
10040
|
+
nested = true;
|
|
10041
|
+
AppendInfiniteQuery(
|
|
10042
|
+
queryClient,
|
|
10043
|
+
[
|
|
10044
|
+
...EVENT_ACTIVITIES_QUERY_KEY(activity.eventId),
|
|
10045
|
+
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
10046
|
+
],
|
|
10047
|
+
data.data
|
|
10048
|
+
);
|
|
10049
|
+
}
|
|
10050
|
+
if (activity.groupId) {
|
|
10051
|
+
nested = true;
|
|
10052
|
+
AppendInfiniteQuery(
|
|
10053
|
+
queryClient,
|
|
10054
|
+
[
|
|
10055
|
+
...GROUP_ACTIVITIES_QUERY_KEY(activity.groupId),
|
|
10056
|
+
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
10057
|
+
],
|
|
10058
|
+
data.data
|
|
10059
|
+
);
|
|
10060
|
+
}
|
|
10061
|
+
if (!nested) {
|
|
10062
|
+
AppendInfiniteQuery(
|
|
10063
|
+
queryClient,
|
|
10064
|
+
[
|
|
10065
|
+
...ACTIVITIES_QUERY_KEY(),
|
|
10066
|
+
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
10067
|
+
],
|
|
10068
|
+
data.data
|
|
10069
|
+
);
|
|
10070
|
+
}
|
|
10071
|
+
}
|
|
10072
|
+
return data;
|
|
10073
|
+
};
|
|
10074
|
+
var useCreateActivity = (options = {}) => {
|
|
10075
|
+
return useConnectedMutation_default(CreateActivity, options);
|
|
10076
|
+
};
|
|
10077
|
+
|
|
10078
|
+
// src/mutations/activities/useDeleteActivity.ts
|
|
10079
|
+
var DeleteActivity = async ({
|
|
10080
|
+
activityId,
|
|
10081
|
+
clientApiParams,
|
|
10082
|
+
queryClient
|
|
10083
|
+
}) => {
|
|
9951
10084
|
const clientApi = await GetClientAPI(clientApiParams);
|
|
9952
10085
|
const { data } = await clientApi.delete(
|
|
9953
|
-
`/
|
|
10086
|
+
`/activities/${activityId}`
|
|
9954
10087
|
);
|
|
10088
|
+
if (queryClient && data.status === "ok") {
|
|
10089
|
+
queryClient.invalidateQueries({ queryKey: ACTIVITIES_QUERY_KEY() });
|
|
10090
|
+
}
|
|
9955
10091
|
return data;
|
|
9956
10092
|
};
|
|
9957
|
-
var
|
|
9958
|
-
return useConnectedMutation_default(
|
|
10093
|
+
var useDeleteActivity = (options = {}) => {
|
|
10094
|
+
return useConnectedMutation_default(DeleteActivity, options);
|
|
9959
10095
|
};
|
|
9960
10096
|
|
|
9961
10097
|
// src/mutations/activities/optimistic/UpdateLikes.ts
|
|
@@ -10006,7 +10142,7 @@ var LikeActivity = async ({
|
|
|
10006
10142
|
}
|
|
10007
10143
|
const clientApi = await GetClientAPI(clientApiParams);
|
|
10008
10144
|
const { data } = await clientApi.post(
|
|
10009
|
-
`/
|
|
10145
|
+
`/activities/${activityId}/likes`
|
|
10010
10146
|
);
|
|
10011
10147
|
return data;
|
|
10012
10148
|
};
|
|
@@ -10014,37 +10150,6 @@ var useLikeActivity = (options = {}) => {
|
|
|
10014
10150
|
return useConnectedMutation_default(LikeActivity, options);
|
|
10015
10151
|
};
|
|
10016
10152
|
|
|
10017
|
-
// src/mutations/activities/useReshareActivity.ts
|
|
10018
|
-
var ReshareActivity = async ({
|
|
10019
|
-
activityId,
|
|
10020
|
-
queryClient,
|
|
10021
|
-
clientApiParams
|
|
10022
|
-
}) => {
|
|
10023
|
-
if (queryClient) {
|
|
10024
|
-
UpdateResharesSingle(true, queryClient, [
|
|
10025
|
-
...ACTIVITY_QUERY_KEY(activityId),
|
|
10026
|
-
...GetBaseSingleQueryKeys(clientApiParams.locale)
|
|
10027
|
-
]);
|
|
10028
|
-
UpdateResharesInfinite(
|
|
10029
|
-
true,
|
|
10030
|
-
queryClient,
|
|
10031
|
-
ACTIVITIES_QUERY_KEY(),
|
|
10032
|
-
activityId
|
|
10033
|
-
);
|
|
10034
|
-
}
|
|
10035
|
-
const clientApi = await GetClientAPI(clientApiParams);
|
|
10036
|
-
const { data } = await clientApi.post(
|
|
10037
|
-
`/self/activities/${activityId}/reshares`,
|
|
10038
|
-
{
|
|
10039
|
-
message: ""
|
|
10040
|
-
}
|
|
10041
|
-
);
|
|
10042
|
-
return data;
|
|
10043
|
-
};
|
|
10044
|
-
var useReshareActivity = (options = {}) => {
|
|
10045
|
-
return useConnectedMutation_default(ReshareActivity, options);
|
|
10046
|
-
};
|
|
10047
|
-
|
|
10048
10153
|
// src/mutations/activities/useUnlikeActivity.ts
|
|
10049
10154
|
var UnlikeActivity = async ({
|
|
10050
10155
|
activityId,
|
|
@@ -10060,7 +10165,7 @@ var UnlikeActivity = async ({
|
|
|
10060
10165
|
}
|
|
10061
10166
|
const clientApi = await GetClientAPI(clientApiParams);
|
|
10062
10167
|
const { data } = await clientApi.delete(
|
|
10063
|
-
`/
|
|
10168
|
+
`/activities/${activityId}/likes`
|
|
10064
10169
|
);
|
|
10065
10170
|
return data;
|
|
10066
10171
|
};
|
|
@@ -11786,166 +11891,6 @@ var useRemoveSelfEventSession = (options = {}) => {
|
|
|
11786
11891
|
return useConnectedMutation_default(RemoveSelfEventSession, options);
|
|
11787
11892
|
};
|
|
11788
11893
|
|
|
11789
|
-
// src/mutations/activities/optimistic/UpdateComments.ts
|
|
11790
|
-
var import_immer6 = require("immer");
|
|
11791
|
-
var UpdateCommentsSingle = (increment, queryClient, KEY) => {
|
|
11792
|
-
queryClient.setQueryData(
|
|
11793
|
-
KEY,
|
|
11794
|
-
(originalData) => (0, import_immer6.produce)(originalData, (draft) => {
|
|
11795
|
-
if (!draft?.data) {
|
|
11796
|
-
return;
|
|
11797
|
-
}
|
|
11798
|
-
draft.data._count.comments += increment ? 1 : -1;
|
|
11799
|
-
draft.data.comments = increment ? [{ id: Date.now().toString() }] : [];
|
|
11800
|
-
})
|
|
11801
|
-
);
|
|
11802
|
-
};
|
|
11803
|
-
var UpdateCommentsInfinite = (increment, queryClient, KEY, activityId) => {
|
|
11804
|
-
queryClient.setQueriesData(
|
|
11805
|
-
{ queryKey: KEY, exact: false },
|
|
11806
|
-
(originalData) => (0, import_immer6.produce)(originalData, (draft) => {
|
|
11807
|
-
if (!draft?.pages || draft.pages.length === 0) {
|
|
11808
|
-
return;
|
|
11809
|
-
}
|
|
11810
|
-
for (const page of draft.pages) {
|
|
11811
|
-
for (const activity of page.data) {
|
|
11812
|
-
if (activity.id === activityId) {
|
|
11813
|
-
activity._count.comments += increment ? 1 : -1;
|
|
11814
|
-
activity.comments = increment ? [{ id: Date.now().toString() }] : [];
|
|
11815
|
-
}
|
|
11816
|
-
}
|
|
11817
|
-
}
|
|
11818
|
-
})
|
|
11819
|
-
);
|
|
11820
|
-
};
|
|
11821
|
-
|
|
11822
|
-
// src/mutations/self/useSelfCreateActivity.ts
|
|
11823
|
-
var SelfCreateActivity = async ({
|
|
11824
|
-
activity,
|
|
11825
|
-
base64Image,
|
|
11826
|
-
interests,
|
|
11827
|
-
clientApiParams,
|
|
11828
|
-
queryClient
|
|
11829
|
-
}) => {
|
|
11830
|
-
if (queryClient) {
|
|
11831
|
-
if (activity.commentedId) {
|
|
11832
|
-
UpdateCommentsSingle(true, queryClient, [
|
|
11833
|
-
...ACTIVITY_QUERY_KEY(activity.commentedId),
|
|
11834
|
-
...GetBaseSingleQueryKeys(clientApiParams.locale)
|
|
11835
|
-
]);
|
|
11836
|
-
UpdateCommentsInfinite(
|
|
11837
|
-
true,
|
|
11838
|
-
queryClient,
|
|
11839
|
-
[...ACTIVITIES_QUERY_KEY(), clientApiParams.locale],
|
|
11840
|
-
activity.commentedId
|
|
11841
|
-
);
|
|
11842
|
-
}
|
|
11843
|
-
}
|
|
11844
|
-
const clientApi = await GetClientAPI(clientApiParams);
|
|
11845
|
-
const { data } = await clientApi.post(
|
|
11846
|
-
`/self/activities`,
|
|
11847
|
-
{
|
|
11848
|
-
activity,
|
|
11849
|
-
imageUri: base64Image ?? void 0,
|
|
11850
|
-
interests: interests ?? void 0
|
|
11851
|
-
}
|
|
11852
|
-
);
|
|
11853
|
-
if (queryClient && data.status === "ok") {
|
|
11854
|
-
let nested = false;
|
|
11855
|
-
if (activity.commentedId) {
|
|
11856
|
-
nested = true;
|
|
11857
|
-
AppendInfiniteQuery(
|
|
11858
|
-
queryClient,
|
|
11859
|
-
[
|
|
11860
|
-
...ACTIVITY_COMMENTS_QUERY_KEY(activity.commentedId),
|
|
11861
|
-
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
11862
|
-
],
|
|
11863
|
-
data.data
|
|
11864
|
-
);
|
|
11865
|
-
}
|
|
11866
|
-
if (activity.contentId && data.data.content) {
|
|
11867
|
-
nested = true;
|
|
11868
|
-
AppendInfiniteQuery(
|
|
11869
|
-
queryClient,
|
|
11870
|
-
[
|
|
11871
|
-
...CHANNEL_CONTENT_ACTIVITIES_QUERY_KEY(
|
|
11872
|
-
data.data.content.channel.slug,
|
|
11873
|
-
activity.contentId
|
|
11874
|
-
),
|
|
11875
|
-
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
11876
|
-
],
|
|
11877
|
-
data.data
|
|
11878
|
-
);
|
|
11879
|
-
AppendInfiniteQuery(
|
|
11880
|
-
queryClient,
|
|
11881
|
-
[
|
|
11882
|
-
...CHANNEL_CONTENT_ACTIVITIES_QUERY_KEY(
|
|
11883
|
-
data.data.content.channel.id,
|
|
11884
|
-
activity.contentId
|
|
11885
|
-
),
|
|
11886
|
-
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
11887
|
-
],
|
|
11888
|
-
data.data
|
|
11889
|
-
);
|
|
11890
|
-
}
|
|
11891
|
-
if (activity.eventId) {
|
|
11892
|
-
nested = true;
|
|
11893
|
-
AppendInfiniteQuery(
|
|
11894
|
-
queryClient,
|
|
11895
|
-
[
|
|
11896
|
-
...EVENT_ACTIVITIES_QUERY_KEY(activity.eventId),
|
|
11897
|
-
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
11898
|
-
],
|
|
11899
|
-
data.data
|
|
11900
|
-
);
|
|
11901
|
-
}
|
|
11902
|
-
if (activity.groupId) {
|
|
11903
|
-
nested = true;
|
|
11904
|
-
AppendInfiniteQuery(
|
|
11905
|
-
queryClient,
|
|
11906
|
-
[
|
|
11907
|
-
...GROUP_ACTIVITIES_QUERY_KEY(activity.groupId),
|
|
11908
|
-
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
11909
|
-
],
|
|
11910
|
-
data.data
|
|
11911
|
-
);
|
|
11912
|
-
}
|
|
11913
|
-
if (!nested) {
|
|
11914
|
-
AppendInfiniteQuery(
|
|
11915
|
-
queryClient,
|
|
11916
|
-
[
|
|
11917
|
-
...ACTIVITIES_QUERY_KEY(),
|
|
11918
|
-
...GetBaseInfiniteQueryKeys(clientApiParams.locale)
|
|
11919
|
-
],
|
|
11920
|
-
data.data
|
|
11921
|
-
);
|
|
11922
|
-
}
|
|
11923
|
-
}
|
|
11924
|
-
return data;
|
|
11925
|
-
};
|
|
11926
|
-
var useSelfCreateActivity = (options = {}) => {
|
|
11927
|
-
return useConnectedMutation_default(SelfCreateActivity, options);
|
|
11928
|
-
};
|
|
11929
|
-
|
|
11930
|
-
// src/mutations/self/useSelfDeleteActivity.ts
|
|
11931
|
-
var DeleteActivity = async ({
|
|
11932
|
-
activityId,
|
|
11933
|
-
clientApiParams,
|
|
11934
|
-
queryClient
|
|
11935
|
-
}) => {
|
|
11936
|
-
const clientApi = await GetClientAPI(clientApiParams);
|
|
11937
|
-
const { data } = await clientApi.delete(
|
|
11938
|
-
`/self/activities/${activityId}`
|
|
11939
|
-
);
|
|
11940
|
-
if (queryClient && data.status === "ok") {
|
|
11941
|
-
queryClient.invalidateQueries({ queryKey: ACTIVITIES_QUERY_KEY() });
|
|
11942
|
-
}
|
|
11943
|
-
return data;
|
|
11944
|
-
};
|
|
11945
|
-
var useDeleteActivity = (options = {}) => {
|
|
11946
|
-
return useConnectedMutation_default(DeleteActivity, options);
|
|
11947
|
-
};
|
|
11948
|
-
|
|
11949
11894
|
// src/mutations/self/useSelfUpdateGroupMembership.ts
|
|
11950
11895
|
var SelfUpdateGroupMembership = async ({
|
|
11951
11896
|
groupId,
|
|
@@ -13479,7 +13424,7 @@ var useUpdateThreadMessage = (options = {}) => {
|
|
|
13479
13424
|
};
|
|
13480
13425
|
|
|
13481
13426
|
// src/mutations/threads/useDeleteThreadMessage.ts
|
|
13482
|
-
var
|
|
13427
|
+
var import_immer6 = require("immer");
|
|
13483
13428
|
var DeleteThreadMessage = async ({
|
|
13484
13429
|
threadId,
|
|
13485
13430
|
messageId,
|
|
@@ -13503,7 +13448,7 @@ var DeleteThreadMessage = async ({
|
|
|
13503
13448
|
],
|
|
13504
13449
|
(oldData) => {
|
|
13505
13450
|
if (!oldData) return oldData;
|
|
13506
|
-
return (0,
|
|
13451
|
+
return (0, import_immer6.produce)(oldData, (draft) => {
|
|
13507
13452
|
draft.pages.forEach((page) => {
|
|
13508
13453
|
const index = page.data.findIndex((m) => m.id === messageId);
|
|
13509
13454
|
if (index !== -1) {
|
|
@@ -13768,6 +13713,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
13768
13713
|
AcceptGroupInvitation,
|
|
13769
13714
|
AcceptGroupRequest,
|
|
13770
13715
|
AccountType,
|
|
13716
|
+
ActivityEntityType,
|
|
13771
13717
|
AddChannelCollectionContent,
|
|
13772
13718
|
AddChannelInterest,
|
|
13773
13719
|
AddContentInterest,
|
|
@@ -13821,6 +13767,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
13821
13767
|
ConnectedXMProvider,
|
|
13822
13768
|
ContentGuestType,
|
|
13823
13769
|
CouponType,
|
|
13770
|
+
CreateActivity,
|
|
13824
13771
|
CreateChannel,
|
|
13825
13772
|
CreateChannelCollection,
|
|
13826
13773
|
CreateChannelContent,
|
|
@@ -13860,7 +13807,6 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
13860
13807
|
DeleteListingQuestion,
|
|
13861
13808
|
DeleteListingSession,
|
|
13862
13809
|
DeleteListingSpeaker,
|
|
13863
|
-
DeleteReshare,
|
|
13864
13810
|
DeleteSelf,
|
|
13865
13811
|
DeleteSelfAddress,
|
|
13866
13812
|
DeleteSelfChatChannel,
|
|
@@ -14020,6 +13966,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14020
13966
|
GetLevel,
|
|
14021
13967
|
GetLevelSponsors,
|
|
14022
13968
|
GetLevels,
|
|
13969
|
+
GetLinkPreview,
|
|
14023
13970
|
GetListingAttendeePassQuestionSections,
|
|
14024
13971
|
GetManagedChannel,
|
|
14025
13972
|
GetManagedChannelCollection,
|
|
@@ -14136,6 +14083,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14136
14083
|
LEVELS_QUERY_KEY,
|
|
14137
14084
|
LEVEL_QUERY_KEY,
|
|
14138
14085
|
LEVEL_SPONSORS_QUERY_KEY,
|
|
14086
|
+
LINK_PREVIEW_QUERY_KEY,
|
|
14139
14087
|
LISTINGS_QUERY_KEY,
|
|
14140
14088
|
LISTING_ANNOUNCEMENTS_QUERY_KEY,
|
|
14141
14089
|
LISTING_ANNOUNCEMENT_QUERY_KEY,
|
|
@@ -14198,7 +14146,6 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14198
14146
|
RemoveSelfEventSession,
|
|
14199
14147
|
RemoveThreadMessageReaction,
|
|
14200
14148
|
ReportActivity,
|
|
14201
|
-
ReshareActivity,
|
|
14202
14149
|
SELF_ACTIVITIES_QUERY_KEY,
|
|
14203
14150
|
SELF_ADDRESSES_QUERY_KEY,
|
|
14204
14151
|
SELF_ADDRESS_QUERY_KEY,
|
|
@@ -14327,6 +14274,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14327
14274
|
SET_LEVELS_QUERY_DATA,
|
|
14328
14275
|
SET_LEVEL_QUERY_DATA,
|
|
14329
14276
|
SET_LEVEL_SPONSORS_QUERY_DATA,
|
|
14277
|
+
SET_LINK_PREVIEW_QUERY_DATA,
|
|
14330
14278
|
SET_LISTING_ANNOUNCEMENT_QUERY_KEY,
|
|
14331
14279
|
SET_LISTING_ATTENDEE_PASS_QUESTION_SECTIONS_QUERY_DATA,
|
|
14332
14280
|
SET_LISTING_ATTENDEE_QUERY_KEY,
|
|
@@ -14386,7 +14334,6 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14386
14334
|
SURVEY_SUBMISSION_QUERY_KEY,
|
|
14387
14335
|
SURVEY_SUBMISSION_SECTIONS_QUERY_KEY,
|
|
14388
14336
|
SelectSelfEventRegistrationCoupon,
|
|
14389
|
-
SelfCreateActivity,
|
|
14390
14337
|
SelfUpdateGroupMembership,
|
|
14391
14338
|
SetContentPublishSchedule,
|
|
14392
14339
|
StartSurvey,
|
|
@@ -14521,6 +14468,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14521
14468
|
useConnectedMutation,
|
|
14522
14469
|
useConnectedSingleQuery,
|
|
14523
14470
|
useConnectedXM,
|
|
14471
|
+
useCreateActivity,
|
|
14524
14472
|
useCreateChannel,
|
|
14525
14473
|
useCreateChannelCollection,
|
|
14526
14474
|
useCreateChannelContent,
|
|
@@ -14557,7 +14505,6 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14557
14505
|
useDeleteListingQuestion,
|
|
14558
14506
|
useDeleteListingSession,
|
|
14559
14507
|
useDeleteListingSpeaker,
|
|
14560
|
-
useDeleteReshare,
|
|
14561
14508
|
useDeleteSelf,
|
|
14562
14509
|
useDeleteSelfAddress,
|
|
14563
14510
|
useDeleteSelfChatChannel,
|
|
@@ -14660,6 +14607,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14660
14607
|
useGetLevel,
|
|
14661
14608
|
useGetLevelSponsors,
|
|
14662
14609
|
useGetLevels,
|
|
14610
|
+
useGetLinkPreview,
|
|
14663
14611
|
useGetListingAttendeePassQuestionSections,
|
|
14664
14612
|
useGetManagedChannel,
|
|
14665
14613
|
useGetManagedChannelCollection,
|
|
@@ -14786,9 +14734,7 @@ var useUploadSurveyResponseFile = (options = {}) => {
|
|
|
14786
14734
|
useRemoveSelfEventSession,
|
|
14787
14735
|
useRemoveThreadMessageReaction,
|
|
14788
14736
|
useReportActivity,
|
|
14789
|
-
useReshareActivity,
|
|
14790
14737
|
useSelectSelfEventRegistrationCoupon,
|
|
14791
|
-
useSelfCreateActivity,
|
|
14792
14738
|
useSelfUpdateGroupMembership,
|
|
14793
14739
|
useSetContentPublishSchedule,
|
|
14794
14740
|
useStartSurvey,
|