@connectedxm/admin 3.3.2 → 3.3.3

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) => {
@@ -30059,9 +30106,9 @@ var UpdateEventQuestion = async ({
30059
30106
  queryClient.invalidateQueries({
30060
30107
  queryKey: EVENT_QUESTIONS_QUERY_KEY(eventId)
30061
30108
  });
30062
- if (question.searchListId !== void 0) {
30109
+ if (typeof data.data.searchListId === "string") {
30063
30110
  queryClient.invalidateQueries({
30064
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
30111
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
30065
30112
  });
30066
30113
  queryClient.invalidateQueries({
30067
30114
  predicate: (query) => {
@@ -32191,9 +32238,9 @@ var UpdateEventSessionQuestion = async ({
32191
32238
  queryClient.invalidateQueries({
32192
32239
  queryKey: EVENT_SESSION_QUESTIONS_QUERY_KEY(eventId, sessionId)
32193
32240
  });
32194
- if (question.searchListId !== void 0) {
32241
+ if (typeof data.data.searchListId === "string") {
32195
32242
  queryClient.invalidateQueries({
32196
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
32243
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
32197
32244
  });
32198
32245
  queryClient.invalidateQueries({
32199
32246
  predicate: (query) => {
@@ -38744,9 +38791,9 @@ var UpdateSurveyQuestion = async ({
38744
38791
  queryClient.invalidateQueries({
38745
38792
  queryKey: SURVEY_QUESTIONS_QUERY_KEY(surveyId)
38746
38793
  });
38747
- if (question.searchListId !== void 0) {
38794
+ if (typeof data.data.searchListId === "string") {
38748
38795
  queryClient.invalidateQueries({
38749
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
38796
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
38750
38797
  });
38751
38798
  queryClient.invalidateQueries({
38752
38799
  predicate: (query) => {
@@ -41360,6 +41407,7 @@ var useUploadVideoCaptions = (options = {}) => {
41360
41407
  GetReport,
41361
41408
  GetReports,
41362
41409
  GetSearchList,
41410
+ GetSearchListConnectedQuestions,
41363
41411
  GetSearchListValue,
41364
41412
  GetSearchListValues,
41365
41413
  GetSearchLists,
@@ -41604,6 +41652,7 @@ var useUploadVideoCaptions = (options = {}) => {
41604
41652
  ReportType,
41605
41653
  ResendRegistrationConfirmationEmail,
41606
41654
  SEARCHLISTS_QUERY_KEY,
41655
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY,
41607
41656
  SEARCHLIST_QUERY_KEY,
41608
41657
  SEARCHLIST_VALUES_QUERY_KEY,
41609
41658
  SEARCHLIST_VALUE_QUERY_KEY,
@@ -41983,6 +42032,7 @@ var useUploadVideoCaptions = (options = {}) => {
41983
42032
  SET_REPORTS_QUERY_DATA,
41984
42033
  SET_REPORT_QUERY_DATA,
41985
42034
  SET_SEARCHLISTS_QUERY_DATA,
42035
+ SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA,
41986
42036
  SET_SEARCHLIST_QUERY_DATA,
41987
42037
  SET_SEARCHLIST_VALUES_QUERY_DATA,
41988
42038
  SET_SEARCHLIST_VALUE_QUERY_DATA,
@@ -43050,6 +43100,7 @@ var useUploadVideoCaptions = (options = {}) => {
43050
43100
  useGetReport,
43051
43101
  useGetReports,
43052
43102
  useGetSearchList,
43103
+ useGetSearchListConnectedQuestions,
43053
43104
  useGetSearchListValue,
43054
43105
  useGetSearchListValues,
43055
43106
  useGetSearchLists,