@connectedxm/client 2.2.1 → 2.3.3

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.js CHANGED
@@ -7819,6 +7819,76 @@ var useGetInterests = (params = {}, options = {}) => {
7819
7819
  );
7820
7820
  };
7821
7821
 
7822
+ // src/queries/interests/useGetInterest.ts
7823
+ var INTEREST_QUERY_KEY = (interest) => [
7824
+ ...INTERESTS_QUERY_KEY(),
7825
+ interest
7826
+ ];
7827
+ var GetInterest = async ({
7828
+ interest,
7829
+ clientApiParams
7830
+ }) => {
7831
+ const clientApi = await GetClientAPI(clientApiParams);
7832
+ const { data } = await clientApi.get(`/interests/${interest}`);
7833
+ return data;
7834
+ };
7835
+ var useGetInterest = (interest = "", options = {}) => {
7836
+ return useConnectedSingleQuery(
7837
+ INTEREST_QUERY_KEY(interest),
7838
+ (_params) => GetInterest({ interest, ..._params }),
7839
+ {
7840
+ ...options,
7841
+ enabled: !!interest && (options?.enabled ?? true)
7842
+ }
7843
+ );
7844
+ };
7845
+
7846
+ // src/queries/interests/useGetInterestActivities.ts
7847
+ var INTEREST_ACTIVITIES_QUERY_KEY = (interest) => [
7848
+ ...ACTIVITIES_QUERY_KEY(),
7849
+ ...INTEREST_QUERY_KEY(interest)
7850
+ ];
7851
+ var GetInterestActivities = async ({
7852
+ pageParam,
7853
+ pageSize,
7854
+ orderBy,
7855
+ search,
7856
+ interest,
7857
+ queryClient,
7858
+ clientApiParams,
7859
+ locale
7860
+ }) => {
7861
+ const clientApi = await GetClientAPI(clientApiParams);
7862
+ const { data } = await clientApi.get(`/interests/${interest}/activities`, {
7863
+ params: {
7864
+ page: pageParam || void 0,
7865
+ pageSize: pageSize || void 0,
7866
+ orderBy: orderBy || void 0,
7867
+ search: search || void 0
7868
+ }
7869
+ });
7870
+ if (queryClient && data.status === "ok") {
7871
+ CacheIndividualQueries(
7872
+ data,
7873
+ queryClient,
7874
+ (activityId) => ACTIVITY_QUERY_KEY(activityId),
7875
+ locale
7876
+ );
7877
+ }
7878
+ return data;
7879
+ };
7880
+ var useGetInterestActivities = (interest = "", params = {}, options = {}) => {
7881
+ return useConnectedInfiniteQuery(
7882
+ INTEREST_ACTIVITIES_QUERY_KEY(interest),
7883
+ (params2) => GetInterestActivities({ interest, ...params2 }),
7884
+ params,
7885
+ {
7886
+ ...options,
7887
+ enabled: !!interest && (options?.enabled ?? true)
7888
+ }
7889
+ );
7890
+ };
7891
+
7822
7892
  // src/queries/threads/useGetThread.ts
7823
7893
  var THREAD_QUERY_KEY = (threadId, accountId) => [...THREADS_QUERY_KEY(), threadId, accountId];
7824
7894
  var SET_THREAD_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"], options) => {
@@ -8614,9 +8684,9 @@ var useGetSurveyQuestionSearchValues = (surveyId = "", questionId = "", params =
8614
8684
  };
8615
8685
 
8616
8686
  // src/queries/link-previews/useGetLinkPreview.ts
8617
- var LINK_PREVIEW_QUERY_KEY = (href) => [
8687
+ var LINK_PREVIEW_QUERY_KEY = (url) => [
8618
8688
  "LINK_PREVIEW",
8619
- encodeURIComponent(href)
8689
+ encodeURIComponent(url)
8620
8690
  ];
8621
8691
  var SET_LINK_PREVIEW_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
8622
8692
  client.setQueryData(
@@ -8628,22 +8698,82 @@ var SET_LINK_PREVIEW_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"
8628
8698
  );
8629
8699
  };
8630
8700
  var GetLinkPreview = async ({
8631
- href,
8701
+ url,
8632
8702
  clientApiParams
8633
8703
  }) => {
8634
8704
  const clientApi = await GetClientAPI(clientApiParams);
8635
8705
  const { data } = await clientApi.get(
8636
- `/storage/link-preview?href=${encodeURIComponent(href)}`
8706
+ `/storage/link-preview?href=${encodeURIComponent(url)}`
8707
+ );
8708
+ return data;
8709
+ };
8710
+ var useGetLinkPreview = (url = "", options = {}) => {
8711
+ return useConnectedSingleQuery(
8712
+ LINK_PREVIEW_QUERY_KEY(url),
8713
+ (_params) => GetLinkPreview({ url, ..._params }),
8714
+ {
8715
+ ...options,
8716
+ enabled: !!url && (options?.enabled ?? true)
8717
+ }
8718
+ );
8719
+ };
8720
+
8721
+ // src/queries/storage/useGetVideo.ts
8722
+ var VIDEO_QUERY_KEY = (videoId) => [
8723
+ "VIDEO",
8724
+ videoId
8725
+ ];
8726
+ var SET_VIDEO_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
8727
+ client.setQueryData(
8728
+ [...VIDEO_QUERY_KEY(...keyParams), ...GetBaseSingleQueryKeys(...baseKeys)],
8729
+ response
8730
+ );
8731
+ };
8732
+ var GetVideo = async ({
8733
+ videoId,
8734
+ clientApiParams
8735
+ }) => {
8736
+ const clientApi = await GetClientAPI(clientApiParams);
8737
+ const { data } = await clientApi.get(`/storage/videos/${videoId}`);
8738
+ return data;
8739
+ };
8740
+ var useGetVideo = (videoId = "", options = {}) => {
8741
+ return useConnectedSingleQuery(
8742
+ VIDEO_QUERY_KEY(videoId),
8743
+ (_params) => GetVideo({ videoId, ..._params }),
8744
+ {
8745
+ ...options,
8746
+ enabled: !!videoId && (options?.enabled ?? true)
8747
+ }
8637
8748
  );
8749
+ };
8750
+
8751
+ // src/queries/storage/useGetImage.ts
8752
+ var IMAGE_QUERY_KEY = (imageId) => [
8753
+ "IMAGE",
8754
+ imageId
8755
+ ];
8756
+ var SET_IMAGE_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
8757
+ client.setQueryData(
8758
+ [...IMAGE_QUERY_KEY(...keyParams), ...GetBaseSingleQueryKeys(...baseKeys)],
8759
+ response
8760
+ );
8761
+ };
8762
+ var GetImage = async ({
8763
+ imageId,
8764
+ clientApiParams
8765
+ }) => {
8766
+ const clientApi = await GetClientAPI(clientApiParams);
8767
+ const { data } = await clientApi.get(`/storage/images/${imageId}`);
8638
8768
  return data;
8639
8769
  };
8640
- var useGetLinkPreview = (href = "", options = {}) => {
8770
+ var useGetImage = (imageId = "", options = {}) => {
8641
8771
  return useConnectedSingleQuery(
8642
- LINK_PREVIEW_QUERY_KEY(href),
8643
- (_params) => GetLinkPreview({ href, ..._params }),
8772
+ IMAGE_QUERY_KEY(imageId),
8773
+ (_params) => GetImage({ imageId, ..._params }),
8644
8774
  {
8645
8775
  ...options,
8646
- enabled: !!href && (options?.enabled ?? true)
8776
+ enabled: !!imageId && (options?.enabled ?? true)
8647
8777
  }
8648
8778
  );
8649
8779
  };
@@ -8881,7 +9011,7 @@ var CreateActivity = async ({
8881
9011
  }
8882
9012
  const clientApi = await GetClientAPI(clientApiParams);
8883
9013
  const { data } = await clientApi.post(
8884
- `/self/activities`,
9014
+ `/activities`,
8885
9015
  activity
8886
9016
  );
8887
9017
  if (queryClient && data.status === "ok") {
@@ -12084,6 +12214,46 @@ var useUploadFile = (options = {}) => {
12084
12214
  return useConnectedMutation_default(UploadFile, options);
12085
12215
  };
12086
12216
 
12217
+ // src/mutations/storage/useUploadVideo.ts
12218
+ var UploadVideo = async ({
12219
+ dataUri,
12220
+ source,
12221
+ name,
12222
+ minutes,
12223
+ clientApiParams
12224
+ }) => {
12225
+ const clientApi = await GetClientAPI(clientApiParams);
12226
+ const { data } = await clientApi.post(
12227
+ `/storage/videos`,
12228
+ {
12229
+ dataUri,
12230
+ source,
12231
+ name,
12232
+ minutes
12233
+ }
12234
+ );
12235
+ return data;
12236
+ };
12237
+ var useUploadVideo = (options = {}) => {
12238
+ return useConnectedMutation_default(UploadVideo, options);
12239
+ };
12240
+
12241
+ // src/mutations/storage/useUploadImage.ts
12242
+ var UploadImage = async ({
12243
+ image,
12244
+ clientApiParams
12245
+ }) => {
12246
+ const clientApi = await GetClientAPI(clientApiParams);
12247
+ const { data } = await clientApi.post(
12248
+ `/storage/images/upload`,
12249
+ image
12250
+ );
12251
+ return data;
12252
+ };
12253
+ var useUploadImage = (options = {}) => {
12254
+ return useConnectedMutation_default(UploadImage, options);
12255
+ };
12256
+
12087
12257
  // src/mutations/threads/useCreateThread.ts
12088
12258
  var CreateThread = async ({
12089
12259
  thread,
@@ -12578,6 +12748,22 @@ var UploadSurveyResponseFile = async ({
12578
12748
  var useUploadSurveyResponseFile = (options = {}) => {
12579
12749
  return useConnectedMutation_default(UploadSurveyResponseFile, options);
12580
12750
  };
12751
+
12752
+ // src/mutations/insterests/useCreateInterest.ts
12753
+ var CreateInterest = async ({
12754
+ interest,
12755
+ clientApiParams
12756
+ }) => {
12757
+ const clientApi = await GetClientAPI(clientApiParams);
12758
+ const { data } = await clientApi.post(
12759
+ `/interests`,
12760
+ interest
12761
+ );
12762
+ return data;
12763
+ };
12764
+ var useCreateInterest = (options = {}) => {
12765
+ return useConnectedMutation_default(CreateInterest, options);
12766
+ };
12581
12767
  export {
12582
12768
  ACCOUNTS_POPULAR_QUERY_KEY,
12583
12769
  ACCOUNTS_QUERY_KEY,
@@ -12662,6 +12848,7 @@ export {
12662
12848
  CreateGroupAnnouncement,
12663
12849
  CreateGroupInvitations,
12664
12850
  CreateGroupRequest,
12851
+ CreateInterest,
12665
12852
  CreateListing,
12666
12853
  CreateListingAnnouncement,
12667
12854
  CreateListingQuestion,
@@ -12842,9 +13029,12 @@ export {
12842
13029
  GetGroupsFeatured,
12843
13030
  GetGroupsInvited,
12844
13031
  GetGroupsRequested,
13032
+ GetImage,
12845
13033
  GetIntegration,
12846
13034
  GetIntegrationAuth,
12847
13035
  GetIntegrations,
13036
+ GetInterest,
13037
+ GetInterestActivities,
12848
13038
  GetInterests,
12849
13039
  GetInvoice,
12850
13040
  GetInvoiceIntent,
@@ -12952,14 +13142,18 @@ export {
12952
13142
  GetThreadMessageReplies,
12953
13143
  GetThreadMessages,
12954
13144
  GetThreads,
13145
+ GetVideo,
12955
13146
  GroupAccess,
12956
13147
  GroupInvitationStatus,
12957
13148
  GroupMembershipRole,
12958
13149
  GroupRequestStatus,
13150
+ IMAGE_QUERY_KEY,
12959
13151
  INTEGRATIONS_QUERY_KEY,
12960
13152
  INTEGRATION_AUTH_QUERY_KEY,
12961
13153
  INTEGRATION_QUERY_KEY,
12962
13154
  INTERESTS_QUERY_KEY,
13155
+ INTEREST_ACTIVITIES_QUERY_KEY,
13156
+ INTEREST_QUERY_KEY,
12963
13157
  INVOICE_QUERY_KEY,
12964
13158
  ImageType,
12965
13159
  IntegrationType,
@@ -13151,6 +13345,7 @@ export {
13151
13345
  SET_GROUP_REQUESTS_QUERY_DATA,
13152
13346
  SET_GROUP_REQUEST_QUERY_DATA,
13153
13347
  SET_GROUP_SPONSORS_QUERY_DATA,
13348
+ SET_IMAGE_QUERY_DATA,
13154
13349
  SET_INTEGRATIONS_QUERY_DATA,
13155
13350
  SET_INTEGRATION_AUTH_QUERY_DATA,
13156
13351
  SET_INTEGRATION_QUERY_DATA,
@@ -13211,6 +13406,7 @@ export {
13211
13406
  SET_THREAD_MESSAGE_REPLIES_QUERY_DATA,
13212
13407
  SET_THREAD_QUERY_DATA,
13213
13408
  SET_TRANSFER_ACCOUNTS_QUERY_DATA,
13409
+ SET_VIDEO_QUERY_DATA,
13214
13410
  SUBSCRIBED_CHANNELS_QUERY_KEY,
13215
13411
  SUBSCRIBED_CONTENTS_QUERY_KEY,
13216
13412
  SURVEY_QUERY_KEY,
@@ -13283,7 +13479,10 @@ export {
13283
13479
  UpdateThreadMessage,
13284
13480
  UploadChannelContentImage,
13285
13481
  UploadFile,
13482
+ UploadImage,
13286
13483
  UploadSurveyResponseFile,
13484
+ UploadVideo,
13485
+ VIDEO_QUERY_KEY,
13287
13486
  isListing,
13288
13487
  isManagedCoupon,
13289
13488
  isRegistrationQuestion,
@@ -13363,6 +13562,7 @@ export {
13363
13562
  useCreateGroupAnnouncement,
13364
13563
  useCreateGroupInvitations,
13365
13564
  useCreateGroupRequest,
13565
+ useCreateInterest,
13366
13566
  useCreateListing,
13367
13567
  useCreateListingAnnouncement,
13368
13568
  useCreateListingQuestion,
@@ -13483,9 +13683,12 @@ export {
13483
13683
  useGetGroupsFeatured,
13484
13684
  useGetGroupsInvited,
13485
13685
  useGetGroupsRequested,
13686
+ useGetImage,
13486
13687
  useGetIntegration,
13487
13688
  useGetIntegrationAuth,
13488
13689
  useGetIntegrations,
13690
+ useGetInterest,
13691
+ useGetInterestActivities,
13489
13692
  useGetInterests,
13490
13693
  useGetInvoice,
13491
13694
  useGetInvoiceIntent,
@@ -13593,6 +13796,7 @@ export {
13593
13796
  useGetThreadMessageReplies,
13594
13797
  useGetThreadMessages,
13595
13798
  useGetThreads,
13799
+ useGetVideo,
13596
13800
  useGroupStatus,
13597
13801
  useIsAccountFollowing,
13598
13802
  useIsChannelSubscribed,
@@ -13664,5 +13868,7 @@ export {
13664
13868
  useUpdateThreadMessage,
13665
13869
  useUploadChannelContentImage,
13666
13870
  useUploadFile,
13667
- useUploadSurveyResponseFile
13871
+ useUploadImage,
13872
+ useUploadSurveyResponseFile,
13873
+ useUploadVideo
13668
13874
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/client",
3
- "version": "2.2.1",
3
+ "version": "2.3.3",
4
4
  "description": "Client API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",
@@ -24,13 +24,23 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "axios": "^1.8.4",
27
- "immer": "^10.1.1",
28
- "local": "^0.3.3"
27
+ "immer": "^10.1.1"
29
28
  },
30
29
  "peerDependencies": {
31
30
  "@tanstack/react-query": "^5.0.0",
32
- "react": "^19.0.0",
33
- "react-use-websocket": "^4.0.0"
31
+ "@types/react": "^18.0.0 || ^19.0.0",
32
+ "react": "^18.0.0 || ^19.0.0"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "@tanstack/react-query": {
36
+ "optional": true
37
+ },
38
+ "react": {
39
+ "optional": true
40
+ },
41
+ "@types/react": {
42
+ "optional": true
43
+ }
34
44
  },
35
45
  "devDependencies": {
36
46
  "@swc/core": "^1.11.21",
@@ -41,6 +51,7 @@
41
51
  "eslint": "^9.24.0",
42
52
  "eslint-plugin-react": "^7.37.5",
43
53
  "eslint-plugin-react-hooks": "^5.2.0",
54
+ "react": "^19.1.0",
44
55
  "tsup": "^8.4.0",
45
56
  "typescript": "^5.8.3",
46
57
  "vitest": "^3.1.1"