@leancodepl/react-query-cqrs-client 8.3.2 → 8.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/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/package.json +4 -4
- package/src/lib/mkCqrsClient.d.ts +2 -1
package/index.cjs.js
CHANGED
|
@@ -57,13 +57,13 @@ function uncapitalizedJSONParse(json) {
|
|
|
57
57
|
function uncapitalizedParse() {
|
|
58
58
|
return ($source)=>$source.pipe(operators.map(uncapitalizedJSONParse));
|
|
59
59
|
}
|
|
60
|
-
function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions }) {
|
|
60
|
+
function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions, tokenHeader = "Authorization" }) {
|
|
61
61
|
function mkFetcher(endpoint, config = {}) {
|
|
62
62
|
const apiCall = (data, token)=>{
|
|
63
63
|
var _ajaxOptions_withCredentials;
|
|
64
64
|
return ajax.ajax(_extends({}, ajaxOptions, config, {
|
|
65
65
|
headers: {
|
|
66
|
-
|
|
66
|
+
[tokenHeader]: token,
|
|
67
67
|
"Content-Type": "application/json"
|
|
68
68
|
},
|
|
69
69
|
url: `${cqrsEndpoint}/${endpoint}`,
|
package/index.esm.js
CHANGED
|
@@ -55,13 +55,13 @@ function uncapitalizedJSONParse(json) {
|
|
|
55
55
|
function uncapitalizedParse() {
|
|
56
56
|
return ($source)=>$source.pipe(map(uncapitalizedJSONParse));
|
|
57
57
|
}
|
|
58
|
-
function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions }) {
|
|
58
|
+
function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions, tokenHeader = "Authorization" }) {
|
|
59
59
|
function mkFetcher(endpoint, config = {}) {
|
|
60
60
|
const apiCall = (data, token)=>{
|
|
61
61
|
var _ajaxOptions_withCredentials;
|
|
62
62
|
return ajax(_extends({}, ajaxOptions, config, {
|
|
63
63
|
headers: {
|
|
64
|
-
|
|
64
|
+
[tokenHeader]: token,
|
|
65
65
|
"Content-Type": "application/json"
|
|
66
66
|
},
|
|
67
67
|
url: `${cqrsEndpoint}/${endpoint}`,
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/react-query-cqrs-client",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@leancodepl/cqrs-client-base": "8.3.
|
|
7
|
-
"@leancodepl/utils": "8.3.
|
|
8
|
-
"@leancodepl/validation": "8.3.
|
|
6
|
+
"@leancodepl/cqrs-client-base": "8.3.3",
|
|
7
|
+
"@leancodepl/utils": "8.3.3",
|
|
8
|
+
"@leancodepl/validation": "8.3.3",
|
|
9
9
|
"@tanstack/react-query": ">=5.0.0",
|
|
10
10
|
"rxjs": ">=7.0.0"
|
|
11
11
|
},
|
|
@@ -5,11 +5,12 @@ import { ApiResponse, CommandResult, TokenProvider } from "@leancodepl/cqrs-clie
|
|
|
5
5
|
import { ValidationErrorsHandler } from "@leancodepl/validation";
|
|
6
6
|
import { NullableUncapitalizeDeep } from "./types";
|
|
7
7
|
export declare function uncapitalizedParse<TResult>(): OperatorFunction<string, NullableUncapitalizeDeep<TResult>>;
|
|
8
|
-
export declare function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions, }: {
|
|
8
|
+
export declare function mkCqrsClient({ cqrsEndpoint, queryClient, tokenProvider, ajaxOptions, tokenHeader, }: {
|
|
9
9
|
cqrsEndpoint: string;
|
|
10
10
|
queryClient: QueryClient;
|
|
11
11
|
tokenProvider?: Partial<TokenProvider>;
|
|
12
12
|
ajaxOptions?: Omit<AjaxConfig, "body" | "headers" | "method" | "responseType" | "url">;
|
|
13
|
+
tokenHeader?: string;
|
|
13
14
|
}): {
|
|
14
15
|
createQuery<TQuery, TResult>(type: string): {
|
|
15
16
|
(data: TQuery, options?: Omit<UndefinedInitialDataOptions<NullableUncapitalizeDeep<TResult>, unknown>, "queryFn" | "queryKey">): import("@tanstack/react-query").UseQueryResult<NullableUncapitalizeDeep<TResult>, unknown>;
|