@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.js CHANGED
@@ -18592,6 +18592,35 @@ var useGetVideoCaptions = (videoId = "", params = {}, options = {}) => {
18592
18592
  );
18593
18593
  };
18594
18594
 
18595
+ // src/queries/videos/useGetVideoDownloadStatus.ts
18596
+ var VIDEO_DOWNLOAD_STATUS_QUERY_KEY = (videoId) => [
18597
+ ...VIDEOS_QUERY_KEY(""),
18598
+ videoId,
18599
+ "download-status"
18600
+ ];
18601
+ var SET_VIDEO_DOWNLOAD_STATUS_QUERY_DATA = (client, keyParams, response) => {
18602
+ client.setQueryData(VIDEO_DOWNLOAD_STATUS_QUERY_KEY(...keyParams), response);
18603
+ };
18604
+ var GetVideoDownloadStatus = async ({
18605
+ videoId,
18606
+ adminApiParams
18607
+ }) => {
18608
+ const adminApi = await GetAdminAPI(adminApiParams);
18609
+ const { data } = await adminApi.get(`/videos/${videoId}/downloads`);
18610
+ return data;
18611
+ };
18612
+ var useGetVideoDownloadStatus = (videoId = "", options = {}) => {
18613
+ return useConnectedSingleQuery(
18614
+ VIDEO_DOWNLOAD_STATUS_QUERY_KEY(videoId),
18615
+ (params) => GetVideoDownloadStatus({ videoId, ...params }),
18616
+ {
18617
+ ...options,
18618
+ enabled: !!videoId && (options?.enabled ?? true)
18619
+ },
18620
+ "storage"
18621
+ );
18622
+ };
18623
+
18595
18624
  // src/PermissionsWrapper.tsx
18596
18625
  var PermissionsWrapper = ({
18597
18626
  children,
@@ -35861,6 +35890,29 @@ var useGenerateVideoCaptions = (options = {}) => {
35861
35890
  });
35862
35891
  };
35863
35892
 
35893
+ // src/mutations/videos/useInitiateVideoDownload.ts
35894
+ var InitiateVideoDownload = async ({
35895
+ videoId,
35896
+ adminApiParams,
35897
+ queryClient
35898
+ }) => {
35899
+ const connectedXM = await GetAdminAPI(adminApiParams);
35900
+ const { data } = await connectedXM.post(`/videos/${videoId}/downloads`);
35901
+ if (queryClient && data.status === "ok") {
35902
+ queryClient.invalidateQueries({ queryKey: VIDEOS_QUERY_KEY() });
35903
+ if (data.data?.default?.url) {
35904
+ queryClient.invalidateQueries({ queryKey: VIDEOS_QUERY_KEY(videoId) });
35905
+ }
35906
+ }
35907
+ return data;
35908
+ };
35909
+ var useInitiateVideoDownload = (options = {}) => {
35910
+ return useConnectedMutation(InitiateVideoDownload, options, {
35911
+ domain: "storage",
35912
+ type: "update"
35913
+ });
35914
+ };
35915
+
35864
35916
  // src/mutations/videos/useUpdateVideo.ts
35865
35917
  var UpdateVideo = async ({
35866
35918
  videoId,
@@ -37036,6 +37088,7 @@ export {
37036
37088
  GetTiers,
37037
37089
  GetVideo,
37038
37090
  GetVideoCaptions,
37091
+ GetVideoDownloadStatus,
37039
37092
  GetVideos,
37040
37093
  GroupAccess,
37041
37094
  GroupInvitationStatus,
@@ -37067,6 +37120,7 @@ export {
37067
37120
  ImpersonateAccount,
37068
37121
  ImportItemStatus,
37069
37122
  ImportType,
37123
+ InitiateVideoDownload,
37070
37124
  IntegrationType,
37071
37125
  InvoiceStatus,
37072
37126
  LEVELS_QUERY_KEY,
@@ -37634,6 +37688,7 @@ export {
37634
37688
  SET_TIER_SUBSCRIBERS_QUERY_DATA,
37635
37689
  SET_VIDEOS_QUERY_DATA,
37636
37690
  SET_VIDEO_CAPTIONS_QUERY_DATA,
37691
+ SET_VIDEO_DOWNLOAD_STATUS_QUERY_DATA,
37637
37692
  SET_VIDEO_QUERY_DATA,
37638
37693
  STREAM_INPUTS_QUERY_KEY,
37639
37694
  STREAM_INPUT_OUTPUTS_QUERY_KEY,
@@ -37882,6 +37937,7 @@ export {
37882
37937
  UserRole,
37883
37938
  VIDEOS_QUERY_KEY,
37884
37939
  VIDEO_CAPTIONS_QUERY_KEY,
37940
+ VIDEO_DOWNLOAD_STATUS_QUERY_KEY,
37885
37941
  VIDEO_QUERY_KEY,
37886
37942
  VerifyOrganizationWebhook,
37887
37943
  VideoSource,
@@ -38674,8 +38730,10 @@ export {
38674
38730
  useGetTiers,
38675
38731
  useGetVideo,
38676
38732
  useGetVideoCaptions,
38733
+ useGetVideoDownloadStatus,
38677
38734
  useGetVideos,
38678
38735
  useImpersonateAccount,
38736
+ useInitiateVideoDownload,
38679
38737
  useRefundOrganizationPayment,
38680
38738
  useReinviteGroupInvitation,
38681
38739
  useRejectGroupRequest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "2.8.18",
3
+ "version": "2.8.20",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",