@ancon/wildcat-utils 1.43.7 → 1.44.0-r13-2.1
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/hangfire/createHangfirePoller.d.ts +8 -2
- package/hangfire/createHangfirePoller.js +1 -1
- package/hangfire/createHangfirePoller.mjs +72 -62
- package/hangfire/createMakeHangfireRequest.d.ts +10 -1
- package/hangfire/createMakeHangfireRequest.js +1 -1
- package/hangfire/createMakeHangfireRequest.mjs +16 -14
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@ declare type HangfirePollerConfig = {
|
|
|
6
6
|
maxGroupsSize: number;
|
|
7
7
|
/** Max number of simultaneous workers per group */
|
|
8
8
|
maxWorkersSize: number;
|
|
9
|
+
/** Successful response interceptor */
|
|
10
|
+
responseInterceptor?: (response: any) => any;
|
|
11
|
+
/** Failed response interceptor */
|
|
12
|
+
responseRejectionInterceptor?: (error: any) => any;
|
|
9
13
|
/**
|
|
10
14
|
* Function returning a boolean indicating whether connected
|
|
11
15
|
* @example () => isNetworkOnlineSelector(getStore().getState())
|
|
@@ -27,16 +31,18 @@ declare class HangfirePoller {
|
|
|
27
31
|
private workerByIdMap;
|
|
28
32
|
private timer;
|
|
29
33
|
private config;
|
|
34
|
+
private axiosInstance;
|
|
30
35
|
constructor(options?: Partial<HangfirePollerConfig>);
|
|
31
36
|
private stopTimer;
|
|
32
37
|
private startTimer;
|
|
33
38
|
private waitForNetworkOnline;
|
|
34
39
|
private executeWorkerRequest;
|
|
35
40
|
private deleteWorker;
|
|
36
|
-
createWorker(groupId: string, { workerId, url, headers, }: {
|
|
41
|
+
createWorker(groupId: string, { workerId, url, headers, onFinished, }: {
|
|
37
42
|
workerId: string;
|
|
38
43
|
url: string;
|
|
39
|
-
headers
|
|
44
|
+
headers?: APIHeaders;
|
|
45
|
+
onFinished?: (forced: boolean) => void | Promise<void>;
|
|
40
46
|
}): Promise<unknown>;
|
|
41
47
|
/** Trigger a worker to execute immediately, ignoring busy state */
|
|
42
48
|
triggerWorker(workerId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var p=Object.defineProperty;var b=(i,e,r)=>e in i?p(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var o=(i,e,r)=>(b(i,typeof e!="symbol"?e+"":e,r),r);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const W=require("axios"),h=require("@ancon/wildcat-types"),c=require("../error/createCodedError.js"),m=require("../error/isNotFoundError.js"),x=require("../error/serializeError.js"),k=require("../error/isErrorWithStatusCode.js"),y=require("../api/isNoContentResponse.js"),E=require("../shared/wait.js");require("../error/isCodedError.js");require("../error/isAPIError.js");class f{constructor(e){o(this,"busyWorkers",new Set);o(this,"enabledGroups",new Set);o(this,"groups",new Map);o(this,"workerByIdMap",new Map);o(this,"timer",null);o(this,"config",{pollerInterval:5e3,maxGroupsSize:50,maxWorkersSize:20,responseInterceptor:void 0,responseRejectionInterceptor:void 0,getIsNetworkOnline(){return!0},async getRequestHeaders(){return{}},debug(...e){console.log(...e)}});o(this,"axiosInstance");this.config={...this.config,...e??null},this.axiosInstance=W.create(),(this.config.responseInterceptor||this.config.responseRejectionInterceptor)&&this.axiosInstance.interceptors.response.use(this.config.responseInterceptor,this.config.responseRejectionInterceptor)}stopTimer(){this.timer!=null&&(this.config.debug("*stop timer*"),clearInterval(this.timer),this.timer=null)}startTimer(){if(this.timer!=null)throw c(new Error("Timer already started"),h.ErrorCode.GenericUnexpectedHangfireError);this.config.debug("*start timer*"),this.timer=setInterval(()=>{this.config.debug("*tick*",{busyWorkers:this.busyWorkers.size,enabledGroups:this.enabledGroups.size,groups:this.groups}),this.enabledGroups.forEach(e=>{const r=this.groups.get(e);r&&r.forEach(t=>this.executeWorkerRequest(t))}),this.groups.size<1&&this.stopTimer()},this.config.pollerInterval)}async waitForNetworkOnline(e=5){let r=0;for(;!this.config.getIsNetworkOnline()&&r<e+1;)r+=1,await E(1e3)}async executeWorkerRequest(e,r=!1){const t=r!==!0&&this.busyWorkers.has(e.workerId);this.config.debug("*executeWorkerRequest*",{workerId:e.workerId,isBusy:t,force:r}),t?this.config.debug("*executeWorkerRequest* worker is busy",e.workerId):(this.busyWorkers.add(e.workerId),await this.waitForNetworkOnline(),this.config.debug("*executeWorkerRequest* request",{isNetworkOnline:this.config.getIsNetworkOnline()}),this.axiosInstance({url:e.url,method:"get",timeout:this.config.pollerInterval,headers:{...await this.config.getRequestHeaders(),...e.headers}}).then(s=>{var n;s&&!y(s)?(e.resolve(s),(n=e.onFinished)==null||n.call(e,r),this.deleteWorker(e.groupId,e.workerId)):this.busyWorkers.delete(e.workerId)}).catch(s=>{var n,u;if(k(s)){if(m(s)){this.config.debug("*executeWorkerRequest* worker is expired or invalid",e.workerId);const a=x(c(new Error("The Hangfire worker is expired or invalid"),h.ErrorCode.HangfireWorkerExpiredOrInvalid));e.reject(a),(n=e.onFinished)==null||n.call(e,r)}else e.reject(s),(u=e.onFinished)==null||u.call(e,r);this.deleteWorker(e.groupId,e.workerId)}else this.config.debug("*executeWorkerRequest* not an api error"),this.busyWorkers.delete(e.workerId)}))}deleteWorker(e,r){const t=this.groups.get(e);t&&(this.config.debug("*delete worker*",t.size,t),t.delete(r),this.workerByIdMap.delete(r),this.busyWorkers.delete(r),t.size<1&&(this.groups.delete(e),this.enabledGroups.delete(e),this.enabledGroups.size<1&&this.stopTimer()))}createWorker(e,{workerId:r,url:t,headers:s,onFinished:n}){if(!this.groups.has(e)){if(this.groups.size>=this.config.maxGroupsSize){const a=c(new Error("Max number of Hangfire groups exceeded"),h.ErrorCode.GenericUnexpectedHangfireError,{count:this.groups.size});throw this.destroy(),a}this.groups.set(e,new Map)}const u=this.groups.get(e);return new Promise((a,l)=>{if(u.has(r))throw c(new Error("Duplicate Hangfire worker ID"),h.ErrorCode.GenericUnexpectedHangfireError);if(u.size>=this.config.maxWorkersSize){const g=c(new Error("Max number of Hangfire workers in group exceeded"),h.ErrorCode.GenericUnexpectedHangfireError,{groupId:e,count:u.size});throw l(g),this.destroy(),g}const d={workerId:r,groupId:e,url:t,resolve:a,reject:l,headers:s,onFinished:n};u.set(r,d),this.workerByIdMap.set(r,d),this.enabledGroups.has(e)||this.enabledGroups.add(e),this.timer==null&&this.enabledGroups.size>0&&this.startTimer()})}triggerWorker(e){this.config.debug("*triggerWorker*");const r=this.workerByIdMap.get(e);r?this.executeWorkerRequest(r,!0):this.config.debug("*triggerWorker* worker not found",e)}triggerAllWorkers(){this.config.debug("*triggerAllWorkers*");for(const e of this.workerByIdMap.values())this.executeWorkerRequest(e)}enableWorkers(e){this.config.debug("*enable*",e),this.enabledGroups.add(e),this.groups.has(e)&&this.timer==null&&this.startTimer()}disableWorkers(e){this.config.debug("*disable*",e),this.enabledGroups.delete(e),this.enabledGroups.size<1&&this.stopTimer()}destroy(){this.config.debug("*destroy*"),this.groups.clear(),this.stopTimer()}}function q(i){return new f(i)}exports.HangfirePoller=f;exports.default=q;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var f = (
|
|
3
|
-
var o = (
|
|
4
|
-
import
|
|
5
|
-
import { ErrorCode as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var f = (i, e, t) => e in i ? p(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var o = (i, e, t) => (f(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import m from "axios";
|
|
5
|
+
import { ErrorCode as u } from "@ancon/wildcat-types";
|
|
6
|
+
import c from "../error/createCodedError.mjs";
|
|
7
|
+
import b from "../error/isNotFoundError.mjs";
|
|
8
|
+
import W from "../error/serializeError.mjs";
|
|
9
|
+
import x from "../error/isErrorWithStatusCode.mjs";
|
|
10
|
+
import k from "../api/isNoContentResponse.mjs";
|
|
11
|
+
import y from "../shared/wait.mjs";
|
|
12
12
|
import "../error/isCodedError.mjs";
|
|
13
13
|
import "../error/isAPIError.mjs";
|
|
14
|
-
class
|
|
14
|
+
class I {
|
|
15
15
|
constructor(e) {
|
|
16
16
|
/** Workers currently executing a request */
|
|
17
17
|
o(this, "busyWorkers", /* @__PURE__ */ new Set());
|
|
@@ -26,6 +26,8 @@ class x {
|
|
|
26
26
|
pollerInterval: 5e3,
|
|
27
27
|
maxGroupsSize: 50,
|
|
28
28
|
maxWorkersSize: 20,
|
|
29
|
+
responseInterceptor: void 0,
|
|
30
|
+
responseRejectionInterceptor: void 0,
|
|
29
31
|
getIsNetworkOnline() {
|
|
30
32
|
return !0;
|
|
31
33
|
},
|
|
@@ -36,19 +38,23 @@ class x {
|
|
|
36
38
|
console.log(...e);
|
|
37
39
|
}
|
|
38
40
|
});
|
|
41
|
+
o(this, "axiosInstance");
|
|
39
42
|
this.config = {
|
|
40
43
|
...this.config,
|
|
41
44
|
...e ?? null
|
|
42
|
-
}
|
|
45
|
+
}, this.axiosInstance = m.create(), (this.config.responseInterceptor || this.config.responseRejectionInterceptor) && this.axiosInstance.interceptors.response.use(
|
|
46
|
+
this.config.responseInterceptor,
|
|
47
|
+
this.config.responseRejectionInterceptor
|
|
48
|
+
);
|
|
43
49
|
}
|
|
44
50
|
stopTimer() {
|
|
45
51
|
this.timer != null && (this.config.debug("*stop timer*"), clearInterval(this.timer), this.timer = null);
|
|
46
52
|
}
|
|
47
53
|
startTimer() {
|
|
48
54
|
if (this.timer != null)
|
|
49
|
-
throw
|
|
55
|
+
throw c(
|
|
50
56
|
new Error("Timer already started"),
|
|
51
|
-
|
|
57
|
+
u.GenericUnexpectedHangfireError
|
|
52
58
|
);
|
|
53
59
|
this.config.debug("*start timer*"), this.timer = setInterval(() => {
|
|
54
60
|
this.config.debug("*tick*", {
|
|
@@ -56,28 +62,28 @@ class x {
|
|
|
56
62
|
enabledGroups: this.enabledGroups.size,
|
|
57
63
|
groups: this.groups
|
|
58
64
|
}), this.enabledGroups.forEach((e) => {
|
|
59
|
-
const
|
|
60
|
-
|
|
65
|
+
const t = this.groups.get(e);
|
|
66
|
+
t && t.forEach((r) => this.executeWorkerRequest(r));
|
|
61
67
|
}), this.groups.size < 1 && this.stopTimer();
|
|
62
68
|
}, this.config.pollerInterval);
|
|
63
69
|
}
|
|
64
70
|
async waitForNetworkOnline(e = 5) {
|
|
65
|
-
let
|
|
66
|
-
for (; !this.config.getIsNetworkOnline() &&
|
|
67
|
-
|
|
71
|
+
let t = 0;
|
|
72
|
+
for (; !this.config.getIsNetworkOnline() && t < e + 1; )
|
|
73
|
+
t += 1, await y(1e3);
|
|
68
74
|
}
|
|
69
|
-
async executeWorkerRequest(e,
|
|
70
|
-
const
|
|
75
|
+
async executeWorkerRequest(e, t = !1) {
|
|
76
|
+
const r = t !== !0 && this.busyWorkers.has(e.workerId);
|
|
71
77
|
this.config.debug("*executeWorkerRequest*", {
|
|
72
78
|
workerId: e.workerId,
|
|
73
|
-
isBusy:
|
|
74
|
-
force:
|
|
75
|
-
}),
|
|
79
|
+
isBusy: r,
|
|
80
|
+
force: t
|
|
81
|
+
}), r ? this.config.debug(
|
|
76
82
|
"*executeWorkerRequest* worker is busy",
|
|
77
83
|
e.workerId
|
|
78
84
|
) : (this.busyWorkers.add(e.workerId), await this.waitForNetworkOnline(), this.config.debug("*executeWorkerRequest* request", {
|
|
79
85
|
isNetworkOnline: this.config.getIsNetworkOnline()
|
|
80
|
-
}),
|
|
86
|
+
}), this.axiosInstance({
|
|
81
87
|
url: e.url,
|
|
82
88
|
method: "get",
|
|
83
89
|
timeout: this.config.pollerInterval,
|
|
@@ -85,80 +91,84 @@ class x {
|
|
|
85
91
|
...await this.config.getRequestHeaders(),
|
|
86
92
|
...e.headers
|
|
87
93
|
}
|
|
88
|
-
}).then((
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
}).then((s) => {
|
|
95
|
+
var n;
|
|
96
|
+
s && !k(s) ? (e.resolve(s), (n = e.onFinished) == null || n.call(e, t), this.deleteWorker(e.groupId, e.workerId)) : this.busyWorkers.delete(e.workerId);
|
|
97
|
+
}).catch((s) => {
|
|
98
|
+
var n, a;
|
|
99
|
+
if (x(s)) {
|
|
100
|
+
if (b(s)) {
|
|
93
101
|
this.config.debug(
|
|
94
102
|
"*executeWorkerRequest* worker is expired or invalid",
|
|
95
103
|
e.workerId
|
|
96
104
|
);
|
|
97
|
-
const
|
|
98
|
-
|
|
105
|
+
const h = W(
|
|
106
|
+
c(
|
|
99
107
|
new Error("The Hangfire worker is expired or invalid"),
|
|
100
|
-
|
|
108
|
+
u.HangfireWorkerExpiredOrInvalid
|
|
101
109
|
)
|
|
102
110
|
);
|
|
103
|
-
e.reject(n);
|
|
111
|
+
e.reject(h), (n = e.onFinished) == null || n.call(e, t);
|
|
104
112
|
} else
|
|
105
|
-
e.reject(
|
|
113
|
+
e.reject(s), (a = e.onFinished) == null || a.call(e, t);
|
|
106
114
|
this.deleteWorker(e.groupId, e.workerId);
|
|
107
115
|
} else
|
|
108
116
|
this.config.debug("*executeWorkerRequest* not an api error"), this.busyWorkers.delete(e.workerId);
|
|
109
117
|
}));
|
|
110
118
|
}
|
|
111
|
-
deleteWorker(e,
|
|
112
|
-
const
|
|
113
|
-
|
|
119
|
+
deleteWorker(e, t) {
|
|
120
|
+
const r = this.groups.get(e);
|
|
121
|
+
r && (this.config.debug("*delete worker*", r.size, r), r.delete(t), this.workerByIdMap.delete(t), this.busyWorkers.delete(t), r.size < 1 && (this.groups.delete(e), this.enabledGroups.delete(e), this.enabledGroups.size < 1 && this.stopTimer()));
|
|
114
122
|
}
|
|
115
123
|
createWorker(e, {
|
|
116
|
-
workerId:
|
|
117
|
-
url:
|
|
118
|
-
headers:
|
|
124
|
+
workerId: t,
|
|
125
|
+
url: r,
|
|
126
|
+
headers: s,
|
|
127
|
+
onFinished: n
|
|
119
128
|
}) {
|
|
120
129
|
if (!this.groups.has(e)) {
|
|
121
130
|
if (this.groups.size >= this.config.maxGroupsSize) {
|
|
122
|
-
const h =
|
|
131
|
+
const h = c(
|
|
123
132
|
new Error("Max number of Hangfire groups exceeded"),
|
|
124
|
-
|
|
133
|
+
u.GenericUnexpectedHangfireError,
|
|
125
134
|
{ count: this.groups.size }
|
|
126
135
|
);
|
|
127
136
|
throw this.destroy(), h;
|
|
128
137
|
}
|
|
129
138
|
this.groups.set(e, /* @__PURE__ */ new Map());
|
|
130
139
|
}
|
|
131
|
-
const
|
|
140
|
+
const a = this.groups.get(e);
|
|
132
141
|
return new Promise((h, l) => {
|
|
133
|
-
if (
|
|
134
|
-
throw
|
|
142
|
+
if (a.has(t))
|
|
143
|
+
throw c(
|
|
135
144
|
new Error("Duplicate Hangfire worker ID"),
|
|
136
|
-
|
|
145
|
+
u.GenericUnexpectedHangfireError
|
|
137
146
|
);
|
|
138
|
-
if (
|
|
139
|
-
const d =
|
|
147
|
+
if (a.size >= this.config.maxWorkersSize) {
|
|
148
|
+
const d = c(
|
|
140
149
|
new Error("Max number of Hangfire workers in group exceeded"),
|
|
141
|
-
|
|
142
|
-
{ groupId: e, count:
|
|
150
|
+
u.GenericUnexpectedHangfireError,
|
|
151
|
+
{ groupId: e, count: a.size }
|
|
143
152
|
);
|
|
144
153
|
throw l(d), this.destroy(), d;
|
|
145
154
|
}
|
|
146
155
|
const g = {
|
|
147
|
-
workerId:
|
|
156
|
+
workerId: t,
|
|
148
157
|
groupId: e,
|
|
149
|
-
url:
|
|
158
|
+
url: r,
|
|
150
159
|
resolve: h,
|
|
151
160
|
reject: l,
|
|
152
|
-
headers:
|
|
161
|
+
headers: s,
|
|
162
|
+
onFinished: n
|
|
153
163
|
};
|
|
154
|
-
|
|
164
|
+
a.set(t, g), this.workerByIdMap.set(t, g), this.enabledGroups.has(e) || this.enabledGroups.add(e), this.timer == null && this.enabledGroups.size > 0 && this.startTimer();
|
|
155
165
|
});
|
|
156
166
|
}
|
|
157
167
|
/** Trigger a worker to execute immediately, ignoring busy state */
|
|
158
168
|
triggerWorker(e) {
|
|
159
169
|
this.config.debug("*triggerWorker*");
|
|
160
|
-
const
|
|
161
|
-
|
|
170
|
+
const t = this.workerByIdMap.get(e);
|
|
171
|
+
t ? this.executeWorkerRequest(t, !0) : this.config.debug("*triggerWorker* worker not found", e);
|
|
162
172
|
}
|
|
163
173
|
/** Trigger all workers to execute immediately */
|
|
164
174
|
triggerAllWorkers() {
|
|
@@ -177,10 +187,10 @@ class x {
|
|
|
177
187
|
this.config.debug("*destroy*"), this.groups.clear(), this.stopTimer();
|
|
178
188
|
}
|
|
179
189
|
}
|
|
180
|
-
function
|
|
181
|
-
return new
|
|
190
|
+
function O(i) {
|
|
191
|
+
return new I(i);
|
|
182
192
|
}
|
|
183
193
|
export {
|
|
184
|
-
|
|
185
|
-
|
|
194
|
+
I as HangfirePoller,
|
|
195
|
+
O as default
|
|
186
196
|
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { APIHeaders, APIParams, APIPostRequest, APIPutRequest } from '@ancon/wildcat-types';
|
|
2
2
|
import type { AxiosResponse } from 'axios';
|
|
3
3
|
import { HangfirePoller } from './createHangfirePoller';
|
|
4
|
+
declare type MakeHangfireRequestOptions = {
|
|
5
|
+
headers?: APIHeaders;
|
|
6
|
+
/** Optional callback on successful init response */
|
|
7
|
+
onInitResponse?: () => void | Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* @param forced Forced indicates it was triggered by an event rather than via polling
|
|
10
|
+
*/
|
|
11
|
+
onWorkerFinished?: (forced: boolean) => void | Promise<void>;
|
|
12
|
+
};
|
|
4
13
|
/**
|
|
5
14
|
*
|
|
6
15
|
* @param hangfirePoller `HangfirePoller` instance from `createHangfirePoller()`
|
|
7
16
|
* @returns `makeHangfireRequest()` callback function
|
|
8
17
|
*/
|
|
9
|
-
declare function createMakeHangfireRequest(hangfirePoller: HangfirePoller): <TData extends Record<string, any>, TParams extends APIParams>(request: APIPostRequest<unknown, TData, TParams> | APIPutRequest<unknown, TData, TParams>, data: TData, params: TParams, groupId: string,
|
|
18
|
+
declare function createMakeHangfireRequest(hangfirePoller: HangfirePoller): <TData extends Record<string, any>, TParams extends APIParams>(request: APIPostRequest<unknown, TData, TParams> | APIPutRequest<unknown, TData, TParams>, data: TData, params: TParams, groupId: string, options?: MakeHangfireRequestOptions) => Promise<AxiosResponse>;
|
|
10
19
|
export default createMakeHangfireRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("./isHangfireResponse.js");require("../api/isAcceptedResponse.js");function R(r,u){return`${r.config.baseURL??""}/${r.config.url??""}/status/${u}`}function q(r){return async function(d,g,h,k,e){var c;const a=await d(g,h,e==null?void 0:e.headers);if(await((c=e==null?void 0:e.onInitResponse)==null?void 0:c.call(e)),n(a)){const f=a.data.id;return r.createWorker(k,{workerId:f,url:R(a,f),headers:e==null?void 0:e.headers,onFinished:e==null?void 0:e.onWorkerFinished})}return a}}module.exports=q;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import R from "./isHangfireResponse.mjs";
|
|
2
2
|
import "../api/isAcceptedResponse.mjs";
|
|
3
|
-
function
|
|
4
|
-
return `${r.config.baseURL ?? ""}/${r.config.url ?? ""}/status/${
|
|
3
|
+
function l(r, u) {
|
|
4
|
+
return `${r.config.baseURL ?? ""}/${r.config.url ?? ""}/status/${u}`;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return async function(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
function w(r) {
|
|
7
|
+
return async function(d, g, k, h, e) {
|
|
8
|
+
var f;
|
|
9
|
+
const a = await d(g, k, e == null ? void 0 : e.headers);
|
|
10
|
+
if (await ((f = e == null ? void 0 : e.onInitResponse) == null ? void 0 : f.call(e)), R(a)) {
|
|
11
|
+
const c = a.data.id;
|
|
12
|
+
return r.createWorker(h, {
|
|
13
|
+
workerId: c,
|
|
14
|
+
url: l(a, c),
|
|
15
|
+
headers: e == null ? void 0 : e.headers,
|
|
16
|
+
onFinished: e == null ? void 0 : e.onWorkerFinished
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
|
-
return
|
|
19
|
+
return a;
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
export {
|
|
21
|
-
|
|
23
|
+
w as default
|
|
22
24
|
};
|