@connectedxm/admin 2.8.13 → 2.8.15

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
@@ -483,6 +483,8 @@ __export(index_exports, {
483
483
  DeleteTier: () => DeleteTier,
484
484
  DeleteUserImage: () => DeleteUserImage,
485
485
  DeleteVideo: () => DeleteVideo,
486
+ DeleteVideoCaption: () => DeleteVideoCaption,
487
+ DownloadVideoCaption: () => DownloadVideoCaption,
486
488
  EMAIL_RECEIPTS_QUERY_KEY: () => EMAIL_RECEIPTS_QUERY_KEY,
487
489
  EMAIL_RECEIPT_QUERY_KEY: () => EMAIL_RECEIPT_QUERY_KEY,
488
490
  EVENTS_QUERY_KEY: () => EVENTS_QUERY_KEY,
@@ -703,6 +705,7 @@ __export(index_exports, {
703
705
  GROUP_THREADS_QUERY_KEY: () => GROUP_THREADS_QUERY_KEY,
704
706
  GROUP_TRANSLATIONS_QUERY_KEY: () => GROUP_TRANSLATIONS_QUERY_KEY,
705
707
  GROUP_TRANSLATION_QUERY_KEY: () => GROUP_TRANSLATION_QUERY_KEY,
708
+ GenerateVideoCaptions: () => GenerateVideoCaptions,
706
709
  GetAPILog: () => GetAPILog,
707
710
  GetAPILogs: () => GetAPILogs,
708
711
  GetAcccountEmailReceipts: () => GetAcccountEmailReceipts,
@@ -1145,6 +1148,7 @@ __export(index_exports, {
1145
1148
  GetTierSubscribers: () => GetTierSubscribers,
1146
1149
  GetTiers: () => GetTiers,
1147
1150
  GetVideo: () => GetVideo,
1151
+ GetVideoCaptions: () => GetVideoCaptions,
1148
1152
  GetVideos: () => GetVideos,
1149
1153
  GroupAccess: () => GroupAccess,
1150
1154
  GroupInvitationStatus: () => GroupInvitationStatus,
@@ -1742,6 +1746,7 @@ __export(index_exports, {
1742
1746
  SET_TIER_QUERY_DATA: () => SET_TIER_QUERY_DATA,
1743
1747
  SET_TIER_SUBSCRIBERS_QUERY_DATA: () => SET_TIER_SUBSCRIBERS_QUERY_DATA,
1744
1748
  SET_VIDEOS_QUERY_DATA: () => SET_VIDEOS_QUERY_DATA,
1749
+ SET_VIDEO_CAPTIONS_QUERY_DATA: () => SET_VIDEO_CAPTIONS_QUERY_DATA,
1745
1750
  SET_VIDEO_QUERY_DATA: () => SET_VIDEO_QUERY_DATA,
1746
1751
  STREAM_INPUTS_QUERY_KEY: () => STREAM_INPUTS_QUERY_KEY,
1747
1752
  STREAM_INPUT_OUTPUTS_QUERY_KEY: () => STREAM_INPUT_OUTPUTS_QUERY_KEY,
@@ -1986,8 +1991,10 @@ __export(index_exports, {
1986
1991
  UpdateUserImage: () => UpdateUserImage,
1987
1992
  UpdateVideo: () => UpdateVideo,
1988
1993
  UploadFile: () => UploadFile,
1994
+ UploadVideoCaptions: () => UploadVideoCaptions,
1989
1995
  UserRole: () => UserRole,
1990
1996
  VIDEOS_QUERY_KEY: () => VIDEOS_QUERY_KEY,
1997
+ VIDEO_CAPTIONS_QUERY_KEY: () => VIDEO_CAPTIONS_QUERY_KEY,
1991
1998
  VIDEO_QUERY_KEY: () => VIDEO_QUERY_KEY,
1992
1999
  VerifyOrganizationWebhook: () => VerifyOrganizationWebhook,
1993
2000
  VideoSource: () => VideoSource,
@@ -2336,8 +2343,11 @@ __export(index_exports, {
2336
2343
  useDeleteTier: () => useDeleteTier,
2337
2344
  useDeleteUserImage: () => useDeleteUserImage,
2338
2345
  useDeleteVideo: () => useDeleteVideo,
2346
+ useDeleteVideoCaption: () => useDeleteVideoCaption,
2347
+ useDownloadVideoCaption: () => useDownloadVideoCaption,
2339
2348
  useEventGetPassTypeCoupons: () => useEventGetPassTypeCoupons,
2340
2349
  useExportAccount: () => useExportAccount,
2350
+ useGenerateVideoCaptions: () => useGenerateVideoCaptions,
2341
2351
  useGetAPILog: () => useGetAPILog,
2342
2352
  useGetAPILogs: () => useGetAPILogs,
2343
2353
  useGetAcccountEmailReceipts: () => useGetAcccountEmailReceipts,
@@ -2776,6 +2786,7 @@ __export(index_exports, {
2776
2786
  useGetTierSubscribers: () => useGetTierSubscribers,
2777
2787
  useGetTiers: () => useGetTiers,
2778
2788
  useGetVideo: () => useGetVideo,
2789
+ useGetVideoCaptions: () => useGetVideoCaptions,
2779
2790
  useGetVideos: () => useGetVideos,
2780
2791
  useImpersonateAccount: () => useImpersonateAccount,
2781
2792
  useRefundOrganizationPayment: () => useRefundOrganizationPayment,
@@ -3014,6 +3025,7 @@ __export(index_exports, {
3014
3025
  useUpdateUserImage: () => useUpdateUserImage,
3015
3026
  useUpdateVideo: () => useUpdateVideo,
3016
3027
  useUploadFile: () => useUploadFile,
3028
+ useUploadVideoCaptions: () => useUploadVideoCaptions,
3017
3029
  useVerifyOrganizationWebhook: () => useVerifyOrganizationWebhook
3018
3030
  });
3019
3031
  module.exports = __toCommonJS(index_exports);
@@ -4329,11 +4341,14 @@ var useGetAccountTiers = (accountId = "", type, params = {}, options = {}) => {
4329
4341
  };
4330
4342
 
4331
4343
  // src/queries/activities/useGetActivities.ts
4332
- var ACTIVITIES_QUERY_KEY = (moderation) => {
4344
+ var ACTIVITIES_QUERY_KEY = (moderation, featured) => {
4333
4345
  const key = ["ACTIVITIES"];
4334
4346
  if (moderation) {
4335
4347
  key.push(moderation);
4336
4348
  }
4349
+ if (featured) {
4350
+ key.push("FEATURED");
4351
+ }
4337
4352
  return key;
4338
4353
  };
4339
4354
  var SET_ACTIVITIES_QUERY_DATA = (client, keyParams, response) => {
@@ -4341,6 +4356,7 @@ var SET_ACTIVITIES_QUERY_DATA = (client, keyParams, response) => {
4341
4356
  };
4342
4357
  var GetActivities = async ({
4343
4358
  moderation,
4359
+ featured,
4344
4360
  pageParam,
4345
4361
  pageSize,
4346
4362
  orderBy,
@@ -4354,15 +4370,16 @@ var GetActivities = async ({
4354
4370
  pageSize: pageSize || void 0,
4355
4371
  orderBy: orderBy || void 0,
4356
4372
  search: search || void 0,
4357
- moderation: moderation || void 0
4373
+ moderation: moderation || void 0,
4374
+ featured: featured || void 0
4358
4375
  }
4359
4376
  });
4360
4377
  return data;
4361
4378
  };
4362
- var useGetActivities = (moderation, params = {}, options = {}) => {
4379
+ var useGetActivities = (moderation, featured, params = {}, options = {}) => {
4363
4380
  return useConnectedInfiniteQuery(
4364
- ACTIVITIES_QUERY_KEY(moderation),
4365
- (params2) => GetActivities({ ...params2, moderation }),
4381
+ ACTIVITIES_QUERY_KEY(moderation, featured),
4382
+ (params2) => GetActivities({ ...params2, moderation, featured }),
4366
4383
  params,
4367
4384
  options,
4368
4385
  "activities"
@@ -21545,6 +21562,46 @@ var useGetVideo = (videoId = "", options = {}) => {
21545
21562
  );
21546
21563
  };
21547
21564
 
21565
+ // src/queries/videos/useGetVideoCaptions.ts
21566
+ var VIDEO_CAPTIONS_QUERY_KEY = (videoId) => [
21567
+ ...VIDEO_QUERY_KEY(videoId),
21568
+ "CAPTIONS"
21569
+ ];
21570
+ var SET_VIDEO_CAPTIONS_QUERY_DATA = (client, keyParams, response) => {
21571
+ client.setQueryData(VIDEO_CAPTIONS_QUERY_KEY(...keyParams), response);
21572
+ };
21573
+ var GetVideoCaptions = async ({
21574
+ videoId,
21575
+ pageParam,
21576
+ pageSize,
21577
+ orderBy,
21578
+ search,
21579
+ adminApiParams
21580
+ }) => {
21581
+ const adminApi = await GetAdminAPI(adminApiParams);
21582
+ const { data } = await adminApi.get(`/videos/${videoId}/captions`, {
21583
+ params: {
21584
+ page: pageParam || void 0,
21585
+ pageSize: pageSize || void 0,
21586
+ orderBy: orderBy || void 0,
21587
+ search: search || void 0
21588
+ }
21589
+ });
21590
+ return data;
21591
+ };
21592
+ var useGetVideoCaptions = (videoId = "", params = {}, options = {}) => {
21593
+ return useConnectedInfiniteQuery(
21594
+ VIDEO_CAPTIONS_QUERY_KEY(videoId),
21595
+ (params2) => GetVideoCaptions({ videoId, ...params2 }),
21596
+ params,
21597
+ {
21598
+ ...options,
21599
+ enabled: !!videoId && (options?.enabled ?? true)
21600
+ },
21601
+ "storage"
21602
+ );
21603
+ };
21604
+
21548
21605
  // src/PermissionsWrapper.tsx
21549
21606
  var PermissionsWrapper = ({
21550
21607
  children,
@@ -38728,6 +38785,89 @@ var useDeleteVideo = (options = {}) => {
38728
38785
  });
38729
38786
  };
38730
38787
 
38788
+ // src/mutations/videos/useDeleteVideoCaption.ts
38789
+ var DeleteVideoCaption = async ({
38790
+ videoId,
38791
+ language,
38792
+ adminApiParams,
38793
+ queryClient
38794
+ }) => {
38795
+ const connectedXM = await GetAdminAPI(adminApiParams);
38796
+ const { data } = await connectedXM.delete(
38797
+ `/videos/${videoId}/captions/${language}`
38798
+ );
38799
+ if (queryClient && data.status === "ok") {
38800
+ queryClient.invalidateQueries({
38801
+ queryKey: VIDEO_CAPTIONS_QUERY_KEY(videoId)
38802
+ });
38803
+ }
38804
+ return data;
38805
+ };
38806
+ var useDeleteVideoCaption = (options = {}) => {
38807
+ return useConnectedMutation(DeleteVideoCaption, options, {
38808
+ domain: "storage",
38809
+ type: "del"
38810
+ });
38811
+ };
38812
+
38813
+ // src/mutations/videos/useDownloadVideoCaption.ts
38814
+ var import_react_query5 = require("@tanstack/react-query");
38815
+ var DownloadVideoCaption = async ({
38816
+ videoId,
38817
+ language,
38818
+ adminApiParams
38819
+ }) => {
38820
+ const adminApi = await GetAdminAPI(adminApiParams);
38821
+ const { data } = await adminApi.get(
38822
+ `/videos/${videoId}/captions/${language}/download`,
38823
+ {
38824
+ responseType: "text"
38825
+ }
38826
+ );
38827
+ return data;
38828
+ };
38829
+ var useDownloadVideoCaption = (options = {}) => {
38830
+ const { apiUrl, getToken, organizationId, getExecuteAs } = useConnectedXM();
38831
+ return (0, import_react_query5.useMutation)({
38832
+ mutationFn: (params) => DownloadVideoCaption({
38833
+ ...params,
38834
+ adminApiParams: {
38835
+ apiUrl,
38836
+ getToken,
38837
+ organizationId,
38838
+ getExecuteAs
38839
+ }
38840
+ }),
38841
+ ...options
38842
+ });
38843
+ };
38844
+
38845
+ // src/mutations/videos/useGenerateVideoCaptions.ts
38846
+ var GenerateVideoCaptions = async ({
38847
+ videoId,
38848
+ language,
38849
+ adminApiParams,
38850
+ queryClient
38851
+ }) => {
38852
+ const connectedXM = await GetAdminAPI(adminApiParams);
38853
+ const { data } = await connectedXM.post(
38854
+ `/videos/${videoId}/captions/${language}/generate`,
38855
+ {}
38856
+ );
38857
+ if (queryClient && data.status === "ok") {
38858
+ queryClient.invalidateQueries({
38859
+ queryKey: VIDEO_CAPTIONS_QUERY_KEY(videoId)
38860
+ });
38861
+ }
38862
+ return data;
38863
+ };
38864
+ var useGenerateVideoCaptions = (options = {}) => {
38865
+ return useConnectedMutation(GenerateVideoCaptions, options, {
38866
+ domain: "storage",
38867
+ type: "create"
38868
+ });
38869
+ };
38870
+
38731
38871
  // src/mutations/videos/useUpdateVideo.ts
38732
38872
  var UpdateVideo = async ({
38733
38873
  videoId,
@@ -38752,6 +38892,37 @@ var useUpdateVideo = (options = {}) => {
38752
38892
  type: "update"
38753
38893
  });
38754
38894
  };
38895
+
38896
+ // src/mutations/videos/useUploadVideoCaptions.ts
38897
+ var UploadVideoCaptions = async ({
38898
+ videoId,
38899
+ language,
38900
+ file,
38901
+ filename,
38902
+ adminApiParams,
38903
+ queryClient
38904
+ }) => {
38905
+ const connectedXM = await GetAdminAPI(adminApiParams);
38906
+ const { data } = await connectedXM.put(
38907
+ `/videos/${videoId}/captions/${language}`,
38908
+ {
38909
+ file,
38910
+ filename
38911
+ }
38912
+ );
38913
+ if (queryClient && data.status === "ok") {
38914
+ queryClient.invalidateQueries({
38915
+ queryKey: VIDEO_CAPTIONS_QUERY_KEY(videoId)
38916
+ });
38917
+ }
38918
+ return data;
38919
+ };
38920
+ var useUploadVideoCaptions = (options = {}) => {
38921
+ return useConnectedMutation(UploadVideoCaptions, options, {
38922
+ domain: "storage",
38923
+ type: "update"
38924
+ });
38925
+ };
38755
38926
  // Annotate the CommonJS export names for ESM import in node:
38756
38927
  0 && (module.exports = {
38757
38928
  ACCOUNTS_QUERY_KEY,
@@ -39207,6 +39378,8 @@ var useUpdateVideo = (options = {}) => {
39207
39378
  DeleteTier,
39208
39379
  DeleteUserImage,
39209
39380
  DeleteVideo,
39381
+ DeleteVideoCaption,
39382
+ DownloadVideoCaption,
39210
39383
  EMAIL_RECEIPTS_QUERY_KEY,
39211
39384
  EMAIL_RECEIPT_QUERY_KEY,
39212
39385
  EVENTS_QUERY_KEY,
@@ -39427,6 +39600,7 @@ var useUpdateVideo = (options = {}) => {
39427
39600
  GROUP_THREADS_QUERY_KEY,
39428
39601
  GROUP_TRANSLATIONS_QUERY_KEY,
39429
39602
  GROUP_TRANSLATION_QUERY_KEY,
39603
+ GenerateVideoCaptions,
39430
39604
  GetAPILog,
39431
39605
  GetAPILogs,
39432
39606
  GetAcccountEmailReceipts,
@@ -39869,6 +40043,7 @@ var useUpdateVideo = (options = {}) => {
39869
40043
  GetTierSubscribers,
39870
40044
  GetTiers,
39871
40045
  GetVideo,
40046
+ GetVideoCaptions,
39872
40047
  GetVideos,
39873
40048
  GroupAccess,
39874
40049
  GroupInvitationStatus,
@@ -40466,6 +40641,7 @@ var useUpdateVideo = (options = {}) => {
40466
40641
  SET_TIER_QUERY_DATA,
40467
40642
  SET_TIER_SUBSCRIBERS_QUERY_DATA,
40468
40643
  SET_VIDEOS_QUERY_DATA,
40644
+ SET_VIDEO_CAPTIONS_QUERY_DATA,
40469
40645
  SET_VIDEO_QUERY_DATA,
40470
40646
  STREAM_INPUTS_QUERY_KEY,
40471
40647
  STREAM_INPUT_OUTPUTS_QUERY_KEY,
@@ -40710,8 +40886,10 @@ var useUpdateVideo = (options = {}) => {
40710
40886
  UpdateUserImage,
40711
40887
  UpdateVideo,
40712
40888
  UploadFile,
40889
+ UploadVideoCaptions,
40713
40890
  UserRole,
40714
40891
  VIDEOS_QUERY_KEY,
40892
+ VIDEO_CAPTIONS_QUERY_KEY,
40715
40893
  VIDEO_QUERY_KEY,
40716
40894
  VerifyOrganizationWebhook,
40717
40895
  VideoSource,
@@ -41060,8 +41238,11 @@ var useUpdateVideo = (options = {}) => {
41060
41238
  useDeleteTier,
41061
41239
  useDeleteUserImage,
41062
41240
  useDeleteVideo,
41241
+ useDeleteVideoCaption,
41242
+ useDownloadVideoCaption,
41063
41243
  useEventGetPassTypeCoupons,
41064
41244
  useExportAccount,
41245
+ useGenerateVideoCaptions,
41065
41246
  useGetAPILog,
41066
41247
  useGetAPILogs,
41067
41248
  useGetAcccountEmailReceipts,
@@ -41500,6 +41681,7 @@ var useUpdateVideo = (options = {}) => {
41500
41681
  useGetTierSubscribers,
41501
41682
  useGetTiers,
41502
41683
  useGetVideo,
41684
+ useGetVideoCaptions,
41503
41685
  useGetVideos,
41504
41686
  useImpersonateAccount,
41505
41687
  useRefundOrganizationPayment,
@@ -41738,5 +41920,6 @@ var useUpdateVideo = (options = {}) => {
41738
41920
  useUpdateUserImage,
41739
41921
  useUpdateVideo,
41740
41922
  useUploadFile,
41923
+ useUploadVideoCaptions,
41741
41924
  useVerifyOrganizationWebhook
41742
41925
  });