@ancon/wildcat-utils 1.44.3 → 1.44.5
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.
|
@@ -3,6 +3,11 @@ import type { AxiosResponse } from 'axios';
|
|
|
3
3
|
import { HangfirePoller } from './createHangfirePoller';
|
|
4
4
|
declare type MakeHangfireRequestOptions = {
|
|
5
5
|
headers?: APIHeaders;
|
|
6
|
+
/**
|
|
7
|
+
* Override the hangfire worker url request version
|
|
8
|
+
* Default version is same as the main request endpoint version
|
|
9
|
+
*/
|
|
10
|
+
version?: number;
|
|
6
11
|
/** Optional callback on successful init response */
|
|
7
12
|
onInitResponse?: () => void | Promise<void>;
|
|
8
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const k=require("./isHangfireResponse.js");require("../api/isAcceptedResponse.js");const l=/v\d+\.\d+/;function q(a,d,u){const f=a.config.baseURL;let r=a.config.url;return r&&u&&(r=r.replace(l,`v${u}`)),`${f??""}/${r??""}/status/${d}`}function n(a){return async function(u,f,r,h,e){var R;const c=await u(f,r,e==null?void 0:e.headers);if(await((R=e==null?void 0:e.onInitResponse)==null?void 0:R.call(e)),k(c)){const g=c.data.id;return a.createWorker(h,{workerId:g,url:q(c,g,e==null?void 0:e.version),headers:e==null?void 0:e.headers,onFinished:e==null?void 0:e.onWorkerFinished})}return c}}module.exports=n;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import l from "./isHangfireResponse.mjs";
|
|
2
2
|
import "../api/isAcceptedResponse.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const h = /v\d+\.\d+/;
|
|
4
|
+
function m(a, d, u) {
|
|
5
|
+
const f = a.config.baseURL;
|
|
6
|
+
let r = a.config.url;
|
|
7
|
+
return r && u && (r = r.replace(h, `v${u}`)), `${f ?? ""}/${r ?? ""}/status/${d}`;
|
|
5
8
|
}
|
|
6
|
-
function
|
|
7
|
-
return async function(
|
|
8
|
-
var
|
|
9
|
-
const
|
|
10
|
-
if (await ((
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
workerId:
|
|
14
|
-
url:
|
|
9
|
+
function q(a) {
|
|
10
|
+
return async function(u, f, r, k, e) {
|
|
11
|
+
var R;
|
|
12
|
+
const c = await u(f, r, e == null ? void 0 : e.headers);
|
|
13
|
+
if (await ((R = e == null ? void 0 : e.onInitResponse) == null ? void 0 : R.call(e)), l(c)) {
|
|
14
|
+
const g = c.data.id;
|
|
15
|
+
return a.createWorker(k, {
|
|
16
|
+
workerId: g,
|
|
17
|
+
url: m(c, g, e == null ? void 0 : e.version),
|
|
15
18
|
headers: e == null ? void 0 : e.headers,
|
|
16
19
|
onFinished: e == null ? void 0 : e.onWorkerFinished
|
|
17
20
|
});
|
|
18
21
|
}
|
|
19
|
-
return
|
|
22
|
+
return c;
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
25
|
export {
|
|
23
|
-
|
|
26
|
+
q as default
|
|
24
27
|
};
|