@leancodepl/react-query-cqrs-client 7.2.2 → 7.2.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/index.cjs.js CHANGED
@@ -64,7 +64,10 @@ function uncapitalizedParse() {
64
64
  function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions }) {
65
65
  function mkFetcher(endpoint, config = {}) {
66
66
  var _tokenProvider;
67
- const apiCall = (data, token)=>ajax.ajax(_extends({}, ajaxOptions, config, {
67
+ var _ajaxOptions_withCredentials;
68
+ const apiCall = (data, token)=>{
69
+ var _ajaxOptions;
70
+ return ajax.ajax(_extends({}, ajaxOptions, config, {
68
71
  headers: {
69
72
  Authorization: token,
70
73
  "Content-Type": "application/json"
@@ -72,8 +75,9 @@ function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions })
72
75
  url: `${cqrsEndpoint}/${endpoint}`,
73
76
  method: "POST",
74
77
  body: data,
75
- withCredentials: true
78
+ withCredentials: (_ajaxOptions_withCredentials = (_ajaxOptions = ajaxOptions) == null ? void 0 : _ajaxOptions.withCredentials) != null ? _ajaxOptions_withCredentials : true
76
79
  }));
80
+ };
77
81
  const getToken = (_tokenProvider = tokenProvider) == null ? void 0 : _tokenProvider.getToken;
78
82
  const mk$apiCall = (data, token)=>apiCall(data, token).pipe(authGuard(tokenProvider), operators.map((result)=>result.response));
79
83
  if (getToken) {
package/index.esm.js CHANGED
@@ -60,7 +60,10 @@ function uncapitalizedParse() {
60
60
  function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions }) {
61
61
  function mkFetcher(endpoint, config = {}) {
62
62
  var _tokenProvider;
63
- const apiCall = (data, token)=>ajax(_extends({}, ajaxOptions, config, {
63
+ var _ajaxOptions_withCredentials;
64
+ const apiCall = (data, token)=>{
65
+ var _ajaxOptions;
66
+ return ajax(_extends({}, ajaxOptions, config, {
64
67
  headers: {
65
68
  Authorization: token,
66
69
  "Content-Type": "application/json"
@@ -68,8 +71,9 @@ function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions })
68
71
  url: `${cqrsEndpoint}/${endpoint}`,
69
72
  method: "POST",
70
73
  body: data,
71
- withCredentials: true
74
+ withCredentials: (_ajaxOptions_withCredentials = (_ajaxOptions = ajaxOptions) == null ? void 0 : _ajaxOptions.withCredentials) != null ? _ajaxOptions_withCredentials : true
72
75
  }));
76
+ };
73
77
  const getToken = (_tokenProvider = tokenProvider) == null ? void 0 : _tokenProvider.getToken;
74
78
  const mk$apiCall = (data, token)=>apiCall(data, token).pipe(authGuard(tokenProvider), map((result)=>result.response));
75
79
  if (getToken) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@leancodepl/react-query-cqrs-client",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
- "@leancodepl/utils": "7.2.2",
7
- "@leancodepl/validation": "7.2.2",
6
+ "@leancodepl/utils": "7.2.3",
7
+ "@leancodepl/validation": "7.2.3",
8
8
  "@tanstack/react-query": ">=5.0.0",
9
9
  "rxjs": ">=7.0.0"
10
10
  },
@@ -9,7 +9,7 @@ export declare function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider,
9
9
  cqrsEndpoint: string;
10
10
  queryClient: QueryClient;
11
11
  tokenProvider?: Partial<TokenProvider>;
12
- ajaxOptions?: Omit<AjaxConfig, "headers" | "url" | "method" | "responseType" | "body" | "withCredentials">;
12
+ ajaxOptions?: Omit<AjaxConfig, "headers" | "url" | "method" | "responseType" | "body">;
13
13
  }): {
14
14
  createQuery<TQuery, TResult>(type: string): {
15
15
  (data: TQuery, options?: Omit<UndefinedInitialDataOptions<NullableUncapitalizeDeep<TResult>, unknown>, "queryKey" | "queryFn"> | undefined): import("@tanstack/react-query/build/legacy/types").UseQueryResult<NullableUncapitalizeDeep<TResult>, unknown>;