@connectedxm/client 4.3.0 → 5.0.0
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.d.ts +11 -13
- package/dist/index.js +6 -61
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2275,8 +2275,7 @@ interface ConnectedXMClientContextState {
|
|
|
2275
2275
|
queryClient: QueryClient;
|
|
2276
2276
|
organizationId: string;
|
|
2277
2277
|
apiUrl: "https://client-api.connected.dev" | "https://staging-client-api.connected.dev" | "http://localhost:4001";
|
|
2278
|
-
authenticated: boolean
|
|
2279
|
-
setAuthenticated: (authenticated: boolean) => void;
|
|
2278
|
+
authenticated: boolean;
|
|
2280
2279
|
getToken: () => Promise<string | undefined>;
|
|
2281
2280
|
getExecuteAs?: () => Promise<string | undefined> | string | undefined;
|
|
2282
2281
|
locale: string;
|
|
@@ -2285,10 +2284,10 @@ interface ConnectedXMClientContextState {
|
|
|
2285
2284
|
onNotFound?: (error: AxiosError<ConnectedXMResponse<any>>, key: QueryKey, shouldRedirect: boolean) => void;
|
|
2286
2285
|
onMutationError?: (error: AxiosError<ConnectedXMResponse<null>>, variables: Omit<MutationParams, "queryClient" | "clientApiParams">, context: unknown) => void;
|
|
2287
2286
|
}
|
|
2288
|
-
interface ConnectedXMProviderProps extends
|
|
2287
|
+
interface ConnectedXMProviderProps extends ConnectedXMClientContextState {
|
|
2289
2288
|
children: React.ReactNode;
|
|
2290
2289
|
}
|
|
2291
|
-
declare const ConnectedXMProvider: ({
|
|
2290
|
+
declare const ConnectedXMProvider: ({ children, ...state }: ConnectedXMProviderProps) => React.JSX.Element;
|
|
2292
2291
|
|
|
2293
2292
|
declare const useConnectedXM: () => ConnectedXMClientContextState;
|
|
2294
2293
|
|
|
@@ -2961,15 +2960,14 @@ interface GetEventActivationProps extends SingleQueryParams {
|
|
|
2961
2960
|
declare const GetEventActivation: ({ eventId, passId, activationId, clientApiParams, }: GetEventActivationProps) => Promise<ConnectedXMResponse<EventActivation>>;
|
|
2962
2961
|
declare const useGetEventActivation: (eventId: string | undefined, passId: string | undefined, activationId: string, options?: SingleQueryOptions<ReturnType<typeof GetEventActivation>>) => _tanstack_react_query.UseQueryResult<ConnectedXMResponse<EventActivation>, axios.AxiosError<ConnectedXMResponse<any>, any>>;
|
|
2963
2962
|
|
|
2964
|
-
declare const EVENT_ACTIVATIONS_QUERY_KEY: (eventId: string, passId: string
|
|
2963
|
+
declare const EVENT_ACTIVATIONS_QUERY_KEY: (eventId: string, passId: string) => QueryKey;
|
|
2965
2964
|
declare const SET_EVENT_ACTIVATIONS_QUERY_DATA: (client: QueryClient, keyParams: Parameters<typeof EVENT_ACTIVATIONS_QUERY_KEY>, response: Awaited<ReturnType<typeof GetEventActivations>>, baseKeys?: Parameters<typeof GetBaseInfiniteQueryKeys>) => void;
|
|
2966
2965
|
interface GetEventActivationsProps extends InfiniteQueryParams {
|
|
2967
2966
|
eventId: string;
|
|
2968
2967
|
passId: string;
|
|
2969
|
-
accessLevel?: keyof typeof TicketEventAccessLevel;
|
|
2970
2968
|
}
|
|
2971
|
-
declare const GetEventActivations: ({ eventId, passId,
|
|
2972
|
-
declare const useGetEventActivations: (eventId?: string, passId?: string,
|
|
2969
|
+
declare const GetEventActivations: ({ eventId, passId, pageParam, pageSize, orderBy, search, clientApiParams, }: GetEventActivationsProps) => Promise<ConnectedXMResponse<EventActivation[]>>;
|
|
2970
|
+
declare const useGetEventActivations: (eventId?: string, passId?: string, params?: Omit<InfiniteQueryParams, "pageParam" | "queryClient" | "clientApiParams">, options?: InfiniteQueryOptions<Awaited<ReturnType<typeof GetEventActivations>>>) => _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<ConnectedXMResponse<EventActivation[]>, number>, axios.AxiosError<ConnectedXMResponse<null>, any>>;
|
|
2973
2971
|
|
|
2974
2972
|
declare const EVENT_ACTIVATION_SUMMARY_QUERY_KEY: (eventId: string, passId: string) => QueryKey;
|
|
2975
2973
|
interface GetEventActivationSummaryProps extends SingleQueryParams {
|
|
@@ -4769,17 +4767,17 @@ interface CancelGroupRequestParams extends MutationParams {
|
|
|
4769
4767
|
declare const CancelGroupRequest: ({ groupId, clientApiParams, queryClient, }: CancelGroupRequestParams) => Promise<ConnectedXMResponse<null>>;
|
|
4770
4768
|
declare const useCancelGroupRequest: (options?: Omit<MutationOptions<Awaited<ReturnType<typeof CancelGroupRequest>>, Omit<CancelGroupRequestParams, "queryClient" | "clientApiParams">>, "mutationFn">) => _tanstack_react_query.UseMutationResult<ConnectedXMResponse<null>, axios.AxiosError<ConnectedXMResponse<null>, any>, Omit<CancelGroupRequestParams, "queryClient" | "clientApiParams">, unknown>;
|
|
4771
4769
|
|
|
4772
|
-
interface
|
|
4773
|
-
group: CreateGroup;
|
|
4774
|
-
imageDataUri?: string;
|
|
4775
|
-
}
|
|
4776
|
-
interface CreateGroup {
|
|
4770
|
+
interface CreateGroupData {
|
|
4777
4771
|
name: string;
|
|
4778
4772
|
description: string;
|
|
4779
4773
|
access: keyof typeof GroupAccess;
|
|
4780
4774
|
active: boolean;
|
|
4781
4775
|
externalUrl?: string;
|
|
4782
4776
|
}
|
|
4777
|
+
interface CreateGroupParams extends MutationParams {
|
|
4778
|
+
group: CreateGroupData;
|
|
4779
|
+
imageDataUri?: string;
|
|
4780
|
+
}
|
|
4783
4781
|
declare const CreateGroup: ({ group, imageDataUri, clientApiParams, queryClient, }: CreateGroupParams) => Promise<ConnectedXMResponse<Group>>;
|
|
4784
4782
|
declare const useCreateGroup: (options?: Omit<MutationOptions<Awaited<ReturnType<typeof CreateGroup>>, Omit<CreateGroupParams, "queryClient" | "clientApiParams">>, "mutationFn">) => _tanstack_react_query.UseMutationResult<ConnectedXMResponse<Group>, axios.AxiosError<ConnectedXMResponse<Group>, any>, Omit<CreateGroupParams, "queryClient" | "clientApiParams">, unknown>;
|
|
4785
4783
|
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,13 @@
|
|
|
1
1
|
// src/ConnectedXMProvider.tsx
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
QueryClientProvider
|
|
5
|
-
} from "@tanstack/react-query";
|
|
6
3
|
var ConnectedXMClientContext = React.createContext(
|
|
7
4
|
{}
|
|
8
5
|
);
|
|
9
6
|
var ConnectedXMProvider = ({
|
|
10
|
-
queryClient,
|
|
11
7
|
children,
|
|
12
|
-
getToken,
|
|
13
8
|
...state
|
|
14
9
|
}) => {
|
|
15
|
-
|
|
16
|
-
null
|
|
17
|
-
);
|
|
18
|
-
const [ssr, setSSR] = React.useState(true);
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
if (!authenticated) {
|
|
21
|
-
getToken().then((token) => {
|
|
22
|
-
if (token) {
|
|
23
|
-
setAuthenticated(true);
|
|
24
|
-
} else {
|
|
25
|
-
setAuthenticated(false);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}, [authenticated, getToken]);
|
|
30
|
-
React.useEffect(() => {
|
|
31
|
-
setSSR(false);
|
|
32
|
-
}, []);
|
|
33
|
-
if (ssr) {
|
|
34
|
-
return /* @__PURE__ */ React.createElement(QueryClientProvider, { client: queryClient }, /* @__PURE__ */ React.createElement(
|
|
35
|
-
ConnectedXMClientContext.Provider,
|
|
36
|
-
{
|
|
37
|
-
value: {
|
|
38
|
-
...state,
|
|
39
|
-
getToken,
|
|
40
|
-
authenticated,
|
|
41
|
-
setAuthenticated,
|
|
42
|
-
queryClient
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
children
|
|
46
|
-
));
|
|
47
|
-
}
|
|
48
|
-
return /* @__PURE__ */ React.createElement(
|
|
49
|
-
ConnectedXMClientContext.Provider,
|
|
50
|
-
{
|
|
51
|
-
value: {
|
|
52
|
-
...state,
|
|
53
|
-
getToken,
|
|
54
|
-
authenticated,
|
|
55
|
-
setAuthenticated,
|
|
56
|
-
queryClient
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
children
|
|
60
|
-
);
|
|
10
|
+
return /* @__PURE__ */ React.createElement(ConnectedXMClientContext.Provider, { value: state }, children);
|
|
61
11
|
};
|
|
62
12
|
|
|
63
13
|
// src/hooks/useConnectedXM.ts
|
|
@@ -2966,11 +2916,8 @@ var useGetFeaturedEvents = (params = {}, options = {}) => {
|
|
|
2966
2916
|
};
|
|
2967
2917
|
|
|
2968
2918
|
// src/queries/events/useGetEventActivations.ts
|
|
2969
|
-
var EVENT_ACTIVATIONS_QUERY_KEY = (eventId, passId
|
|
2919
|
+
var EVENT_ACTIVATIONS_QUERY_KEY = (eventId, passId) => {
|
|
2970
2920
|
const key = [...EVENT_QUERY_KEY(eventId), "ACTIVATIONS", passId];
|
|
2971
|
-
if (accessLevel) {
|
|
2972
|
-
key.push(accessLevel);
|
|
2973
|
-
}
|
|
2974
2921
|
return key;
|
|
2975
2922
|
};
|
|
2976
2923
|
var SET_EVENT_ACTIVATIONS_QUERY_DATA = (client, keyParams, response, baseKeys = ["en"]) => {
|
|
@@ -2985,7 +2932,6 @@ var SET_EVENT_ACTIVATIONS_QUERY_DATA = (client, keyParams, response, baseKeys =
|
|
|
2985
2932
|
var GetEventActivations = async ({
|
|
2986
2933
|
eventId,
|
|
2987
2934
|
passId,
|
|
2988
|
-
accessLevel,
|
|
2989
2935
|
pageParam,
|
|
2990
2936
|
pageSize,
|
|
2991
2937
|
orderBy,
|
|
@@ -3000,17 +2946,16 @@ var GetEventActivations = async ({
|
|
|
3000
2946
|
page: pageParam || void 0,
|
|
3001
2947
|
pageSize: pageSize || void 0,
|
|
3002
2948
|
orderBy: orderBy || void 0,
|
|
3003
|
-
search: search || void 0
|
|
3004
|
-
accessLevel: accessLevel || void 0
|
|
2949
|
+
search: search || void 0
|
|
3005
2950
|
}
|
|
3006
2951
|
}
|
|
3007
2952
|
);
|
|
3008
2953
|
return data;
|
|
3009
2954
|
};
|
|
3010
|
-
var useGetEventActivations = (eventId = "", passId = "",
|
|
2955
|
+
var useGetEventActivations = (eventId = "", passId = "", params = {}, options = {}) => {
|
|
3011
2956
|
return useConnectedInfiniteQuery(
|
|
3012
|
-
EVENT_ACTIVATIONS_QUERY_KEY(eventId, passId
|
|
3013
|
-
(params2) => GetEventActivations({ eventId, passId,
|
|
2957
|
+
EVENT_ACTIVATIONS_QUERY_KEY(eventId, passId),
|
|
2958
|
+
(params2) => GetEventActivations({ eventId, passId, ...params2 }),
|
|
3014
2959
|
params,
|
|
3015
2960
|
{
|
|
3016
2961
|
...options,
|