@connectedxm/admin 2.8.18 → 2.8.20

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 CHANGED
@@ -1149,6 +1149,7 @@ __export(index_exports, {
1149
1149
  GetTiers: () => GetTiers,
1150
1150
  GetVideo: () => GetVideo,
1151
1151
  GetVideoCaptions: () => GetVideoCaptions,
1152
+ GetVideoDownloadStatus: () => GetVideoDownloadStatus,
1152
1153
  GetVideos: () => GetVideos,
1153
1154
  GroupAccess: () => GroupAccess,
1154
1155
  GroupInvitationStatus: () => GroupInvitationStatus,
@@ -1180,6 +1181,7 @@ __export(index_exports, {
1180
1181
  ImpersonateAccount: () => ImpersonateAccount,
1181
1182
  ImportItemStatus: () => ImportItemStatus,
1182
1183
  ImportType: () => ImportType,
1184
+ InitiateVideoDownload: () => InitiateVideoDownload,
1183
1185
  IntegrationType: () => IntegrationType,
1184
1186
  InvoiceStatus: () => InvoiceStatus,
1185
1187
  LEVELS_QUERY_KEY: () => LEVELS_QUERY_KEY,
@@ -1747,6 +1749,7 @@ __export(index_exports, {
1747
1749
  SET_TIER_SUBSCRIBERS_QUERY_DATA: () => SET_TIER_SUBSCRIBERS_QUERY_DATA,
1748
1750
  SET_VIDEOS_QUERY_DATA: () => SET_VIDEOS_QUERY_DATA,
1749
1751
  SET_VIDEO_CAPTIONS_QUERY_DATA: () => SET_VIDEO_CAPTIONS_QUERY_DATA,
1752
+ SET_VIDEO_DOWNLOAD_STATUS_QUERY_DATA: () => SET_VIDEO_DOWNLOAD_STATUS_QUERY_DATA,
1750
1753
  SET_VIDEO_QUERY_DATA: () => SET_VIDEO_QUERY_DATA,
1751
1754
  STREAM_INPUTS_QUERY_KEY: () => STREAM_INPUTS_QUERY_KEY,
1752
1755
  STREAM_INPUT_OUTPUTS_QUERY_KEY: () => STREAM_INPUT_OUTPUTS_QUERY_KEY,
@@ -1995,6 +1998,7 @@ __export(index_exports, {
1995
1998
  UserRole: () => UserRole,
1996
1999
  VIDEOS_QUERY_KEY: () => VIDEOS_QUERY_KEY,
1997
2000
  VIDEO_CAPTIONS_QUERY_KEY: () => VIDEO_CAPTIONS_QUERY_KEY,
2001
+ VIDEO_DOWNLOAD_STATUS_QUERY_KEY: () => VIDEO_DOWNLOAD_STATUS_QUERY_KEY,
1998
2002
  VIDEO_QUERY_KEY: () => VIDEO_QUERY_KEY,
1999
2003
  VerifyOrganizationWebhook: () => VerifyOrganizationWebhook,
2000
2004
  VideoSource: () => VideoSource,
@@ -2787,8 +2791,10 @@ __export(index_exports, {
2787
2791
  useGetTiers: () => useGetTiers,
2788
2792
  useGetVideo: () => useGetVideo,
2789
2793
  useGetVideoCaptions: () => useGetVideoCaptions,
2794
+ useGetVideoDownloadStatus: () => useGetVideoDownloadStatus,
2790
2795
  useGetVideos: () => useGetVideos,
2791
2796
  useImpersonateAccount: () => useImpersonateAccount,
2797
+ useInitiateVideoDownload: () => useInitiateVideoDownload,
2792
2798
  useRefundOrganizationPayment: () => useRefundOrganizationPayment,
2793
2799
  useReinviteGroupInvitation: () => useReinviteGroupInvitation,
2794
2800
  useRejectGroupRequest: () => useRejectGroupRequest,
@@ -21620,6 +21626,35 @@ var useGetVideoCaptions = (videoId = "", params = {}, options = {}) => {
21620
21626
  );
21621
21627
  };
21622
21628
 
21629
+ // src/queries/videos/useGetVideoDownloadStatus.ts
21630
+ var VIDEO_DOWNLOAD_STATUS_QUERY_KEY = (videoId) => [
21631
+ ...VIDEOS_QUERY_KEY(""),
21632
+ videoId,
21633
+ "download-status"
21634
+ ];
21635
+ var SET_VIDEO_DOWNLOAD_STATUS_QUERY_DATA = (client, keyParams, response) => {
21636
+ client.setQueryData(VIDEO_DOWNLOAD_STATUS_QUERY_KEY(...keyParams), response);
21637
+ };
21638
+ var GetVideoDownloadStatus = async ({
21639
+ videoId,
21640
+ adminApiParams
21641
+ }) => {
21642
+ const adminApi = await GetAdminAPI(adminApiParams);
21643
+ const { data } = await adminApi.get(`/videos/${videoId}/downloads`);
21644
+ return data;
21645
+ };
21646
+ var useGetVideoDownloadStatus = (videoId = "", options = {}) => {
21647
+ return useConnectedSingleQuery(
21648
+ VIDEO_DOWNLOAD_STATUS_QUERY_KEY(videoId),
21649
+ (params) => GetVideoDownloadStatus({ videoId, ...params }),
21650
+ {
21651
+ ...options,
21652
+ enabled: !!videoId && (options?.enabled ?? true)
21653
+ },
21654
+ "storage"
21655
+ );
21656
+ };
21657
+
21623
21658
  // src/PermissionsWrapper.tsx
21624
21659
  var PermissionsWrapper = ({
21625
21660
  children,
@@ -38886,6 +38921,29 @@ var useGenerateVideoCaptions = (options = {}) => {
38886
38921
  });
38887
38922
  };
38888
38923
 
38924
+ // src/mutations/videos/useInitiateVideoDownload.ts
38925
+ var InitiateVideoDownload = async ({
38926
+ videoId,
38927
+ adminApiParams,
38928
+ queryClient
38929
+ }) => {
38930
+ const connectedXM = await GetAdminAPI(adminApiParams);
38931
+ const { data } = await connectedXM.post(`/videos/${videoId}/downloads`);
38932
+ if (queryClient && data.status === "ok") {
38933
+ queryClient.invalidateQueries({ queryKey: VIDEOS_QUERY_KEY() });
38934
+ if (data.data?.default?.url) {
38935
+ queryClient.invalidateQueries({ queryKey: VIDEOS_QUERY_KEY(videoId) });
38936
+ }
38937
+ }
38938
+ return data;
38939
+ };
38940
+ var useInitiateVideoDownload = (options = {}) => {
38941
+ return useConnectedMutation(InitiateVideoDownload, options, {
38942
+ domain: "storage",
38943
+ type: "update"
38944
+ });
38945
+ };
38946
+
38889
38947
  // src/mutations/videos/useUpdateVideo.ts
38890
38948
  var UpdateVideo = async ({
38891
38949
  videoId,
@@ -40062,6 +40120,7 @@ var useUploadVideoCaptions = (options = {}) => {
40062
40120
  GetTiers,
40063
40121
  GetVideo,
40064
40122
  GetVideoCaptions,
40123
+ GetVideoDownloadStatus,
40065
40124
  GetVideos,
40066
40125
  GroupAccess,
40067
40126
  GroupInvitationStatus,
@@ -40093,6 +40152,7 @@ var useUploadVideoCaptions = (options = {}) => {
40093
40152
  ImpersonateAccount,
40094
40153
  ImportItemStatus,
40095
40154
  ImportType,
40155
+ InitiateVideoDownload,
40096
40156
  IntegrationType,
40097
40157
  InvoiceStatus,
40098
40158
  LEVELS_QUERY_KEY,
@@ -40660,6 +40720,7 @@ var useUploadVideoCaptions = (options = {}) => {
40660
40720
  SET_TIER_SUBSCRIBERS_QUERY_DATA,
40661
40721
  SET_VIDEOS_QUERY_DATA,
40662
40722
  SET_VIDEO_CAPTIONS_QUERY_DATA,
40723
+ SET_VIDEO_DOWNLOAD_STATUS_QUERY_DATA,
40663
40724
  SET_VIDEO_QUERY_DATA,
40664
40725
  STREAM_INPUTS_QUERY_KEY,
40665
40726
  STREAM_INPUT_OUTPUTS_QUERY_KEY,
@@ -40908,6 +40969,7 @@ var useUploadVideoCaptions = (options = {}) => {
40908
40969
  UserRole,
40909
40970
  VIDEOS_QUERY_KEY,
40910
40971
  VIDEO_CAPTIONS_QUERY_KEY,
40972
+ VIDEO_DOWNLOAD_STATUS_QUERY_KEY,
40911
40973
  VIDEO_QUERY_KEY,
40912
40974
  VerifyOrganizationWebhook,
40913
40975
  VideoSource,
@@ -41700,8 +41762,10 @@ var useUploadVideoCaptions = (options = {}) => {
41700
41762
  useGetTiers,
41701
41763
  useGetVideo,
41702
41764
  useGetVideoCaptions,
41765
+ useGetVideoDownloadStatus,
41703
41766
  useGetVideos,
41704
41767
  useImpersonateAccount,
41768
+ useInitiateVideoDownload,
41705
41769
  useRefundOrganizationPayment,
41706
41770
  useReinviteGroupInvitation,
41707
41771
  useRejectGroupRequest,