@connectedxm/admin 0.0.40 → 0.0.42

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.mjs CHANGED
@@ -8852,8 +8852,13 @@ var useGetImageUsage = (imageId = "", options = {}) => {
8852
8852
  };
8853
8853
 
8854
8854
  // src/queries/imports/useGetImports.ts
8855
- var IMPORTS_QUERY_KEY = () => ["IMPORTS"];
8855
+ var IMPORTS_QUERY_KEY = (tierId) => {
8856
+ const keys = ["IMPORTS"];
8857
+ if (tierId) keys.push(tierId);
8858
+ return keys;
8859
+ };
8856
8860
  var GetImports = async ({
8861
+ tierId,
8857
8862
  pageParam,
8858
8863
  pageSize,
8859
8864
  orderBy,
@@ -8863,6 +8868,7 @@ var GetImports = async ({
8863
8868
  const adminApi = await GetAdminAPI(adminApiParams);
8864
8869
  const { data } = await adminApi.get(`/imports`, {
8865
8870
  params: {
8871
+ tierId: tierId || void 0,
8866
8872
  page: pageParam || void 0,
8867
8873
  pageSize: pageSize || void 0,
8868
8874
  orderBy: orderBy || void 0,
@@ -8871,16 +8877,44 @@ var GetImports = async ({
8871
8877
  });
8872
8878
  return data;
8873
8879
  };
8874
- var useGetImports = (params = {}, options = {}) => {
8880
+ var useGetImports = (tierId = "", params = {}, options = {}) => {
8875
8881
  return useConnectedInfiniteQuery(
8876
- IMPORTS_QUERY_KEY(),
8877
- (params2) => GetImports({ ...params2 }),
8882
+ IMPORTS_QUERY_KEY(tierId),
8883
+ (params2) => GetImports({ tierId, ...params2 }),
8878
8884
  params,
8879
8885
  options,
8880
8886
  "org"
8881
8887
  );
8882
8888
  };
8883
8889
 
8890
+ // src/queries/imports/useGetImport.ts
8891
+ var IMPORT_QUERY_KEY = (importId) => [
8892
+ ...IMPORTS_QUERY_KEY(),
8893
+ importId
8894
+ ];
8895
+ var SET_IMPORT_QUERY_DATA = (client, keyParams, response) => {
8896
+ client.setQueryData(IMPORT_QUERY_KEY(...keyParams), response);
8897
+ };
8898
+ var GetImport = async ({
8899
+ importId,
8900
+ adminApiParams
8901
+ }) => {
8902
+ const adminApi = await GetAdminAPI(adminApiParams);
8903
+ const { data } = await adminApi.get(`/imports/${importId}`);
8904
+ return data;
8905
+ };
8906
+ var useGetImport = (importId = "", options = {}) => {
8907
+ return useConnectedSingleQuery(
8908
+ IMPORT_QUERY_KEY(importId),
8909
+ (params) => GetImport({ importId, ...params }),
8910
+ {
8911
+ ...options,
8912
+ enabled: !!importId
8913
+ },
8914
+ "org"
8915
+ );
8916
+ };
8917
+
8884
8918
  // src/queries/imports/useGetImportItems.ts
8885
8919
  var IMPORT_ITEMS_QUERY_KEY = (importId) => [
8886
8920
  ...IMPORTS_QUERY_KEY(),
@@ -11691,6 +11725,110 @@ var useGetTierAccounts = (tierId = "", params = {}, options = {}) => {
11691
11725
  );
11692
11726
  };
11693
11727
 
11728
+ // src/queries/tiers/useGetTierImports.ts
11729
+ var TIER_IMPORTS_QUERY_KEY = (tierId) => {
11730
+ const keys = [...TIER_QUERY_KEY(tierId), "IMPORTS"];
11731
+ return keys;
11732
+ };
11733
+ var GetTierImports = async ({
11734
+ tierId,
11735
+ pageParam,
11736
+ pageSize,
11737
+ orderBy,
11738
+ search,
11739
+ adminApiParams
11740
+ }) => {
11741
+ const adminApi = await GetAdminAPI(adminApiParams);
11742
+ const { data } = await adminApi.get(`/tiers/${tierId}/imports`, {
11743
+ params: {
11744
+ page: pageParam || void 0,
11745
+ pageSize: pageSize || void 0,
11746
+ orderBy: orderBy || void 0,
11747
+ search: search || void 0
11748
+ }
11749
+ });
11750
+ return data;
11751
+ };
11752
+ var useGetTierImports = (tierId = "", params = {}, options = {}) => {
11753
+ return useConnectedInfiniteQuery(
11754
+ TIER_IMPORTS_QUERY_KEY(tierId),
11755
+ (params2) => GetTierImports({ tierId, ...params2 }),
11756
+ params,
11757
+ {
11758
+ ...options,
11759
+ enabled: !!tierId && (options.enabled ?? true)
11760
+ },
11761
+ "accounts"
11762
+ );
11763
+ };
11764
+
11765
+ // src/queries/tiers/useGetTierImport.ts
11766
+ var TIER_IMPORT_QUERY_KEY = (tierId, importId) => [
11767
+ ...TIER_IMPORTS_QUERY_KEY(tierId),
11768
+ importId
11769
+ ];
11770
+ var SET_TIER_IMPORT_QUERY_DATA = (client, keyParams, response) => {
11771
+ client.setQueryData(TIER_IMPORT_QUERY_KEY(...keyParams), response);
11772
+ };
11773
+ var GetTierImport = async ({
11774
+ tierId,
11775
+ importId,
11776
+ adminApiParams
11777
+ }) => {
11778
+ const adminApi = await GetAdminAPI(adminApiParams);
11779
+ const { data } = await adminApi.get(`/tiers/${tierId}/imports/${importId}`);
11780
+ return data;
11781
+ };
11782
+ var useGetTierImport = (tierId = "", importId = "", options = {}) => {
11783
+ return useConnectedSingleQuery(
11784
+ TIER_IMPORT_QUERY_KEY(tierId, importId),
11785
+ (params) => GetTierImport({ tierId, importId, ...params }),
11786
+ {
11787
+ ...options,
11788
+ enabled: !!tierId && !!importId && (options.enabled ?? true)
11789
+ },
11790
+ "org"
11791
+ );
11792
+ };
11793
+
11794
+ // src/queries/tiers/useGetTierImportItems.ts
11795
+ var TIER_IMPORT_ITEMS_QUERY_KEY = (tierId, importId) => [...TIER_IMPORT_QUERY_KEY(tierId, importId), "ITEMS"];
11796
+ var GetTierImportItems = async ({
11797
+ tierId,
11798
+ importId,
11799
+ pageParam,
11800
+ pageSize,
11801
+ orderBy,
11802
+ search,
11803
+ adminApiParams
11804
+ }) => {
11805
+ const adminApi = await GetAdminAPI(adminApiParams);
11806
+ const { data } = await adminApi.get(
11807
+ `/tiers/${tierId}/imports/${importId}/items`,
11808
+ {
11809
+ params: {
11810
+ page: pageParam || void 0,
11811
+ pageSize: pageSize || void 0,
11812
+ orderBy: orderBy || void 0,
11813
+ search: search || void 0
11814
+ }
11815
+ }
11816
+ );
11817
+ return data;
11818
+ };
11819
+ var useGetTierImportItems = (tierId = "", importId = "", params = {}, options = {}) => {
11820
+ return useConnectedInfiniteQuery(
11821
+ TIER_IMPORT_ITEMS_QUERY_KEY(tierId, importId),
11822
+ (params2) => GetTierImportItems({ ...params2, tierId, importId }),
11823
+ params,
11824
+ {
11825
+ ...options,
11826
+ enabled: !!importId && !!tierId && (options.enabled ?? true)
11827
+ },
11828
+ "accounts"
11829
+ );
11830
+ };
11831
+
11694
11832
  // src/queries/tiers/useGetTierSubscribers.ts
11695
11833
  var TIER_SUBSCRIBERS_QUERY_KEY = (tierId) => [
11696
11834
  ...TIER_QUERY_KEY(tierId),
@@ -21483,6 +21621,33 @@ var useDeleteSubscriptionProduct = (options = {}) => {
21483
21621
  });
21484
21622
  };
21485
21623
 
21624
+ // src/mutations/subscription/useDeleteSubscriptionProductPrice.ts
21625
+ var DeleteSubscriptionProductPrice = async ({
21626
+ subscriptionProductId,
21627
+ adminApiParams,
21628
+ queryClient
21629
+ }) => {
21630
+ const connectedXM = await GetAdminAPI(adminApiParams);
21631
+ const { data } = await connectedXM.delete(
21632
+ `/subscription-products/${subscriptionProductId}`
21633
+ );
21634
+ if (queryClient && data.status === "ok") {
21635
+ queryClient.invalidateQueries({
21636
+ queryKey: SUBSCRIPTION_PRODUCTS_QUERY_KEY()
21637
+ });
21638
+ queryClient.removeQueries({
21639
+ queryKey: SUBSCRIPTION_PRODUCT_QUERY_KEY(subscriptionProductId)
21640
+ });
21641
+ }
21642
+ return data;
21643
+ };
21644
+ var useDeleteSubscriptionProductPrice = (options = {}) => {
21645
+ return useConnectedMutation(DeleteSubscriptionProductPrice, options, {
21646
+ domain: "subscriptions",
21647
+ type: "del"
21648
+ });
21649
+ };
21650
+
21486
21651
  // src/mutations/subscription/useRemoveSubscriptionProductTier.ts
21487
21652
  var RemoveSubscriptionProductTier = async ({
21488
21653
  subscriptionProductId,
@@ -21993,6 +22158,31 @@ var useRemoveTierAccount = (options = {}) => {
21993
22158
  });
21994
22159
  };
21995
22160
 
22161
+ // src/mutations/tier/useRemoveTierAccounts.ts
22162
+ var RemoveTierAccounts = async ({
22163
+ tierId,
22164
+ adminApiParams,
22165
+ queryClient
22166
+ }) => {
22167
+ const connectedXM = await GetAdminAPI(adminApiParams);
22168
+ const { data } = await connectedXM.delete(
22169
+ `/tiers/${tierId}/accounts`
22170
+ );
22171
+ if (queryClient && data.status === "ok") {
22172
+ SET_TIER_QUERY_DATA(queryClient, [tierId], data);
22173
+ queryClient.invalidateQueries({
22174
+ queryKey: TIER_ACCOUNTS_QUERY_KEY(tierId)
22175
+ });
22176
+ }
22177
+ return data;
22178
+ };
22179
+ var useRemoveTierAccounts = (options = {}) => {
22180
+ return useConnectedMutation(RemoveTierAccounts, options, {
22181
+ domain: "accounts",
22182
+ type: "update"
22183
+ });
22184
+ };
22185
+
21996
22186
  // src/mutations/tier/useUpdateTier.ts
21997
22187
  var UpdateTier = async ({
21998
22188
  tierId,
@@ -22368,6 +22558,7 @@ export {
22368
22558
  DeleteStreamInput,
22369
22559
  DeleteStreamInputOutput,
22370
22560
  DeleteSubscriptionProduct,
22561
+ DeleteSubscriptionProductPrice,
22371
22562
  DeleteSupportTicket,
22372
22563
  DeleteSupportTicketNote,
22373
22564
  DeleteThread,
@@ -22714,6 +22905,7 @@ export {
22714
22905
  GetImageUsage,
22715
22906
  GetImageVariant,
22716
22907
  GetImages,
22908
+ GetImport,
22717
22909
  GetImportItems,
22718
22910
  GetImports,
22719
22911
  GetInterest,
@@ -22798,6 +22990,9 @@ export {
22798
22990
  GetThreads,
22799
22991
  GetTier,
22800
22992
  GetTierAccounts,
22993
+ GetTierImport,
22994
+ GetTierImportItems,
22995
+ GetTierImports,
22801
22996
  GetTierSubscribers,
22802
22997
  GetTiers,
22803
22998
  GetUnapprovedEvents,
@@ -22812,6 +23007,7 @@ export {
22812
23007
  IMAGE_USAGE_QUERY_KEY,
22813
23008
  IMPORTS_QUERY_KEY,
22814
23009
  IMPORT_ITEMS_QUERY_KEY,
23010
+ IMPORT_QUERY_KEY,
22815
23011
  INTERESTS_QUERY_KEY,
22816
23012
  INTEREST_ACCOUNTS_QUERY_KEY,
22817
23013
  INTEREST_ACTIVITIES_QUERY_KEY,
@@ -22916,6 +23112,7 @@ export {
22916
23112
  RemoveThreadMember,
22917
23113
  RemoveThreadModerator,
22918
23114
  RemoveTierAccount,
23115
+ RemoveTierAccounts,
22919
23116
  ReorderEventFaqSectionQuestions,
22920
23117
  ReorderEventQuestionChoices,
22921
23118
  ReorderEventSectionQuestions,
@@ -23126,6 +23323,7 @@ export {
23126
23323
  SET_IMAGES_QUERY_DATA,
23127
23324
  SET_IMAGE_QUERY_DATA,
23128
23325
  SET_IMAGE_USAGE_QUERY_DATA,
23326
+ SET_IMPORT_QUERY_DATA,
23129
23327
  SET_INTERESTS_QUERY_DATA,
23130
23328
  SET_INTEREST_ACCOUNTS_QUERY_DATA,
23131
23329
  SET_INTEREST_ACTIVITIES_QUERY_DATA,
@@ -23197,6 +23395,7 @@ export {
23197
23395
  SET_THREAD_QUERY_DATA,
23198
23396
  SET_TIERS_QUERY_DATA,
23199
23397
  SET_TIER_ACCOUNTS_QUERY_DATA,
23398
+ SET_TIER_IMPORT_QUERY_DATA,
23200
23399
  SET_TIER_QUERY_DATA,
23201
23400
  SET_TIER_SUBSCRIBERS_QUERY_DATA,
23202
23401
  SET_UNAPPROVED_EVENTS_QUERY_DATA,
@@ -23236,6 +23435,9 @@ export {
23236
23435
  THREAD_QUERY_KEY,
23237
23436
  TIERS_QUERY_KEY,
23238
23437
  TIER_ACCOUNTS_QUERY_KEY,
23438
+ TIER_IMPORTS_QUERY_KEY,
23439
+ TIER_IMPORT_ITEMS_QUERY_KEY,
23440
+ TIER_IMPORT_QUERY_KEY,
23239
23441
  TIER_QUERY_KEY,
23240
23442
  TIER_SUBSCRIBERS_QUERY_KEY,
23241
23443
  ThreadAccessLevel,
@@ -23545,6 +23747,7 @@ export {
23545
23747
  useDeleteStreamInput,
23546
23748
  useDeleteStreamInputOutput,
23547
23749
  useDeleteSubscriptionProduct,
23750
+ useDeleteSubscriptionProductPrice,
23548
23751
  useDeleteSupportTicket,
23549
23752
  useDeleteSupportTicketNote,
23550
23753
  useDeleteThread,
@@ -23744,6 +23947,7 @@ export {
23744
23947
  useGetImage,
23745
23948
  useGetImageUsage,
23746
23949
  useGetImages,
23950
+ useGetImport,
23747
23951
  useGetImportItems,
23748
23952
  useGetImports,
23749
23953
  useGetInterest,
@@ -23828,6 +24032,9 @@ export {
23828
24032
  useGetThreads,
23829
24033
  useGetTier,
23830
24034
  useGetTierAccounts,
24035
+ useGetTierImport,
24036
+ useGetTierImportItems,
24037
+ useGetTierImports,
23831
24038
  useGetTierSubscribers,
23832
24039
  useGetTiers,
23833
24040
  useGetUnapprovedEvents,
@@ -23881,6 +24088,7 @@ export {
23881
24088
  useRemoveThreadMember,
23882
24089
  useRemoveThreadModerator,
23883
24090
  useRemoveTierAccount,
24091
+ useRemoveTierAccounts,
23884
24092
  useReorderEventFaqSectionQuestions,
23885
24093
  useReorderEventQuestionChoices,
23886
24094
  useReorderEventSectionQuestions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "repository": {