@connectedxm/admin 3.3.2 → 3.3.4

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
@@ -1102,6 +1102,7 @@ __export(index_exports, {
1102
1102
  GetReport: () => GetReport,
1103
1103
  GetReports: () => GetReports,
1104
1104
  GetSearchList: () => GetSearchList,
1105
+ GetSearchListConnectedQuestions: () => GetSearchListConnectedQuestions,
1105
1106
  GetSearchListValue: () => GetSearchListValue,
1106
1107
  GetSearchListValues: () => GetSearchListValues,
1107
1108
  GetSearchLists: () => GetSearchLists,
@@ -1346,6 +1347,7 @@ __export(index_exports, {
1346
1347
  ReportType: () => ReportType,
1347
1348
  ResendRegistrationConfirmationEmail: () => ResendRegistrationConfirmationEmail,
1348
1349
  SEARCHLISTS_QUERY_KEY: () => SEARCHLISTS_QUERY_KEY,
1350
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY: () => SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY,
1349
1351
  SEARCHLIST_QUERY_KEY: () => SEARCHLIST_QUERY_KEY,
1350
1352
  SEARCHLIST_VALUES_QUERY_KEY: () => SEARCHLIST_VALUES_QUERY_KEY,
1351
1353
  SEARCHLIST_VALUE_QUERY_KEY: () => SEARCHLIST_VALUE_QUERY_KEY,
@@ -1725,6 +1727,7 @@ __export(index_exports, {
1725
1727
  SET_REPORTS_QUERY_DATA: () => SET_REPORTS_QUERY_DATA,
1726
1728
  SET_REPORT_QUERY_DATA: () => SET_REPORT_QUERY_DATA,
1727
1729
  SET_SEARCHLISTS_QUERY_DATA: () => SET_SEARCHLISTS_QUERY_DATA,
1730
+ SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA: () => SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA,
1728
1731
  SET_SEARCHLIST_QUERY_DATA: () => SET_SEARCHLIST_QUERY_DATA,
1729
1732
  SET_SEARCHLIST_VALUES_QUERY_DATA: () => SET_SEARCHLIST_VALUES_QUERY_DATA,
1730
1733
  SET_SEARCHLIST_VALUE_QUERY_DATA: () => SET_SEARCHLIST_VALUE_QUERY_DATA,
@@ -2792,6 +2795,7 @@ __export(index_exports, {
2792
2795
  useGetReport: () => useGetReport,
2793
2796
  useGetReports: () => useGetReports,
2794
2797
  useGetSearchList: () => useGetSearchList,
2798
+ useGetSearchListConnectedQuestions: () => useGetSearchListConnectedQuestions,
2795
2799
  useGetSearchListValue: () => useGetSearchListValue,
2796
2800
  useGetSearchListValues: () => useGetSearchListValues,
2797
2801
  useGetSearchLists: () => useGetSearchLists,
@@ -19661,6 +19665,114 @@ var useGetSearchListValue = (searchListId = "", valueId = "", options = {}) => {
19661
19665
  );
19662
19666
  };
19663
19667
 
19668
+ // src/queries/useConnectedCursorQuery.ts
19669
+ var import_react_query3 = require("@tanstack/react-query");
19670
+ var useConnectedCursorQuery = (queryKeys, queryFn, params = {}, options = {
19671
+ shouldRedirect: false
19672
+ }, domain) => {
19673
+ if (typeof params.pageSize === "undefined") params.pageSize = 25;
19674
+ const {
19675
+ onModuleForbidden,
19676
+ onNotAuthorized,
19677
+ onNotFound,
19678
+ apiUrl,
19679
+ getToken,
19680
+ organizationId,
19681
+ getExecuteAs,
19682
+ queryClient
19683
+ } = useConnectedXM();
19684
+ const { allowed } = usePermission_default(domain, domain ? "read" : void 0);
19685
+ const getNextPageParam = (lastPage) => {
19686
+ if (lastPage.cursor) {
19687
+ return lastPage.cursor;
19688
+ }
19689
+ return null;
19690
+ };
19691
+ return (0, import_react_query3.useInfiniteQuery)({
19692
+ staleTime: 60 * 1e3,
19693
+ // 60 Seconds
19694
+ retry: (failureCount, error) => {
19695
+ if (error.response?.status === 404) {
19696
+ if (onNotFound) onNotFound(error, queryKeys, options.shouldRedirect || false);
19697
+ return false;
19698
+ }
19699
+ if (error.response?.status === 403 || error.response?.status === 460 || error.response?.status === 461) {
19700
+ if (onModuleForbidden) onModuleForbidden(error, queryKeys, options.shouldRedirect || false);
19701
+ return false;
19702
+ }
19703
+ if (error.response?.status === 401) {
19704
+ if (onNotAuthorized) onNotAuthorized(error, queryKeys, options.shouldRedirect || false);
19705
+ return false;
19706
+ }
19707
+ if (failureCount < 3) return true;
19708
+ return false;
19709
+ },
19710
+ ...options,
19711
+ queryKey: [
19712
+ ...queryKeys,
19713
+ ...GetBaseInfiniteQueryKeys(params?.search)
19714
+ ],
19715
+ queryFn: ({ pageParam }) => queryFn({
19716
+ ...params,
19717
+ pageSize: params.pageSize || 25,
19718
+ cursor: pageParam,
19719
+ queryClient,
19720
+ adminApiParams: {
19721
+ apiUrl,
19722
+ getToken,
19723
+ organizationId,
19724
+ getExecuteAs
19725
+ }
19726
+ }),
19727
+ initialPageParam: null,
19728
+ getNextPageParam,
19729
+ enabled: (!domain || allowed) && options.enabled
19730
+ });
19731
+ };
19732
+
19733
+ // src/queries/searchlists/useGetSearchListConnectedQuestions.ts
19734
+ var SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY = (searchListId, params = {}) => [...SEARCHLIST_QUERY_KEY(searchListId), "CONNECTED_QUESTIONS", params];
19735
+ var SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA = (client, keyParams, response) => {
19736
+ client.setQueryData(
19737
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY(...keyParams),
19738
+ response
19739
+ );
19740
+ };
19741
+ var GetSearchListConnectedQuestions = async ({
19742
+ searchListId,
19743
+ cursor,
19744
+ pageSize,
19745
+ orderBy,
19746
+ search,
19747
+ adminApiParams
19748
+ }) => {
19749
+ const adminApi = await GetAdminAPI(adminApiParams);
19750
+ const { data } = await adminApi.get(
19751
+ `/searchlists/${searchListId}/questions`,
19752
+ {
19753
+ params: {
19754
+ cursor,
19755
+ pageSize,
19756
+ orderBy,
19757
+ search
19758
+ }
19759
+ }
19760
+ );
19761
+ return data;
19762
+ };
19763
+ var useGetSearchListConnectedQuestions = (searchListId = "", params = {}, options = {}) => {
19764
+ return useConnectedCursorQuery(
19765
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY(searchListId, params),
19766
+ (queryParams) => GetSearchListConnectedQuestions({ searchListId, ...queryParams }),
19767
+ params,
19768
+ {
19769
+ ...options,
19770
+ enabled: !!searchListId && (options?.enabled ?? true)
19771
+ },
19772
+ "events"
19773
+ );
19774
+ };
19775
+
19664
19776
  // src/queries/self/useGetSelf.ts
19665
19777
  var SELF_QUERY_KEY = () => ["SELF"];
19666
19778
  var SET_SELF_QUERY_DATA = (client, keyParams, response) => {
@@ -21483,71 +21595,6 @@ var useGetThreadMembers = (threadId = "", params = {}, options = {}) => {
21483
21595
  );
21484
21596
  };
21485
21597
 
21486
- // src/queries/useConnectedCursorQuery.ts
21487
- var import_react_query3 = require("@tanstack/react-query");
21488
- var useConnectedCursorQuery = (queryKeys, queryFn, params = {}, options = {
21489
- shouldRedirect: false
21490
- }, domain) => {
21491
- if (typeof params.pageSize === "undefined") params.pageSize = 25;
21492
- const {
21493
- onModuleForbidden,
21494
- onNotAuthorized,
21495
- onNotFound,
21496
- apiUrl,
21497
- getToken,
21498
- organizationId,
21499
- getExecuteAs,
21500
- queryClient
21501
- } = useConnectedXM();
21502
- const { allowed } = usePermission_default(domain, domain ? "read" : void 0);
21503
- const getNextPageParam = (lastPage) => {
21504
- if (lastPage.cursor) {
21505
- return lastPage.cursor;
21506
- }
21507
- return null;
21508
- };
21509
- return (0, import_react_query3.useInfiniteQuery)({
21510
- staleTime: 60 * 1e3,
21511
- // 60 Seconds
21512
- retry: (failureCount, error) => {
21513
- if (error.response?.status === 404) {
21514
- if (onNotFound) onNotFound(error, queryKeys, options.shouldRedirect || false);
21515
- return false;
21516
- }
21517
- if (error.response?.status === 403 || error.response?.status === 460 || error.response?.status === 461) {
21518
- if (onModuleForbidden) onModuleForbidden(error, queryKeys, options.shouldRedirect || false);
21519
- return false;
21520
- }
21521
- if (error.response?.status === 401) {
21522
- if (onNotAuthorized) onNotAuthorized(error, queryKeys, options.shouldRedirect || false);
21523
- return false;
21524
- }
21525
- if (failureCount < 3) return true;
21526
- return false;
21527
- },
21528
- ...options,
21529
- queryKey: [
21530
- ...queryKeys,
21531
- ...GetBaseInfiniteQueryKeys(params?.search)
21532
- ],
21533
- queryFn: ({ pageParam }) => queryFn({
21534
- ...params,
21535
- pageSize: params.pageSize || 25,
21536
- cursor: pageParam,
21537
- queryClient,
21538
- adminApiParams: {
21539
- apiUrl,
21540
- getToken,
21541
- organizationId,
21542
- getExecuteAs
21543
- }
21544
- }),
21545
- initialPageParam: null,
21546
- getNextPageParam,
21547
- enabled: (!domain || allowed) && options.enabled
21548
- });
21549
- };
21550
-
21551
21598
  // src/utilities/AppendInfiniteQuery.ts
21552
21599
  var import_immer = require("immer");
21553
21600
  var AppendInfiniteQuery = (queryClient, key, newData) => {
@@ -21661,8 +21708,6 @@ var TransformPrice = (value, currency) => {
21661
21708
  maximumFractionDigits: 2
21662
21709
  });
21663
21710
  if (value === 0) return "--.--";
21664
- if (value < 0)
21665
- return formatter.format(-value / 100).replace(currency, `-${currency}`);
21666
21711
  return formatter.format(value / 100);
21667
21712
  };
21668
21713
 
@@ -30059,9 +30104,9 @@ var UpdateEventQuestion = async ({
30059
30104
  queryClient.invalidateQueries({
30060
30105
  queryKey: EVENT_QUESTIONS_QUERY_KEY(eventId)
30061
30106
  });
30062
- if (question.searchListId !== void 0) {
30107
+ if (typeof data.data.searchListId === "string") {
30063
30108
  queryClient.invalidateQueries({
30064
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
30109
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
30065
30110
  });
30066
30111
  queryClient.invalidateQueries({
30067
30112
  predicate: (query) => {
@@ -32191,9 +32236,9 @@ var UpdateEventSessionQuestion = async ({
32191
32236
  queryClient.invalidateQueries({
32192
32237
  queryKey: EVENT_SESSION_QUESTIONS_QUERY_KEY(eventId, sessionId)
32193
32238
  });
32194
- if (question.searchListId !== void 0) {
32239
+ if (typeof data.data.searchListId === "string") {
32195
32240
  queryClient.invalidateQueries({
32196
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
32241
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
32197
32242
  });
32198
32243
  queryClient.invalidateQueries({
32199
32244
  predicate: (query) => {
@@ -38744,9 +38789,9 @@ var UpdateSurveyQuestion = async ({
38744
38789
  queryClient.invalidateQueries({
38745
38790
  queryKey: SURVEY_QUESTIONS_QUERY_KEY(surveyId)
38746
38791
  });
38747
- if (question.searchListId !== void 0) {
38792
+ if (typeof data.data.searchListId === "string") {
38748
38793
  queryClient.invalidateQueries({
38749
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
38794
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
38750
38795
  });
38751
38796
  queryClient.invalidateQueries({
38752
38797
  predicate: (query) => {
@@ -41360,6 +41405,7 @@ var useUploadVideoCaptions = (options = {}) => {
41360
41405
  GetReport,
41361
41406
  GetReports,
41362
41407
  GetSearchList,
41408
+ GetSearchListConnectedQuestions,
41363
41409
  GetSearchListValue,
41364
41410
  GetSearchListValues,
41365
41411
  GetSearchLists,
@@ -41604,6 +41650,7 @@ var useUploadVideoCaptions = (options = {}) => {
41604
41650
  ReportType,
41605
41651
  ResendRegistrationConfirmationEmail,
41606
41652
  SEARCHLISTS_QUERY_KEY,
41653
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY,
41607
41654
  SEARCHLIST_QUERY_KEY,
41608
41655
  SEARCHLIST_VALUES_QUERY_KEY,
41609
41656
  SEARCHLIST_VALUE_QUERY_KEY,
@@ -41983,6 +42030,7 @@ var useUploadVideoCaptions = (options = {}) => {
41983
42030
  SET_REPORTS_QUERY_DATA,
41984
42031
  SET_REPORT_QUERY_DATA,
41985
42032
  SET_SEARCHLISTS_QUERY_DATA,
42033
+ SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA,
41986
42034
  SET_SEARCHLIST_QUERY_DATA,
41987
42035
  SET_SEARCHLIST_VALUES_QUERY_DATA,
41988
42036
  SET_SEARCHLIST_VALUE_QUERY_DATA,
@@ -43050,6 +43098,7 @@ var useUploadVideoCaptions = (options = {}) => {
43050
43098
  useGetReport,
43051
43099
  useGetReports,
43052
43100
  useGetSearchList,
43101
+ useGetSearchListConnectedQuestions,
43053
43102
  useGetSearchListValue,
43054
43103
  useGetSearchListValues,
43055
43104
  useGetSearchLists,