@connectedxm/admin 3.3.1 → 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.js CHANGED
@@ -16541,6 +16541,116 @@ var useGetSearchListValue = (searchListId = "", valueId = "", options = {}) => {
16541
16541
  );
16542
16542
  };
16543
16543
 
16544
+ // src/queries/useConnectedCursorQuery.ts
16545
+ import {
16546
+ useInfiniteQuery as useInfiniteQuery2
16547
+ } from "@tanstack/react-query";
16548
+ var useConnectedCursorQuery = (queryKeys, queryFn, params = {}, options = {
16549
+ shouldRedirect: false
16550
+ }, domain) => {
16551
+ if (typeof params.pageSize === "undefined") params.pageSize = 25;
16552
+ const {
16553
+ onModuleForbidden,
16554
+ onNotAuthorized,
16555
+ onNotFound,
16556
+ apiUrl,
16557
+ getToken,
16558
+ organizationId,
16559
+ getExecuteAs,
16560
+ queryClient
16561
+ } = useConnectedXM();
16562
+ const { allowed } = usePermission_default(domain, domain ? "read" : void 0);
16563
+ const getNextPageParam = (lastPage) => {
16564
+ if (lastPage.cursor) {
16565
+ return lastPage.cursor;
16566
+ }
16567
+ return null;
16568
+ };
16569
+ return useInfiniteQuery2({
16570
+ staleTime: 60 * 1e3,
16571
+ // 60 Seconds
16572
+ retry: (failureCount, error) => {
16573
+ if (error.response?.status === 404) {
16574
+ if (onNotFound) onNotFound(error, queryKeys, options.shouldRedirect || false);
16575
+ return false;
16576
+ }
16577
+ if (error.response?.status === 403 || error.response?.status === 460 || error.response?.status === 461) {
16578
+ if (onModuleForbidden) onModuleForbidden(error, queryKeys, options.shouldRedirect || false);
16579
+ return false;
16580
+ }
16581
+ if (error.response?.status === 401) {
16582
+ if (onNotAuthorized) onNotAuthorized(error, queryKeys, options.shouldRedirect || false);
16583
+ return false;
16584
+ }
16585
+ if (failureCount < 3) return true;
16586
+ return false;
16587
+ },
16588
+ ...options,
16589
+ queryKey: [
16590
+ ...queryKeys,
16591
+ ...GetBaseInfiniteQueryKeys(params?.search)
16592
+ ],
16593
+ queryFn: ({ pageParam }) => queryFn({
16594
+ ...params,
16595
+ pageSize: params.pageSize || 25,
16596
+ cursor: pageParam,
16597
+ queryClient,
16598
+ adminApiParams: {
16599
+ apiUrl,
16600
+ getToken,
16601
+ organizationId,
16602
+ getExecuteAs
16603
+ }
16604
+ }),
16605
+ initialPageParam: null,
16606
+ getNextPageParam,
16607
+ enabled: (!domain || allowed) && options.enabled
16608
+ });
16609
+ };
16610
+
16611
+ // src/queries/searchlists/useGetSearchListConnectedQuestions.ts
16612
+ var SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY = (searchListId, params = {}) => [...SEARCHLIST_QUERY_KEY(searchListId), "CONNECTED_QUESTIONS", params];
16613
+ var SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA = (client, keyParams, response) => {
16614
+ client.setQueryData(
16615
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY(...keyParams),
16616
+ response
16617
+ );
16618
+ };
16619
+ var GetSearchListConnectedQuestions = async ({
16620
+ searchListId,
16621
+ cursor,
16622
+ pageSize,
16623
+ orderBy,
16624
+ search,
16625
+ adminApiParams
16626
+ }) => {
16627
+ const adminApi = await GetAdminAPI(adminApiParams);
16628
+ const { data } = await adminApi.get(
16629
+ `/searchlists/${searchListId}/questions`,
16630
+ {
16631
+ params: {
16632
+ cursor,
16633
+ pageSize,
16634
+ orderBy,
16635
+ search
16636
+ }
16637
+ }
16638
+ );
16639
+ return data;
16640
+ };
16641
+ var useGetSearchListConnectedQuestions = (searchListId = "", params = {}, options = {}) => {
16642
+ return useConnectedCursorQuery(
16643
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY(searchListId, params),
16644
+ (queryParams) => GetSearchListConnectedQuestions({ searchListId, ...queryParams }),
16645
+ params,
16646
+ {
16647
+ ...options,
16648
+ enabled: !!searchListId && (options?.enabled ?? true)
16649
+ },
16650
+ "events"
16651
+ );
16652
+ };
16653
+
16544
16654
  // src/queries/self/useGetSelf.ts
16545
16655
  var SELF_QUERY_KEY = () => ["SELF"];
16546
16656
  var SET_SELF_QUERY_DATA = (client, keyParams, response) => {
@@ -18363,73 +18473,6 @@ var useGetThreadMembers = (threadId = "", params = {}, options = {}) => {
18363
18473
  );
18364
18474
  };
18365
18475
 
18366
- // src/queries/useConnectedCursorQuery.ts
18367
- import {
18368
- useInfiniteQuery as useInfiniteQuery2
18369
- } from "@tanstack/react-query";
18370
- var useConnectedCursorQuery = (queryKeys, queryFn, params = {}, options = {
18371
- shouldRedirect: false
18372
- }, domain) => {
18373
- if (typeof params.pageSize === "undefined") params.pageSize = 25;
18374
- const {
18375
- onModuleForbidden,
18376
- onNotAuthorized,
18377
- onNotFound,
18378
- apiUrl,
18379
- getToken,
18380
- organizationId,
18381
- getExecuteAs,
18382
- queryClient
18383
- } = useConnectedXM();
18384
- const { allowed } = usePermission_default(domain, domain ? "read" : void 0);
18385
- const getNextPageParam = (lastPage) => {
18386
- if (lastPage.cursor) {
18387
- return lastPage.cursor;
18388
- }
18389
- return null;
18390
- };
18391
- return useInfiniteQuery2({
18392
- staleTime: 60 * 1e3,
18393
- // 60 Seconds
18394
- retry: (failureCount, error) => {
18395
- if (error.response?.status === 404) {
18396
- if (onNotFound) onNotFound(error, queryKeys, options.shouldRedirect || false);
18397
- return false;
18398
- }
18399
- if (error.response?.status === 403 || error.response?.status === 460 || error.response?.status === 461) {
18400
- if (onModuleForbidden) onModuleForbidden(error, queryKeys, options.shouldRedirect || false);
18401
- return false;
18402
- }
18403
- if (error.response?.status === 401) {
18404
- if (onNotAuthorized) onNotAuthorized(error, queryKeys, options.shouldRedirect || false);
18405
- return false;
18406
- }
18407
- if (failureCount < 3) return true;
18408
- return false;
18409
- },
18410
- ...options,
18411
- queryKey: [
18412
- ...queryKeys,
18413
- ...GetBaseInfiniteQueryKeys(params?.search)
18414
- ],
18415
- queryFn: ({ pageParam }) => queryFn({
18416
- ...params,
18417
- pageSize: params.pageSize || 25,
18418
- cursor: pageParam,
18419
- queryClient,
18420
- adminApiParams: {
18421
- apiUrl,
18422
- getToken,
18423
- organizationId,
18424
- getExecuteAs
18425
- }
18426
- }),
18427
- initialPageParam: null,
18428
- getNextPageParam,
18429
- enabled: (!domain || allowed) && options.enabled
18430
- });
18431
- };
18432
-
18433
18476
  // src/utilities/AppendInfiniteQuery.ts
18434
18477
  import { produce } from "immer";
18435
18478
  var AppendInfiniteQuery = (queryClient, key, newData) => {
@@ -26944,9 +26987,9 @@ var UpdateEventQuestion = async ({
26944
26987
  queryClient.invalidateQueries({
26945
26988
  queryKey: EVENT_QUESTIONS_QUERY_KEY(eventId)
26946
26989
  });
26947
- if (question.searchListId !== void 0) {
26990
+ if (typeof data.data.searchListId === "string") {
26948
26991
  queryClient.invalidateQueries({
26949
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
26992
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
26950
26993
  });
26951
26994
  queryClient.invalidateQueries({
26952
26995
  predicate: (query) => {
@@ -29076,9 +29119,9 @@ var UpdateEventSessionQuestion = async ({
29076
29119
  queryClient.invalidateQueries({
29077
29120
  queryKey: EVENT_SESSION_QUESTIONS_QUERY_KEY(eventId, sessionId)
29078
29121
  });
29079
- if (question.searchListId !== void 0) {
29122
+ if (typeof data.data.searchListId === "string") {
29080
29123
  queryClient.invalidateQueries({
29081
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
29124
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
29082
29125
  });
29083
29126
  queryClient.invalidateQueries({
29084
29127
  predicate: (query) => {
@@ -35629,9 +35672,9 @@ var UpdateSurveyQuestion = async ({
35629
35672
  queryClient.invalidateQueries({
35630
35673
  queryKey: SURVEY_QUESTIONS_QUERY_KEY(surveyId)
35631
35674
  });
35632
- if (question.searchListId !== void 0) {
35675
+ if (typeof data.data.searchListId === "string") {
35633
35676
  queryClient.invalidateQueries({
35634
- queryKey: SEARCHLIST_QUERY_KEY(question.searchListId)
35677
+ queryKey: SEARCHLIST_QUERY_KEY(data.data.searchListId)
35635
35678
  });
35636
35679
  queryClient.invalidateQueries({
35637
35680
  predicate: (query) => {
@@ -38244,6 +38287,7 @@ export {
38244
38287
  GetReport,
38245
38288
  GetReports,
38246
38289
  GetSearchList,
38290
+ GetSearchListConnectedQuestions,
38247
38291
  GetSearchListValue,
38248
38292
  GetSearchListValues,
38249
38293
  GetSearchLists,
@@ -38488,6 +38532,7 @@ export {
38488
38532
  ReportType,
38489
38533
  ResendRegistrationConfirmationEmail,
38490
38534
  SEARCHLISTS_QUERY_KEY,
38535
+ SEARCHLIST_CONNECTED_QUESTIONS_QUERY_KEY,
38491
38536
  SEARCHLIST_QUERY_KEY,
38492
38537
  SEARCHLIST_VALUES_QUERY_KEY,
38493
38538
  SEARCHLIST_VALUE_QUERY_KEY,
@@ -38867,6 +38912,7 @@ export {
38867
38912
  SET_REPORTS_QUERY_DATA,
38868
38913
  SET_REPORT_QUERY_DATA,
38869
38914
  SET_SEARCHLISTS_QUERY_DATA,
38915
+ SET_SEARCHLIST_CONNECTED_QUESTIONS_QUERY_DATA,
38870
38916
  SET_SEARCHLIST_QUERY_DATA,
38871
38917
  SET_SEARCHLIST_VALUES_QUERY_DATA,
38872
38918
  SET_SEARCHLIST_VALUE_QUERY_DATA,
@@ -39934,6 +39980,7 @@ export {
39934
39980
  useGetReport,
39935
39981
  useGetReports,
39936
39982
  useGetSearchList,
39983
+ useGetSearchListConnectedQuestions,
39937
39984
  useGetSearchListValue,
39938
39985
  useGetSearchListValues,
39939
39986
  useGetSearchLists,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/admin",
3
- "version": "3.3.1",
3
+ "version": "3.3.3",
4
4
  "description": "Admin API javascript SDK",
5
5
  "author": "ConnectedXM Inc.",
6
6
  "type": "module",