@leancodepl/rx-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 +3 -3
- package/src/lib/mkCqrsClient.d.ts +2 -1
package/index.cjs.js
CHANGED
|
@@ -26,13 +26,13 @@ function authGuard(tokenProvider) {
|
|
|
26
26
|
}))));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function mkCqrsClient({ cqrsEndpoint, tokenProvider, ajaxOptions }) {
|
|
29
|
+
function mkCqrsClient({ cqrsEndpoint, tokenProvider, ajaxOptions, tokenHeader = "Authorization" }) {
|
|
30
30
|
return {
|
|
31
31
|
createQuery (type) {
|
|
32
32
|
const queryCall = (dto, token)=>ajax.ajax({
|
|
33
33
|
...ajaxOptions,
|
|
34
34
|
headers: {
|
|
35
|
-
|
|
35
|
+
[tokenHeader]: token,
|
|
36
36
|
"Content-Type": "application/json"
|
|
37
37
|
},
|
|
38
38
|
url: `${cqrsEndpoint}/query/${type}`,
|
package/index.esm.js
CHANGED
|
@@ -24,13 +24,13 @@ function authGuard(tokenProvider) {
|
|
|
24
24
|
}))));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
function mkCqrsClient({ cqrsEndpoint, tokenProvider, ajaxOptions }) {
|
|
27
|
+
function mkCqrsClient({ cqrsEndpoint, tokenProvider, ajaxOptions, tokenHeader = "Authorization" }) {
|
|
28
28
|
return {
|
|
29
29
|
createQuery (type) {
|
|
30
30
|
const queryCall = (dto, token)=>ajax({
|
|
31
31
|
...ajaxOptions,
|
|
32
32
|
headers: {
|
|
33
|
-
|
|
33
|
+
[tokenHeader]: token,
|
|
34
34
|
"Content-Type": "application/json"
|
|
35
35
|
},
|
|
36
36
|
url: `${cqrsEndpoint}/query/${type}`,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/rx-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/validation": "8.3.
|
|
6
|
+
"@leancodepl/cqrs-client-base": "8.3.3",
|
|
7
|
+
"@leancodepl/validation": "8.3.3",
|
|
8
8
|
"rxjs": ">=7.0.0"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AjaxConfig } from "rxjs/ajax";
|
|
2
2
|
import { CommandResult, TokenProvider } from "@leancodepl/cqrs-client-base";
|
|
3
|
-
export declare function mkCqrsClient({ cqrsEndpoint, tokenProvider, ajaxOptions, }: {
|
|
3
|
+
export declare function mkCqrsClient({ cqrsEndpoint, tokenProvider, ajaxOptions, tokenHeader, }: {
|
|
4
4
|
cqrsEndpoint: string;
|
|
5
5
|
tokenProvider?: TokenProvider;
|
|
6
6
|
ajaxOptions?: Omit<AjaxConfig, "body" | "headers" | "method" | "responseType" | "url">;
|
|
7
|
+
tokenHeader?: string;
|
|
7
8
|
}): {
|
|
8
9
|
createQuery<TQuery, TResult>(type: string): (dto: TQuery) => import("rxjs").Observable<TResult>;
|
|
9
10
|
createOperation<TOperation, TResult>(type: string): (dto: TOperation) => import("rxjs").Observable<TResult>;
|