@nocobase/plugin-workflow 2.1.0-alpha.20 → 2.1.0-alpha.21

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.
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-04-20T10:43:50.252Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-04-23T22:20:41.554Z"}
@@ -1 +1 @@
1
- (function(){"use strict";var t={714:function(t){t.exports=require("node:diagnostics_channel")}};var e={};function __nccwpck_require__(i){var s=e[i];if(s!==undefined){return s.exports}var h=e[i]={exports:{}};var r=true;try{t[i](h,h.exports,__nccwpck_require__);r=false}finally{if(r)delete e[i]}return h.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i={};!function(){var t=i;var G=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var e=G((t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.tracing=t.metrics=void 0;var e=__nccwpck_require__(714);t.metrics=(0,e.channel)("lru-cache:metrics");t.tracing=(0,e.tracingChannel)("lru-cache")}));Object.defineProperty(t,"__esModule",{value:!0});t.LRUCache=void 0;var s=e(),D=()=>s.metrics.hasSubscribers||s.tracing.hasSubscribers,h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,l=typeof process=="object"&&process?process:{},H=(t,e,i,s)=>{typeof l.emitWarning=="function"?l.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)},N=t=>!r.has(t),n=Symbol("type"),F=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),I=t=>F(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(t){super(t),this.fill(0)}},g=class c{heap;length;static#t=!1;static create(t){let e=I(t);if(!e)return[];c.#t=!0;let i=new c(t,e);return c.#t=!1,i}constructor(t,e){if(!c.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},v=class c{#t;#e;#i;#s;#h;#r;#o;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#a;#u;#c;#f;#d;#p;#g;#v;#m;#w;#_;#S;#b;#y;#F;#A;#O;#x;static unsafeExposeInternals(t){return{starts:t.#S,ttls:t.#b,autopurgeTimers:t.#y,sizes:t.#_,keyMap:t.#u,keyList:t.#c,valList:t.#f,next:t.#d,prev:t.#p,get head(){return t.#g},get tail(){return t.#v},free:t.#m,isBackgroundFetch:e=>t.#T(e),backgroundFetch:(e,i,s,h)=>t.#z(e,i,s,h),moveToTail:e=>t.#E(e),indexes:e=>t.#R(e),rindexes:e=>t.#C(e),isStale:e=>t.#D(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#a}get size(){return this.#n}get fetchMethod(){return this.#r}get memoMethod(){return this.#o}get dispose(){return this.#i}get onInsert(){return this.#s}get disposeAfter(){return this.#h}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:n,updateAgeOnHas:u,allowStale:v,dispose:m,onInsert:w,disposeAfter:_,noDisposeOnSet:S,noUpdateTTL:b,maxSize:y=0,maxEntrySize:A=0,sizeCalculation:O,fetchMethod:x,memoMethod:T,noDeleteOnFetchRejection:z,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:C,ignoreFetchAbort:W,perf:k}=t;if(k!==void 0&&typeof k?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#l=k??h,e!==0&&!F(e))throw new TypeError("max option must be a nonnegative integer");let L=e?I(e):Array;if(!L)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=y,this.maxEntrySize=A||this.#e,this.sizeCalculation=O,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=T,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#r=x,this.#A=!!x,this.#u=new Map,this.#c=Array.from({length:e}).fill(void 0),this.#f=Array.from({length:e}).fill(void 0),this.#d=new L(e),this.#p=new L(e),this.#g=0,this.#v=0,this.#m=g.create(e),this.#n=0,this.#a=0,typeof m=="function"&&(this.#i=m),typeof w=="function"&&(this.#s=w),typeof _=="function"?(this.#h=_,this.#w=[]):(this.#h=void 0,this.#w=void 0),this.#F=!!this.#i,this.#x=!!this.#s,this.#O=!!this.#h,this.noDisposeOnSet=!!S,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!z,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(this.#e!==0&&!F(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!F(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!v,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!u,this.ttlResolution=F(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!F(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let t="LRU_CACHE_UNBOUNDED";N(t)&&(r.add(t),H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,c))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#k(){let t=new u(this.#t),e=new u(this.#t);this.#b=t,this.#S=e;let i=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#y=i,this.#L=(i,h,r=this.#l.now())=>{e[i]=h!==0?r:0,t[i]=h,s(i,h)},this.#j=i=>{e[i]=t[i]!==0?this.#l.now():0,s(i,t[i])};let s=this.ttlAutopurge?(t,e)=>{if(i?.[t]&&(clearTimeout(i[t]),i[t]=void 0),e&&e!==0&&i){let s=setTimeout((()=>{this.#D(t)&&this.#G(this.#c[t],"expire")}),e+1);s.unref&&s.unref(),i[t]=s}}:()=>{};this.#U=(i,s)=>{if(t[s]){let r=t[s],l=e[s];if(!r||!l)return;i.ttl=r,i.start=l,i.now=h||o();let n=i.now-l;i.remainingTTL=r-n}};let h=0,o=()=>{let t=this.#l.now();if(this.ttlResolution>0){h=t;let e=setTimeout((()=>h=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{let s=this.#u.get(i);if(s===void 0)return 0;let r=t[s],l=e[s];if(!r||!l)return 1/0;let n=(h||o())-l;return r-n},this.#D=i=>{let s=e[i],r=t[i];return!!r&&!!s&&(h||o())-s>r}}#j=()=>{};#U=()=>{};#L=()=>{};#D=()=>!1;#W(){let t=new u(this.#t);this.#a=0,this.#_=t,this.#M=e=>{this.#a-=t[e],t[e]=0},this.#P=(t,e,i,s)=>{if(this.#T(e))return 0;if(!F(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(e,t),!F(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#q=(e,i,s)=>{if(t[e]=i,this.#e){let i=this.#e-t[e];for(;this.#a>i;)this.#I(!0)}this.#a+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#a)}}#M=t=>{};#q=(t,e,i)=>{};#P=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#R({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#v;this.#H(e)&&((t||!this.#D(e))&&(yield e),e!==this.#g);)e=this.#p[e]}*#C({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#g;this.#H(e)&&((t||!this.#D(e))&&(yield e),e!==this.#v);)e=this.#d[e]}#H(t){return t!==void 0&&this.#u.get(this.#c[t])===t}*entries(){for(let t of this.#R())this.#f[t]!==void 0&&this.#c[t]!==void 0&&!this.#T(this.#f[t])&&(yield[this.#c[t],this.#f[t]])}*rentries(){for(let t of this.#C())this.#f[t]!==void 0&&this.#c[t]!==void 0&&!this.#T(this.#f[t])&&(yield[this.#c[t],this.#f[t]])}*keys(){for(let t of this.#R()){let e=this.#c[t];e!==void 0&&!this.#T(this.#f[t])&&(yield e)}}*rkeys(){for(let t of this.#C()){let e=this.#c[t];e!==void 0&&!this.#T(this.#f[t])&&(yield e)}}*values(){for(let t of this.#R())this.#f[t]!==void 0&&!this.#T(this.#f[t])&&(yield this.#f[t])}*rvalues(){for(let t of this.#C())this.#f[t]!==void 0&&!this.#T(this.#f[t])&&(yield this.#f[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#R()){let s=this.#f[i],h=this.#T(s)?s.__staleWhileFetching:s;if(h!==void 0&&t(h,this.#c[i],this))return this.#N(this.#c[i],e)}}forEach(t,e=this){for(let i of this.#R()){let s=this.#f[i],h=this.#T(s)?s.__staleWhileFetching:s;h!==void 0&&t.call(e,h,this.#c[i],this)}}rforEach(t,e=this){for(let i of this.#C()){let s=this.#f[i],h=this.#T(s)?s.__staleWhileFetching:s;h!==void 0&&t.call(e,h,this.#c[i],this)}}purgeStale(){let t=!1;for(let e of this.#C({allowStale:!0}))this.#D(e)&&(this.#G(this.#c[e],"expire"),t=!0);return t}info(t){let e=this.#u.get(t);if(e===void 0)return;let i=this.#f[e],s=this.#T(i)?i.__staleWhileFetching:i;if(s===void 0)return;let h={value:s};if(this.#b&&this.#S){let t=this.#b[e],i=this.#S[e];if(t&&i){let e=t-(this.#l.now()-i);h.ttl=e,h.start=Date.now()}}return this.#_&&(h.size=this.#_[e]),h}dump(){let t=[];for(let e of this.#R({allowStale:!0})){let i=this.#c[e],s=this.#f[e],h=this.#T(s)?s.__staleWhileFetching:s;if(h===void 0||i===void 0)continue;let r={value:h};if(this.#b&&this.#S){r.ttl=this.#b[e];let t=this.#l.now()-this.#S[e];r.start=Math.floor(Date.now()-t)}this.#_&&(r.size=this.#_[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let t=Date.now()-i.start;i.start=this.#l.now()-t}this.#$(e,i.value,i)}}set(t,e,i={}){let{status:h=(s.metrics.hasSubscribers?{}:void 0)}=i;i.status=h,h&&(h.op="set",h.key=t,e!==void 0&&(h.value=e));let r=this.#$(t,e,i);return h&&s.metrics.hasSubscribers&&s.metrics.publish(h),r}#$(t,e,i={}){let{ttl:s=this.ttl,start:h,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:n}=i;if(e===void 0)return n&&(n.set="deleted"),this.delete(t),this;let{noUpdateTTL:u=this.noUpdateTTL}=i;n&&!this.#T(e)&&(n.value=e);let g=this.#P(t,e,i.size||0,l,n);if(this.maxEntrySize&&g>this.maxEntrySize)return this.#G(t,"set"),n&&(n.set="miss",n.maxEntrySizeExceeded=!0),this;let v=this.#n===0?void 0:this.#u.get(t);if(v===void 0)v=this.#n===0?this.#v:this.#m.length!==0?this.#m.pop():this.#n===this.#t?this.#I(!1):this.#n,this.#c[v]=t,this.#f[v]=e,this.#u.set(t,v),this.#d[this.#v]=v,this.#p[v]=this.#v,this.#v=v,this.#n++,this.#q(v,g,n),n&&(n.set="add"),u=!1,this.#x&&this.#s?.(e,t,"add");else{this.#E(v);let i=this.#f[v];if(e!==i){if(this.#A&&this.#T(i)){i.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:e}=i;e!==void 0&&!r&&(this.#F&&this.#i?.(e,t,"set"),this.#O&&this.#w?.push([e,t,"set"]))}else r||(this.#F&&this.#i?.(i,t,"set"),this.#O&&this.#w?.push([i,t,"set"]));if(this.#M(v),this.#q(v,g,n),this.#f[v]=e,n){n.set="replace";let t=i&&this.#T(i)?i.__staleWhileFetching:i;t!==void 0&&(n.oldValue=t)}}else n&&(n.set="update");this.#x&&this.onInsert?.(e,t,e===i?"update":"replace")}if(s!==0&&!this.#b&&this.#k(),this.#b&&(u||this.#L(v,s,h),n&&this.#U(n,v)),!r&&this.#O&&this.#w){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}return this}pop(){try{for(;this.#n;){let t=this.#f[this.#g];if(this.#I(!0),this.#T(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#O&&this.#w){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}}}#I(t){let e=this.#g,i=this.#c[e],s=this.#f[e];return this.#A&&this.#T(s)?s.__abortController.abort(new Error("evicted")):(this.#F||this.#O)&&(this.#F&&this.#i?.(s,i,"evict"),this.#O&&this.#w?.push([s,i,"evict"])),this.#M(e),this.#y?.[e]&&(clearTimeout(this.#y[e]),this.#y[e]=void 0),t&&(this.#c[e]=void 0,this.#f[e]=void 0,this.#m.push(e)),this.#n===1?(this.#g=this.#v=0,this.#m.length=0):this.#g=this.#d[e],this.#u.delete(i),this.#n--,e}has(t,e={}){let{status:i=(s.metrics.hasSubscribers?{}:void 0)}=e;e.status=i,i&&(i.op="has",i.key=t);let h=this.#B(t,e);return s.metrics.hasSubscribers&&s.metrics.publish(i),h}#B(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,h=this.#u.get(t);if(h!==void 0){let t=this.#f[h];if(this.#T(t)&&t.__staleWhileFetching===void 0)return!1;if(this.#D(h))s&&(s.has="stale",this.#U(s,h));else return i&&this.#j(h),s&&(s.has="hit",this.#U(s,h)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=(D()?{}:void 0)}=e;i&&(i.op="peek",i.key=t),e.status=i;let h=this.#V(t,e);return s.metrics.hasSubscribers&&s.metrics.publish(i),h}#V(t,e){let{status:i,allowStale:s=this.allowStale}=e,h=this.#u.get(t);if(h===void 0||!s&&this.#D(h)){i&&(i.peek=h===void 0?"miss":"stale");return}let r=this.#f[h],l=this.#T(r)?r.__staleWhileFetching:r;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#z(t,e,i,s){let h=e===void 0?void 0:this.#f[e];if(this.#T(h))return h;let r=new AbortController,{signal:l}=i;l?.addEventListener("abort",(()=>r.abort(l.reason)),{signal:r.signal});let n={signal:r.signal,options:i,context:s},a=(s,h=!1)=>{let{aborted:l}=r.signal,g=i.ignoreFetchAbort&&s!==void 0,v=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&s!==void 0);if(i.status&&(l&&!h?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,g&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!g&&!h)return f(r.signal.reason,v);let m=u,w=this.#f[e];return(w===u||w===void 0&&g&&h)&&(s===void 0?m.__staleWhileFetching!==void 0?this.#f[e]=m.__staleWhileFetching:this.#G(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#$(t,s,n.options))),s},d=t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),f(t,!1)),f=(s,h)=>{let{aborted:l}=r.signal,n=l&&i.allowStaleOnFetchAbort,g=n||i.allowStaleOnFetchRejection,v=g||i.noDeleteOnFetchRejection,m=u;if(this.#f[e]===u&&(!v||!h&&m.__staleWhileFetching===void 0?this.#G(t,"fetch"):n||(this.#f[e]=m.__staleWhileFetching)),g)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw s},p=(e,s)=>{let l=this.#r?.(t,h,n);l&&l instanceof Promise&&l.then((t=>e(t===void 0?void 0:t)),s),r.signal.addEventListener("abort",(()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>a(t,!0)))}))};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(p).then(a,d),g=Object.assign(u,{__abortController:r,__staleWhileFetching:h,__returned:void 0});return e===void 0?(this.#$(t,g,{...n.options,status:void 0}),e=this.#u.get(t)):this.#f[e]=g,g}#T(t){if(!this.#A)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=s.tracing.hasSubscribers,{status:h=(D()?{}:void 0)}=e;e.status=h,h&&e.context&&(h.context=e.context);let r=this.#X(t,e);return h&&D()&&i&&(h.trace=!0,s.tracing.tracePromise((()=>r),h).catch((()=>{}))),r}async#X(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:n=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:y,signal:A}=e;if(y&&(y.op="fetch",y.key=t,b&&(y.forceRefresh=!0)),!this.#A)return y&&(y.fetch="get"),this.#N(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:h,status:y});let O={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:h,ttl:r,noDisposeOnSet:l,size:n,sizeCalculation:u,noUpdateTTL:g,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:_,ignoreFetchAbort:w,status:y,signal:A},x=this.#u.get(t);if(x===void 0){y&&(y.fetch="miss");let e=this.#z(t,x,O,S);return e.__returned=e}else{let e=this.#f[x];if(this.#T(e)){let t=i&&e.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",t&&(y.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}let h=this.#D(x);if(!b&&!h)return y&&(y.fetch="hit"),this.#E(x),s&&this.#j(x),y&&this.#U(y,x),e;let r=this.#z(t,x,O,S),l=r.__staleWhileFetching!==void 0&&i;return y&&(y.fetch=h?"stale":"refresh",l&&h&&(y.returnedStale=!0)),l?r.__staleWhileFetching:r.__returned=r}}forceFetch(t,e={}){let i=s.tracing.hasSubscribers,{status:h=(D()?{}:void 0)}=e;e.status=h,h&&e.context&&(h.context=e.context);let r=this.#J(t,e);return h&&D()&&i&&(h.trace=!0,s.tracing.tracePromise((()=>r),h).catch((()=>{}))),r}async#J(t,e={}){let i=await this.#X(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=(s.metrics.hasSubscribers?{}:void 0)}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context));let h=this.#K(t,e);return i&&(i.value=h),s.metrics.hasSubscribers&&s.metrics.publish(i),h}#K(t,e={}){let i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:h,forceRefresh:r,...l}=e;h&&r&&(h.forceRefresh=!0);let n=this.#N(t,l),u=r||n===void 0;if(h&&(h.memo=u?"miss":"hit",u||(h.value=n)),!u)return n;let g=i(t,n,{options:l,context:s});return h&&(h.value=g),this.#$(t,g,l),g}get(t,e={}){let{status:i=(s.metrics.hasSubscribers?{}:void 0)}=e;e.status=i,i&&(i.op="get",i.key=t);let h=this.#N(t,e);return i&&(h!==void 0&&(i.value=h),s.metrics.hasSubscribers&&s.metrics.publish(i)),h}#N(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,status:r}=e,l=this.#u.get(t);if(l===void 0){r&&(r.get="miss");return}let n=this.#f[l],u=this.#T(n);return r&&this.#U(r,l),this.#D(l)?u?(r&&(r.get="stale-fetching"),i&&n.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),n.__staleWhileFetching):void 0):(h||this.#G(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),n):void 0):(r&&(r.get=u?"fetching":"hit"),this.#E(l),s&&this.#j(l),u?n.__staleWhileFetching:n)}#Q(t,e){this.#p[e]=t,this.#d[t]=e}#E(t){t!==this.#v&&(t===this.#g?this.#g=this.#d[t]:this.#Q(this.#p[t],this.#d[t]),this.#Q(this.#v,t),this.#v=t)}delete(t){return this.#G(t,"delete")}#G(t,e){s.metrics.hasSubscribers&&s.metrics.publish({op:"delete",delete:e,key:t});let i=!1;if(this.#n!==0){let s=this.#u.get(t);if(s!==void 0)if(this.#y?.[s]&&(clearTimeout(this.#y?.[s]),this.#y[s]=void 0),i=!0,this.#n===1)this.#Y(e);else{this.#M(s);let i=this.#f[s];if(this.#T(i)?i.__abortController.abort(new Error("deleted")):(this.#F||this.#O)&&(this.#F&&this.#i?.(i,t,e),this.#O&&this.#w?.push([i,t,e])),this.#u.delete(t),this.#c[s]=void 0,this.#f[s]=void 0,s===this.#v)this.#v=this.#p[s];else if(s===this.#g)this.#g=this.#d[s];else{let t=this.#p[s];this.#d[t]=this.#d[s];let e=this.#d[s];this.#p[e]=this.#p[s]}this.#n--,this.#m.push(s)}}if(this.#O&&this.#w?.length){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}return i}clear(){return this.#Y("delete")}#Y(t){for(let e of this.#C({allowStale:!0})){let i=this.#f[e];if(this.#T(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#c[e];this.#F&&this.#i?.(i,s,t),this.#O&&this.#w?.push([i,s,t])}}if(this.#u.clear(),this.#f.fill(void 0),this.#c.fill(void 0),this.#b&&this.#S){this.#b.fill(0),this.#S.fill(0);for(let t of this.#y??[])t!==void 0&&clearTimeout(t);this.#y?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#g=0,this.#v=0,this.#m.length=0,this.#a=0,this.#n=0,this.#O&&this.#w){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}}};t.LRUCache=v}();module.exports=i})();
1
+ (()=>{"use strict";var t={714:t=>{t.exports=require("node:diagnostics_channel")}};var e={};function __nccwpck_require__(i){var s=e[i];if(s!==undefined){return s.exports}var h=e[i]={exports:{}};var r=true;try{t[i](h,h.exports,__nccwpck_require__);r=false}finally{if(r)delete e[i]}return h.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i={};(()=>{var t=i;var G=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var e=G((t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.tracing=t.metrics=void 0;var e=__nccwpck_require__(714);t.metrics=(0,e.channel)("lru-cache:metrics");t.tracing=(0,e.tracingChannel)("lru-cache")}));Object.defineProperty(t,"__esModule",{value:!0});t.LRUCache=void 0;var s=e(),D=()=>s.metrics.hasSubscribers||s.tracing.hasSubscribers,h=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,l=typeof process=="object"&&process?process:{},H=(t,e,i,s)=>{typeof l.emitWarning=="function"?l.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)},N=t=>!r.has(t),n=Symbol("type"),F=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),I=t=>F(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?u:null:null,u=class extends Array{constructor(t){super(t),this.fill(0)}},g=class c{heap;length;static#t=!1;static create(t){let e=I(t);if(!e)return[];c.#t=!0;let i=new c(t,e);return c.#t=!1,i}constructor(t,e){if(!c.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},v=class c{#t;#e;#i;#s;#h;#r;#o;#l;get perf(){return this.#l}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#a;#u;#c;#f;#d;#p;#g;#v;#m;#w;#_;#S;#b;#y;#F;#A;#O;#x;static unsafeExposeInternals(t){return{starts:t.#S,ttls:t.#b,autopurgeTimers:t.#y,sizes:t.#_,keyMap:t.#u,keyList:t.#c,valList:t.#f,next:t.#d,prev:t.#p,get head(){return t.#g},get tail(){return t.#v},free:t.#m,isBackgroundFetch:e=>t.#T(e),backgroundFetch:(e,i,s,h)=>t.#z(e,i,s,h),moveToTail:e=>t.#E(e),indexes:e=>t.#R(e),rindexes:e=>t.#C(e),isStale:e=>t.#D(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#a}get size(){return this.#n}get fetchMethod(){return this.#r}get memoMethod(){return this.#o}get dispose(){return this.#i}get onInsert(){return this.#s}get disposeAfter(){return this.#h}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:n,updateAgeOnHas:u,allowStale:v,dispose:m,onInsert:w,disposeAfter:_,noDisposeOnSet:S,noUpdateTTL:b,maxSize:y=0,maxEntrySize:A=0,sizeCalculation:O,fetchMethod:x,memoMethod:T,noDeleteOnFetchRejection:z,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:C,ignoreFetchAbort:W,perf:k}=t;if(k!==void 0&&typeof k?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#l=k??h,e!==0&&!F(e))throw new TypeError("max option must be a nonnegative integer");let L=e?I(e):Array;if(!L)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=y,this.maxEntrySize=A||this.#e,this.sizeCalculation=O,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=T,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#r=x,this.#A=!!x,this.#u=new Map,this.#c=Array.from({length:e}).fill(void 0),this.#f=Array.from({length:e}).fill(void 0),this.#d=new L(e),this.#p=new L(e),this.#g=0,this.#v=0,this.#m=g.create(e),this.#n=0,this.#a=0,typeof m=="function"&&(this.#i=m),typeof w=="function"&&(this.#s=w),typeof _=="function"?(this.#h=_,this.#w=[]):(this.#h=void 0,this.#w=void 0),this.#F=!!this.#i,this.#x=!!this.#s,this.#O=!!this.#h,this.noDisposeOnSet=!!S,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!z,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(this.#e!==0&&!F(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!F(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!v,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!u,this.ttlResolution=F(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!F(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let t="LRU_CACHE_UNBOUNDED";N(t)&&(r.add(t),H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,c))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#k(){let t=new u(this.#t),e=new u(this.#t);this.#b=t,this.#S=e;let i=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#y=i,this.#L=(i,h,r=this.#l.now())=>{e[i]=h!==0?r:0,t[i]=h,s(i,h)},this.#j=i=>{e[i]=t[i]!==0?this.#l.now():0,s(i,t[i])};let s=this.ttlAutopurge?(t,e)=>{if(i?.[t]&&(clearTimeout(i[t]),i[t]=void 0),e&&e!==0&&i){let s=setTimeout((()=>{this.#D(t)&&this.#G(this.#c[t],"expire")}),e+1);s.unref&&s.unref(),i[t]=s}}:()=>{};this.#U=(i,s)=>{if(t[s]){let r=t[s],l=e[s];if(!r||!l)return;i.ttl=r,i.start=l,i.now=h||o();let n=i.now-l;i.remainingTTL=r-n}};let h=0,o=()=>{let t=this.#l.now();if(this.ttlResolution>0){h=t;let e=setTimeout((()=>h=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{let s=this.#u.get(i);if(s===void 0)return 0;let r=t[s],l=e[s];if(!r||!l)return 1/0;let n=(h||o())-l;return r-n},this.#D=i=>{let s=e[i],r=t[i];return!!r&&!!s&&(h||o())-s>r}}#j=()=>{};#U=()=>{};#L=()=>{};#D=()=>!1;#W(){let t=new u(this.#t);this.#a=0,this.#_=t,this.#M=e=>{this.#a-=t[e],t[e]=0},this.#P=(t,e,i,s)=>{if(this.#T(e))return 0;if(!F(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(e,t),!F(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#q=(e,i,s)=>{if(t[e]=i,this.#e){let i=this.#e-t[e];for(;this.#a>i;)this.#I(!0)}this.#a+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#a)}}#M=t=>{};#q=(t,e,i)=>{};#P=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#R({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#v;this.#H(e)&&((t||!this.#D(e))&&(yield e),e!==this.#g);)e=this.#p[e]}*#C({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#g;this.#H(e)&&((t||!this.#D(e))&&(yield e),e!==this.#v);)e=this.#d[e]}#H(t){return t!==void 0&&this.#u.get(this.#c[t])===t}*entries(){for(let t of this.#R())this.#f[t]!==void 0&&this.#c[t]!==void 0&&!this.#T(this.#f[t])&&(yield[this.#c[t],this.#f[t]])}*rentries(){for(let t of this.#C())this.#f[t]!==void 0&&this.#c[t]!==void 0&&!this.#T(this.#f[t])&&(yield[this.#c[t],this.#f[t]])}*keys(){for(let t of this.#R()){let e=this.#c[t];e!==void 0&&!this.#T(this.#f[t])&&(yield e)}}*rkeys(){for(let t of this.#C()){let e=this.#c[t];e!==void 0&&!this.#T(this.#f[t])&&(yield e)}}*values(){for(let t of this.#R())this.#f[t]!==void 0&&!this.#T(this.#f[t])&&(yield this.#f[t])}*rvalues(){for(let t of this.#C())this.#f[t]!==void 0&&!this.#T(this.#f[t])&&(yield this.#f[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#R()){let s=this.#f[i],h=this.#T(s)?s.__staleWhileFetching:s;if(h!==void 0&&t(h,this.#c[i],this))return this.#N(this.#c[i],e)}}forEach(t,e=this){for(let i of this.#R()){let s=this.#f[i],h=this.#T(s)?s.__staleWhileFetching:s;h!==void 0&&t.call(e,h,this.#c[i],this)}}rforEach(t,e=this){for(let i of this.#C()){let s=this.#f[i],h=this.#T(s)?s.__staleWhileFetching:s;h!==void 0&&t.call(e,h,this.#c[i],this)}}purgeStale(){let t=!1;for(let e of this.#C({allowStale:!0}))this.#D(e)&&(this.#G(this.#c[e],"expire"),t=!0);return t}info(t){let e=this.#u.get(t);if(e===void 0)return;let i=this.#f[e],s=this.#T(i)?i.__staleWhileFetching:i;if(s===void 0)return;let h={value:s};if(this.#b&&this.#S){let t=this.#b[e],i=this.#S[e];if(t&&i){let e=t-(this.#l.now()-i);h.ttl=e,h.start=Date.now()}}return this.#_&&(h.size=this.#_[e]),h}dump(){let t=[];for(let e of this.#R({allowStale:!0})){let i=this.#c[e],s=this.#f[e],h=this.#T(s)?s.__staleWhileFetching:s;if(h===void 0||i===void 0)continue;let r={value:h};if(this.#b&&this.#S){r.ttl=this.#b[e];let t=this.#l.now()-this.#S[e];r.start=Math.floor(Date.now()-t)}this.#_&&(r.size=this.#_[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let t=Date.now()-i.start;i.start=this.#l.now()-t}this.#$(e,i.value,i)}}set(t,e,i={}){let{status:h=(s.metrics.hasSubscribers?{}:void 0)}=i;i.status=h,h&&(h.op="set",h.key=t,e!==void 0&&(h.value=e));let r=this.#$(t,e,i);return h&&s.metrics.hasSubscribers&&s.metrics.publish(h),r}#$(t,e,i={}){let{ttl:s=this.ttl,start:h,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:n}=i;if(e===void 0)return n&&(n.set="deleted"),this.delete(t),this;let{noUpdateTTL:u=this.noUpdateTTL}=i;n&&!this.#T(e)&&(n.value=e);let g=this.#P(t,e,i.size||0,l,n);if(this.maxEntrySize&&g>this.maxEntrySize)return this.#G(t,"set"),n&&(n.set="miss",n.maxEntrySizeExceeded=!0),this;let v=this.#n===0?void 0:this.#u.get(t);if(v===void 0)v=this.#n===0?this.#v:this.#m.length!==0?this.#m.pop():this.#n===this.#t?this.#I(!1):this.#n,this.#c[v]=t,this.#f[v]=e,this.#u.set(t,v),this.#d[this.#v]=v,this.#p[v]=this.#v,this.#v=v,this.#n++,this.#q(v,g,n),n&&(n.set="add"),u=!1,this.#x&&this.#s?.(e,t,"add");else{this.#E(v);let i=this.#f[v];if(e!==i){if(this.#A&&this.#T(i)){i.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:e}=i;e!==void 0&&!r&&(this.#F&&this.#i?.(e,t,"set"),this.#O&&this.#w?.push([e,t,"set"]))}else r||(this.#F&&this.#i?.(i,t,"set"),this.#O&&this.#w?.push([i,t,"set"]));if(this.#M(v),this.#q(v,g,n),this.#f[v]=e,n){n.set="replace";let t=i&&this.#T(i)?i.__staleWhileFetching:i;t!==void 0&&(n.oldValue=t)}}else n&&(n.set="update");this.#x&&this.onInsert?.(e,t,e===i?"update":"replace")}if(s!==0&&!this.#b&&this.#k(),this.#b&&(u||this.#L(v,s,h),n&&this.#U(n,v)),!r&&this.#O&&this.#w){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}return this}pop(){try{for(;this.#n;){let t=this.#f[this.#g];if(this.#I(!0),this.#T(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#O&&this.#w){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}}}#I(t){let e=this.#g,i=this.#c[e],s=this.#f[e];return this.#A&&this.#T(s)?s.__abortController.abort(new Error("evicted")):(this.#F||this.#O)&&(this.#F&&this.#i?.(s,i,"evict"),this.#O&&this.#w?.push([s,i,"evict"])),this.#M(e),this.#y?.[e]&&(clearTimeout(this.#y[e]),this.#y[e]=void 0),t&&(this.#c[e]=void 0,this.#f[e]=void 0,this.#m.push(e)),this.#n===1?(this.#g=this.#v=0,this.#m.length=0):this.#g=this.#d[e],this.#u.delete(i),this.#n--,e}has(t,e={}){let{status:i=(s.metrics.hasSubscribers?{}:void 0)}=e;e.status=i,i&&(i.op="has",i.key=t);let h=this.#B(t,e);return s.metrics.hasSubscribers&&s.metrics.publish(i),h}#B(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,h=this.#u.get(t);if(h!==void 0){let t=this.#f[h];if(this.#T(t)&&t.__staleWhileFetching===void 0)return!1;if(this.#D(h))s&&(s.has="stale",this.#U(s,h));else return i&&this.#j(h),s&&(s.has="hit",this.#U(s,h)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=(D()?{}:void 0)}=e;i&&(i.op="peek",i.key=t),e.status=i;let h=this.#V(t,e);return s.metrics.hasSubscribers&&s.metrics.publish(i),h}#V(t,e){let{status:i,allowStale:s=this.allowStale}=e,h=this.#u.get(t);if(h===void 0||!s&&this.#D(h)){i&&(i.peek=h===void 0?"miss":"stale");return}let r=this.#f[h],l=this.#T(r)?r.__staleWhileFetching:r;return i&&(l!==void 0?(i.peek="hit",i.value=l):i.peek="miss"),l}#z(t,e,i,s){let h=e===void 0?void 0:this.#f[e];if(this.#T(h))return h;let r=new AbortController,{signal:l}=i;l?.addEventListener("abort",(()=>r.abort(l.reason)),{signal:r.signal});let n={signal:r.signal,options:i,context:s},a=(s,h=!1)=>{let{aborted:l}=r.signal,g=i.ignoreFetchAbort&&s!==void 0,v=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&s!==void 0);if(i.status&&(l&&!h?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,g&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!g&&!h)return f(r.signal.reason,v);let m=u,w=this.#f[e];return(w===u||w===void 0&&g&&h)&&(s===void 0?m.__staleWhileFetching!==void 0?this.#f[e]=m.__staleWhileFetching:this.#G(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#$(t,s,n.options))),s},d=t=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=t),f(t,!1)),f=(s,h)=>{let{aborted:l}=r.signal,n=l&&i.allowStaleOnFetchAbort,g=n||i.allowStaleOnFetchRejection,v=g||i.noDeleteOnFetchRejection,m=u;if(this.#f[e]===u&&(!v||!h&&m.__staleWhileFetching===void 0?this.#G(t,"fetch"):n||(this.#f[e]=m.__staleWhileFetching)),g)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw s},p=(e,s)=>{let l=this.#r?.(t,h,n);l&&l instanceof Promise&&l.then((t=>e(t===void 0?void 0:t)),s),r.signal.addEventListener("abort",(()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(e(void 0),i.allowStaleOnFetchAbort&&(e=t=>a(t,!0)))}))};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(p).then(a,d),g=Object.assign(u,{__abortController:r,__staleWhileFetching:h,__returned:void 0});return e===void 0?(this.#$(t,g,{...n.options,status:void 0}),e=this.#u.get(t)):this.#f[e]=g,g}#T(t){if(!this.#A)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=s.tracing.hasSubscribers,{status:h=(D()?{}:void 0)}=e;e.status=h,h&&e.context&&(h.context=e.context);let r=this.#X(t,e);return h&&D()&&i&&(h.trace=!0,s.tracing.tracePromise((()=>r),h).catch((()=>{}))),r}async#X(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:n=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:w=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:S,forceRefresh:b=!1,status:y,signal:A}=e;if(y&&(y.op="fetch",y.key=t,b&&(y.forceRefresh=!0)),!this.#A)return y&&(y.fetch="get"),this.#N(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:h,status:y});let O={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:h,ttl:r,noDisposeOnSet:l,size:n,sizeCalculation:u,noUpdateTTL:g,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:_,ignoreFetchAbort:w,status:y,signal:A},x=this.#u.get(t);if(x===void 0){y&&(y.fetch="miss");let e=this.#z(t,x,O,S);return e.__returned=e}else{let e=this.#f[x];if(this.#T(e)){let t=i&&e.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",t&&(y.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}let h=this.#D(x);if(!b&&!h)return y&&(y.fetch="hit"),this.#E(x),s&&this.#j(x),y&&this.#U(y,x),e;let r=this.#z(t,x,O,S),l=r.__staleWhileFetching!==void 0&&i;return y&&(y.fetch=h?"stale":"refresh",l&&h&&(y.returnedStale=!0)),l?r.__staleWhileFetching:r.__returned=r}}forceFetch(t,e={}){let i=s.tracing.hasSubscribers,{status:h=(D()?{}:void 0)}=e;e.status=h,h&&e.context&&(h.context=e.context);let r=this.#J(t,e);return h&&D()&&i&&(h.trace=!0,s.tracing.tracePromise((()=>r),h).catch((()=>{}))),r}async#J(t,e={}){let i=await this.#X(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=(s.metrics.hasSubscribers?{}:void 0)}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context));let h=this.#K(t,e);return i&&(i.value=h),s.metrics.hasSubscribers&&s.metrics.publish(i),h}#K(t,e={}){let i=this.#o;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:h,forceRefresh:r,...l}=e;h&&r&&(h.forceRefresh=!0);let n=this.#N(t,l),u=r||n===void 0;if(h&&(h.memo=u?"miss":"hit",u||(h.value=n)),!u)return n;let g=i(t,n,{options:l,context:s});return h&&(h.value=g),this.#$(t,g,l),g}get(t,e={}){let{status:i=(s.metrics.hasSubscribers?{}:void 0)}=e;e.status=i,i&&(i.op="get",i.key=t);let h=this.#N(t,e);return i&&(h!==void 0&&(i.value=h),s.metrics.hasSubscribers&&s.metrics.publish(i)),h}#N(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:h=this.noDeleteOnStaleGet,status:r}=e,l=this.#u.get(t);if(l===void 0){r&&(r.get="miss");return}let n=this.#f[l],u=this.#T(n);return r&&this.#U(r,l),this.#D(l)?u?(r&&(r.get="stale-fetching"),i&&n.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),n.__staleWhileFetching):void 0):(h||this.#G(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),n):void 0):(r&&(r.get=u?"fetching":"hit"),this.#E(l),s&&this.#j(l),u?n.__staleWhileFetching:n)}#Q(t,e){this.#p[e]=t,this.#d[t]=e}#E(t){t!==this.#v&&(t===this.#g?this.#g=this.#d[t]:this.#Q(this.#p[t],this.#d[t]),this.#Q(this.#v,t),this.#v=t)}delete(t){return this.#G(t,"delete")}#G(t,e){s.metrics.hasSubscribers&&s.metrics.publish({op:"delete",delete:e,key:t});let i=!1;if(this.#n!==0){let s=this.#u.get(t);if(s!==void 0)if(this.#y?.[s]&&(clearTimeout(this.#y?.[s]),this.#y[s]=void 0),i=!0,this.#n===1)this.#Y(e);else{this.#M(s);let i=this.#f[s];if(this.#T(i)?i.__abortController.abort(new Error("deleted")):(this.#F||this.#O)&&(this.#F&&this.#i?.(i,t,e),this.#O&&this.#w?.push([i,t,e])),this.#u.delete(t),this.#c[s]=void 0,this.#f[s]=void 0,s===this.#v)this.#v=this.#p[s];else if(s===this.#g)this.#g=this.#d[s];else{let t=this.#p[s];this.#d[t]=this.#d[s];let e=this.#d[s];this.#p[e]=this.#p[s]}this.#n--,this.#m.push(s)}}if(this.#O&&this.#w?.length){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}return i}clear(){return this.#Y("delete")}#Y(t){for(let e of this.#C({allowStale:!0})){let i=this.#f[e];if(this.#T(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#c[e];this.#F&&this.#i?.(i,s,t),this.#O&&this.#w?.push([i,s,t])}}if(this.#u.clear(),this.#f.fill(void 0),this.#c.fill(void 0),this.#b&&this.#S){this.#b.fill(0),this.#S.fill(0);for(let t of this.#y??[])t!==void 0&&clearTimeout(t);this.#y?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#g=0,this.#v=0,this.#m.length=0,this.#a=0,this.#n=0,this.#O&&this.#w){let t=this.#w,e;for(;e=t?.shift();)this.#h?.(...e)}}};t.LRUCache=v})();module.exports=i})();
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-04-20T10:43:49.430Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-04-23T22:20:40.701Z"}
@@ -1 +1 @@
1
- (function(){var e={363:function(e,t,n){let r={};r["__wbindgen_placeholder__"]=e.exports;let o;const{TextDecoder:i,TextEncoder:a}=n(837);let s=new i("utf-8",{ignoreBOM:true,fatal:true});s.decode();let _=null;function getUint8Memory0(){if(_===null||_.buffer!==o.memory.buffer){_=new Uint8Array(o.memory.buffer)}return _}function getStringFromWasm0(e,t){return s.decode(getUint8Memory0().subarray(e,e+t))}const c=new Array(32).fill(undefined);c.push(undefined,null,true,false);let u=c.length;function addHeapObject(e){if(u===c.length)c.push(c.length+1);const t=u;u=c[t];c[t]=e;return t}function getObject(e){return c[e]}function dropObject(e){if(e<36)return;c[e]=u;u=e}function takeObject(e){const t=getObject(e);dropObject(e);return t}let f=0;let d=new a("utf-8");const l=typeof d.encodeInto==="function"?function(e,t){return d.encodeInto(e,t)}:function(e,t){const n=d.encode(e);t.set(n);return{read:e.length,written:n.length}};function passStringToWasm0(e,t,n){if(n===undefined){const n=d.encode(e);const r=t(n.length);getUint8Memory0().subarray(r,r+n.length).set(n);f=n.length;return r}let r=e.length;let o=t(r);const i=getUint8Memory0();let a=0;for(;a<r;a++){const t=e.charCodeAt(a);if(t>127)break;i[o+a]=t}if(a!==r){if(a!==0){e=e.slice(a)}o=n(o,r,r=a+e.length*3);const t=getUint8Memory0().subarray(o+a,o+r);const i=l(e,t);a+=i.written}f=a;return o}let w=null;function getInt32Memory0(){if(w===null||w.buffer!==o.memory.buffer){w=new Int32Array(o.memory.buffer)}return w}function isLikeNone(e){return e===undefined||e===null}const g=new Uint32Array(2);const m=new BigUint64Array(g.buffer);function notDefined(e){return()=>{throw new Error(`${e} is not defined`)}}class Snowflake{static __wrap(e){const t=Object.create(Snowflake.prototype);t.ptr=e;return t}__destroy_into_raw(){const e=this.ptr;this.ptr=0;return e}free(){const e=this.__destroy_into_raw();o.__wbg_snowflake_free(e)}constructor(e){try{const i=o.__wbindgen_add_to_stack_pointer(-16);o.snowflake_new(i,isLikeNone(e)?0:addHeapObject(e));var t=getInt32Memory0()[i/4+0];var n=getInt32Memory0()[i/4+1];var r=getInt32Memory0()[i/4+2];if(r){throw takeObject(n)}return Snowflake.__wrap(t)}finally{o.__wbindgen_add_to_stack_pointer(16)}}getUniqueID(){try{const n=o.__wbindgen_add_to_stack_pointer(-16);o.snowflake_getUniqueID(n,this.ptr);var e=getInt32Memory0()[n/4+0];var t=getInt32Memory0()[n/4+1];g[0]=e;g[1]=t;const r=m[0];return r}finally{o.__wbindgen_add_to_stack_pointer(16)}}idFromTimestamp(e){try{const r=o.__wbindgen_add_to_stack_pointer(-16);o.snowflake_idFromTimestamp(r,this.ptr,e);var t=getInt32Memory0()[r/4+0];var n=getInt32Memory0()[r/4+1];g[0]=t;g[1]=n;const i=m[0];return i}finally{o.__wbindgen_add_to_stack_pointer(16)}}instanceID(){var e=o.snowflake_instanceID(this.ptr);return e}customEpoch(){var e=o.snowflake_customEpoch(this.ptr);return e}static timestampFromID(e,t){m[0]=e;const n=g[0];const r=g[1];var i=o.snowflake_timestampFromID(n,r,t);return i}static instanceIDFromID(e){m[0]=e;const t=g[0];const n=g[1];var r=o.snowflake_instanceIDFromID(t,n);return r}}e.exports.Snowflake=Snowflake;e.exports.__wbindgen_string_new=function(e,t){var n=getStringFromWasm0(e,t);return addHeapObject(n)};e.exports.__wbindgen_object_drop_ref=function(e){takeObject(e)};e.exports.__wbindgen_json_serialize=function(e,t){const n=getObject(t);var r=JSON.stringify(n===undefined?null:n);var i=passStringToWasm0(r,o.__wbindgen_malloc,o.__wbindgen_realloc);var a=f;getInt32Memory0()[e/4+1]=a;getInt32Memory0()[e/4+0]=i};e.exports.__wbg_now_e6c39c10a5e8aec7=function(){var e=Date.now();return e};e.exports.__wbg_random_7b8246250fd79f60=typeof Math.random=="function"?Math.random:notDefined("Math.random");e.exports.__wbindgen_throw=function(e,t){throw new Error(getStringFromWasm0(e,t))};const p=n.ab+"nodejs_snowflake_bg.wasm";const b=n(147).readFileSync(n.ab+"nodejs_snowflake_bg.wasm");const y=new WebAssembly.Module(b);const k=new WebAssembly.Instance(y,r);o=k.exports;e.exports.__wasm=o},147:function(e){"use strict";e.exports=require("fs")},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var i=true;try{e[n](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(363);module.exports=n})();
1
+ (()=>{var e={363:(e,t,n)=>{let r={};r["__wbindgen_placeholder__"]=e.exports;let o;const{TextDecoder:a,TextEncoder:i}=n(837);let s=new a("utf-8",{ignoreBOM:true,fatal:true});s.decode();let _=null;function getUint8Memory0(){if(_===null||_.buffer!==o.memory.buffer){_=new Uint8Array(o.memory.buffer)}return _}function getStringFromWasm0(e,t){return s.decode(getUint8Memory0().subarray(e,e+t))}const c=new Array(32).fill(undefined);c.push(undefined,null,true,false);let u=c.length;function addHeapObject(e){if(u===c.length)c.push(c.length+1);const t=u;u=c[t];c[t]=e;return t}function getObject(e){return c[e]}function dropObject(e){if(e<36)return;c[e]=u;u=e}function takeObject(e){const t=getObject(e);dropObject(e);return t}let f=0;let d=new i("utf-8");const l=typeof d.encodeInto==="function"?function(e,t){return d.encodeInto(e,t)}:function(e,t){const n=d.encode(e);t.set(n);return{read:e.length,written:n.length}};function passStringToWasm0(e,t,n){if(n===undefined){const n=d.encode(e);const r=t(n.length);getUint8Memory0().subarray(r,r+n.length).set(n);f=n.length;return r}let r=e.length;let o=t(r);const a=getUint8Memory0();let i=0;for(;i<r;i++){const t=e.charCodeAt(i);if(t>127)break;a[o+i]=t}if(i!==r){if(i!==0){e=e.slice(i)}o=n(o,r,r=i+e.length*3);const t=getUint8Memory0().subarray(o+i,o+r);const a=l(e,t);i+=a.written}f=i;return o}let w=null;function getInt32Memory0(){if(w===null||w.buffer!==o.memory.buffer){w=new Int32Array(o.memory.buffer)}return w}function isLikeNone(e){return e===undefined||e===null}const g=new Uint32Array(2);const m=new BigUint64Array(g.buffer);function notDefined(e){return()=>{throw new Error(`${e} is not defined`)}}class Snowflake{static __wrap(e){const t=Object.create(Snowflake.prototype);t.ptr=e;return t}__destroy_into_raw(){const e=this.ptr;this.ptr=0;return e}free(){const e=this.__destroy_into_raw();o.__wbg_snowflake_free(e)}constructor(e){try{const a=o.__wbindgen_add_to_stack_pointer(-16);o.snowflake_new(a,isLikeNone(e)?0:addHeapObject(e));var t=getInt32Memory0()[a/4+0];var n=getInt32Memory0()[a/4+1];var r=getInt32Memory0()[a/4+2];if(r){throw takeObject(n)}return Snowflake.__wrap(t)}finally{o.__wbindgen_add_to_stack_pointer(16)}}getUniqueID(){try{const n=o.__wbindgen_add_to_stack_pointer(-16);o.snowflake_getUniqueID(n,this.ptr);var e=getInt32Memory0()[n/4+0];var t=getInt32Memory0()[n/4+1];g[0]=e;g[1]=t;const r=m[0];return r}finally{o.__wbindgen_add_to_stack_pointer(16)}}idFromTimestamp(e){try{const r=o.__wbindgen_add_to_stack_pointer(-16);o.snowflake_idFromTimestamp(r,this.ptr,e);var t=getInt32Memory0()[r/4+0];var n=getInt32Memory0()[r/4+1];g[0]=t;g[1]=n;const a=m[0];return a}finally{o.__wbindgen_add_to_stack_pointer(16)}}instanceID(){var e=o.snowflake_instanceID(this.ptr);return e}customEpoch(){var e=o.snowflake_customEpoch(this.ptr);return e}static timestampFromID(e,t){m[0]=e;const n=g[0];const r=g[1];var a=o.snowflake_timestampFromID(n,r,t);return a}static instanceIDFromID(e){m[0]=e;const t=g[0];const n=g[1];var r=o.snowflake_instanceIDFromID(t,n);return r}}e.exports.Snowflake=Snowflake;e.exports.__wbindgen_string_new=function(e,t){var n=getStringFromWasm0(e,t);return addHeapObject(n)};e.exports.__wbindgen_object_drop_ref=function(e){takeObject(e)};e.exports.__wbindgen_json_serialize=function(e,t){const n=getObject(t);var r=JSON.stringify(n===undefined?null:n);var a=passStringToWasm0(r,o.__wbindgen_malloc,o.__wbindgen_realloc);var i=f;getInt32Memory0()[e/4+1]=i;getInt32Memory0()[e/4+0]=a};e.exports.__wbg_now_e6c39c10a5e8aec7=function(){var e=Date.now();return e};e.exports.__wbg_random_7b8246250fd79f60=typeof Math.random=="function"?Math.random:notDefined("Math.random");e.exports.__wbindgen_throw=function(e,t){throw new Error(getStringFromWasm0(e,t))};const p=n.ab+"nodejs_snowflake_bg.wasm";const b=n(147).readFileSync(n.ab+"nodejs_snowflake_bg.wasm");const y=new WebAssembly.Module(b);const k=new WebAssembly.Instance(y,r);o=k.exports;e.exports.__wasm=o},147:e=>{"use strict";e.exports=require("fs")},837:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var a=true;try{e[n](o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete t[n]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(363);module.exports=n})();
@@ -1 +1 @@
1
- {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-04-20T10:43:49.257Z"}
1
+ {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2026-04-23T22:20:40.527Z"}
@@ -376,7 +376,6 @@ class PluginWorkflowServer extends import_server.Plugin {
376
376
  actions: ["workflows:list"]
377
377
  });
378
378
  this.app.acl.allow("userWorkflowTasks", "listMine", "loggedIn");
379
- this.app.acl.allow("*", ["trigger"], "loggedIn");
380
379
  db.on("workflows.beforeSave", this.onBeforeSave);
381
380
  db.on("workflows.afterCreate", this.onAfterCreate);
382
381
  db.on("workflows.afterUpdate", this.onAfterUpdate);
@@ -16,7 +16,15 @@ export interface IJob {
16
16
  result?: unknown;
17
17
  [key: string]: unknown;
18
18
  }
19
- export type InstructionResult = IJob | Promise<IJob> | Promise<void> | null | void;
19
+ /**
20
+ * The result of an instruction execution.
21
+ *
22
+ * Different type of result will cause according behavior in the workflow engine:
23
+ * 1. IJob | Promise<IJob>: processor will continue default processing by checking the status.
24
+ * 2. `null` | Promise<null>: processor will do exit process.
25
+ * 3. `void` | Promise<void>: processor will do nothing, and terminate the current execution without any action.
26
+ */
27
+ export type InstructionResult = IJob | Promise<IJob> | Promise<void> | Promise<null> | null | void;
20
28
  export type Runner = (node: FlowNodeModel, input: any, processor: Processor) => InstructionResult;
21
29
  export type InstructionInterface = {
22
30
  run: Runner;
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
7
7
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
8
8
  "description.ru-RU": "Мощный инструмент BPM, обеспечивающий базовую поддержку автоматизации бизнес-процессов с возможностью неограниченного расширения триггеров и узлов.",
9
- "version": "2.1.0-alpha.20",
9
+ "version": "2.1.0-alpha.21",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -49,7 +49,7 @@
49
49
  "@nocobase/test": "2.x",
50
50
  "@nocobase/utils": "2.x"
51
51
  },
52
- "gitHead": "3d1535db6bf93ca23257faf474afee0d565f54c6",
52
+ "gitHead": "b4c2b469f321ecaec7863a8ae371a02fe6a35aa2",
53
53
  "keywords": [
54
54
  "Workflow"
55
55
  ]
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["214"],{4421:function(e,t,n){n.d(t,{d:function(){return a}});var o=n(9155),r=n.n(o),c=n(5953),i=n(4442),l=n(3342),u=n(6072),a=function(){var e=(0,c.useTranslation)().t,t=(0,l.useRecord)().id,n=(0,l.useActionContext)().setVisible;return r().createElement(i.Link,{to:(0,u.mz)(t),onClick:function(){return n(!1)}},e("View"))}},2662:function(e,t,n){n.d(t,{Qg:function(){return d},lP:function(){return f},t_:function(){return m}});var o=n(9155),r=n.n(o),c=n(2059),i=n(7375),l=n(5953),u=n(3342),a=n(7428),s=n(3872);function p(){var e,t,n=(e=["\n display: flex;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return p=function(){return n},n}function f(e){var t,n=(0,u.useCompile)()(e.label),o=(null!=(t=a.$Y[e.value])?t:{}).color;return r().createElement(c.Tag,{color:o,closable:e.closable,onClose:e.onClose},n)}function d(e){var t=(0,u.useCompile)();return r().createElement(r().Fragment,null,r().createElement(f,e.data),e.data.description?r().createElement("span",null,t(e.data.description)):null)}function m(e){var t=(0,l.useTranslation)().t,n=(0,u.useResourceActionContext)().refresh,a=(0,u.useResourceContext)().resource,f=(0,u.useRecord)(),d=(0,o.useCallback)(function(){c.Modal.confirm({title:(0,s.vV)("Cancel the execution"),icon:r().createElement(i.ExclamationCircleFilled,null),content:(0,s.vV)("Are you sure you want to cancel the execution?"),onOk:function(){a.cancel({filterByTk:f.id}).then(function(){c.message.success(t("Operation succeeded")),n()}).catch(function(e){console.error(e.data.error)})}})},[f]);return r().createElement("div",{className:(0,u.css)(p())},e.children,f.status?null:r().createElement(c.Tooltip,{title:(0,s.vV)("Cancel the execution")},r().createElement(c.Button,{type:"link",danger:!0,onClick:d,shape:"circle",size:"small",icon:r().createElement(i.StopOutlined,null)})))}},6481:function(e,t,n){n.d(t,{M:function(){return x}});var o,r=n(9155),c=n.n(r),i=n(4442),l=n(5953),u=n(2059),a=n(3342),s=n(6358),p=n(7428),f=n(3872),d=n(6072);function m(e,t,n,o,r,c,i){try{var l=e[c](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(o,r)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x={type:"void",name:"executionHistoryDrawer",title:'{{t("Execution history", { ns: "'.concat(f.CU,'" })}}'),"x-component":"Action.Drawer",properties:{content:{type:"void","x-decorator":"ExecutionResourceProvider","x-decorator-props":{collection:s.A,resourceName:"executions",request:{resource:"executions",action:"list",params:{appends:["workflow.id","workflow.title"],pageSize:20,sort:["-createdAt"],except:["context","output"],filter:{}}}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useResourceFilterActionProps","x-component-props":{icon:"FilterOutlined",nonfilterable:["workflow"]},"x-align":"left",default:{$and:[{status:{$eq:void 0}}]}},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},clear:{type:"void",title:'{{t("Clear")}}',"x-component":"Action","x-component-props":{useAction:function(){var e=(0,l.useTranslation)().t,t=(0,a.useResourceActionContext)(),n=t.refresh,o=t.defaultRequest,r=(0,a.useResourceContext)().resource,c=(0,a.useActionContext)().setVisible;return{run:function(){var t;return(t=function(){var t;return function(e,t){var n,o,r,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,o=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){c.label=a[1];break}if(6===a[0]&&c.label<r[1]){c.label=r[1],r=a;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(a);break}r[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return[4,r.destroy({filter:null==(t=o.params)?void 0:t.filter})];case 1:return i.sent(),u.message.success(e("Operation succeeded")),n(),c(!1),[2]}})},function(){var e=this,n=arguments;return new Promise(function(o,r){var c=t.apply(e,n);function i(e){m(c,o,r,i,l,"next",e)}function l(e){m(c,o,r,i,l,"throw",e)}i(void 0)})})()}}},confirm:{title:'{{t("Clear all executions", { ns: "'.concat(f.CU,'" })}}'),content:'{{t("Clear executions will not reset executed count, and started executions will not be deleted, are you sure you want to delete them all?", { ns: "'.concat(f.CU,'" })}}')}}}}},table:{type:"void","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}"},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},createdAt:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{createdAt:{type:"string","x-component":"CollectionField","x-component-props":{showTime:!0},"x-read-pretty":!0}}},workflowId:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Version", { ns: "'.concat(f.CU,'" })}}'),properties:{workflowId:(v(o={type:"number"},"x-component",function(e){var t=e.value,n=(0,a.useActionContext)().setVisible;return c().createElement(i.Link,{to:(0,d.Yz)(t),onClick:function(){return n(!1)}},"#".concat(t))}),v(o,"x-read-pretty",!0),o)}},status:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{t("Status", { ns: "'.concat(f.CU,'" })}}'),properties:{status:{type:"number","x-decorator":"ExecutionStatusColumn","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{link:{type:"void","x-component":"ExecutionLink"},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"},"x-reactions":[{dependencies:["..status"],fulfill:{state:{visible:"{{ $deps[0] !== ".concat(p.GO.STARTED," }}")}}}]}}}}}}}}}}}},512:function(e,t,n){n.d(t,{t:function(){return c}});var o=n(3342);function r(e,t,n,o,r,c,i){try{var l=e[c](i),u=l.value}catch(e){n(e);return}l.done?t(u):Promise.resolve(u).then(o,r)}function c(){var e=(0,o.useResourceActionContext)();return{onClick:function(){var t;return(t=function(){var t;return function(e,t){var n,o,r,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:u(0)}),l(i,"throw",{value:u(1)}),l(i,"return",{value:u(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function u(l){return function(u){var a=[l,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,o=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){c.label=a[1];break}if(6===a[0]&&c.label<r[1]){c.label=r[1],r=a;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(a);break}r[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(n){return null==e||null==(t=e.refresh)||t.call(e),[2]})},function(){var e=this,n=arguments;return new Promise(function(o,c){var i=t.apply(e,n);function l(e){r(i,o,c,l,u,"next",e)}function u(e){r(i,o,c,l,u,"throw",e)}l(void 0)})})()}}}},2815:function(e,t,n){n.d(t,{A:function(){return r}});var o=n(3342),r=function(){var e,t,n=(0,o.useResourceContext)().collection,r=(0,o.useFilterFieldOptions)(n.fields),c=(0,o.useResourceActionContext)();return(0,o.useFilterFieldProps)({options:r,params:(null==(t=c.state)||null==(e=t.params)?void 0:e[0])||c.params,service:c})}}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["261"],{7924:function(e,t,r){r.r(t),r.d(t,{WorkflowPane:function(){return eb}});var o,n,i=r(9155),c=r.n(i),a=r(2059),l=r(9452),u=r(5230),s=r(3342),p=r(4421);function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var f=function(e){var t,r=e.request,o=(e.filter,function(e,t){if(null==e)return{};var r,o,n,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(n=0,r=Reflect.ownKeys(Object(e));n<r.length;n++)o=r[n],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);return i}if(i=function(e,t){if(null==e)return{};var r,o,n={},i=Object.getOwnPropertyNames(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}(e,t),Object.getOwnPropertySymbols)for(n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)o=r[n],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);return i}(e,["request","filter"])),n=(0,s.useRecord)(),i=d(m({},o),{request:d(m({},r),{params:d(m({},null==r?void 0:r.params),{filter:d(m({},null==r||null==(t=r.params)?void 0:t.filter),{key:n.key})})})});return c().createElement(s.ResourceActionProvider,i)},y=r(5953),b=r(4442),v=r(6072),g=function(){var e=(0,y.useTranslation)().t,t=(0,s.useRecord)().id,r=(0,s.useActionContext)().setVisible,o=(0,s.useGetAriaLabelOfAction)("Configure").getAriaLabel;return c().createElement(b.Link,{"aria-label":o(),to:(0,v.Yz)(t),onClick:function(){return r(!1)}},e("Configure"))};function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function h(e){var t,r,o,n=e.component,a=e.children,l=function(e,t){if(null==e)return{};var r,o,n,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(n=0,r=Reflect.ownKeys(Object(e));n<r.length;n++)o=r[n],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);return i}if(i=function(e,t){if(null==e)return{};var r,o,n={},i=Object.getOwnPropertyNames(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}(e,t),Object.getOwnPropertySymbols)for(n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)o=r[n],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);return i}(e,["component","children"]),p=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(!1))||function(e){var t,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(n.push(t.value),2!==n.length);i=!0);}catch(e){c=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(c)throw r}}return n}}(t)||function(e){if(e){if("string"==typeof e)return x(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return x(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),m=p[0],d=p[1],f=(0,u.useFieldSchema)();return c().createElement(s.ActionContextProvider,{value:{visible:m,setVisible:d,fieldSchema:f}},c().createElement(void 0===n?"div":n,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},l),o=o={onClick:function(){d(!0)}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r),a),c().createElement(s.SchemaComponent,{schema:f,onlyRenderProperties:!0}))}var O=r(3872),w=r(6481),C=r(7428),A=r(5827),S=r(2662);function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var j={title:{"x-component":"CollectionField","x-decorator":"FormItem"},type:{"x-decorator":"FormItem",title:'{{t("Trigger type", { ns: "'.concat(O.CU,'" })}}'),"x-component":"Select","x-component-props":{optionRender:"{{TriggerOptionRender}}",popupMatchSelectWidth:!0,listHeight:300},enum:"{{useTriggersOptions()}}",required:!0},sync:{type:"boolean",title:'{{ t("Execute mode", { ns: "'.concat(O.CU,'" }) }}'),description:'{{ t("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"SyncOptionSelect","x-component-props":{options:[{label:'{{ t("Asynchronously", { ns: "'.concat(O.CU,'" }) }}'),value:!1,tooltip:'{{ t("Will be executed in the background as a queued task.", { ns: "'.concat(O.CU,'" }) }}')},{label:'{{ t("Synchronously", { ns: "'.concat(O.CU,'" }) }}'),value:!0,tooltip:'{{ t("For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.", { ns: "'.concat(O.CU,'" }) }}')}]}},triggerPreset:{type:"void","x-component":"TriggerPresetFieldset"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},categories:{type:"array",title:'{{ t("Category", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"CollectionField","x-collection-field":"workflows.categories"},options:{type:"object","x-decorator":"FormItem","x-component":"Fieldset",properties:{deleteExecutionOnStatus:{type:"array",title:'{{ t("Auto delete history when execution is on end status", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0,optionRender:S.Qg,tagRender:S.lP},enum:C.$A.filter(function(e){return!!e.value})},stackLimit:{type:"number",title:'{{ t("Maximum number of cycling triggers", { ns: "'.concat(O.CU,'" }) }}'),description:'{{ t("The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.", { ns: "'.concat(O.CU,'" }) }}'),"x-decorator":"FormItem",default:1,"x-component":"InputNumber","x-component-props":{min:1,precision:0,className:"auto-width"}}}}},E={name:"workflow",type:"void",properties:{provider:{type:"void","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:A.A,resourceName:"workflows",request:{resource:"workflows",action:"list",params:{filter:{current:!0},sort:["-createdAt"],except:["config"]}}},"x-component":"CategoryTabs",properties:{main:{type:"void","x-component":"CardItem",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{filter:{type:"void",title:'{{ t("Filter") }}',default:{$and:[{title:{$includes:""}}]},"x-action":"filter","x-component":"Filter.Action","x-use-component-props":"useResourceFilterActionProps","x-component-props":{icon:"FilterOutlined",nonfilterable:["id","description","categories"]},"x-align":"left"},refresher:{type:"void",title:'{{ t("Refresh") }}',"x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},sync:{type:"void",title:'{{t("Sync", { ns: "'.concat(O.CU,'" })}}'),"x-decorator":"Tooltip","x-decorator-props":{title:'{{ t("Sync enabled status of all workflows from database", { ns: "'.concat(O.CU,'" }) }}')},"x-component":"Action","x-component-props":{icon:"SyncOutlined",useAction:"{{ useSyncAction }}"},"x-reactions":["{{useWorkflowSyncReaction}}"]},delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"Action","x-component-props":{type:"primary",icon:"PlusOutlined"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{initialValue:{current:!0}},title:'{{t("Add new")}}',properties:{title:j.title,type:j.type,triggerPreset:j.triggerPreset,sync:j.sync,categories:j.categories,description:j.description,options:j.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useCreateAction }}"}}}}}}}}}},table:{type:"array","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{cm.useDataSourceFromRAC }}"},properties:{title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Title") }}',properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},categories:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Category", { ns: "'.concat(O.CU,'" }) }}'),properties:{categories:{type:"array","x-component":"EnumerationField","x-component-props":{multiple:!0,fieldNames:{label:"title",value:"id",color:"color"}}}}},type:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Trigger type", { ns: "'.concat(O.CU,'" }) }}'),properties:{type:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},sync:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Execute mode", { ns: "'.concat(O.CU,'" }) }}'),properties:{sync:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Enabled", { ns: "'.concat(O.CU,'" }) }}'),properties:{enabled:{type:"boolean","x-component":"WorkflowEnabledSwitch",default:!1}}},"stats.executed":{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",title:'{{ t("Executed", { ns: "'.concat(O.CU,'" }) }}'),properties:{"stats.executed":{type:"number","x-decorator":"OpenDrawer","x-decorator-props":{component:function(e){var t=(0,s.useCollectionRecordData)();return c().createElement("a",P({"aria-label":"executed-".concat(t.title)},e))}},"x-component":"InputNumber","x-read-pretty":!0,properties:{drawer:w.M}}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{configure:{type:"void","x-component":"WorkflowLink"},update:{type:"void",title:'{{ t("Edit") }}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{ t("Edit") }}',properties:{title:j.title,type:(o=P({},j.type),n=n={"x-disabled":!0},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(n,e))}),o),sync:j.sync,categories:j.categories,description:j.description,options:j.options,footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ cm.useUpdateAction }}"}}}}}}}},revision:{type:"void",title:'{{t("Duplicate", { ns: "'.concat(O.CU,'" })}}'),"x-component":"Action.Link","x-component-props":{openSize:"small"},properties:{modal:{type:"void",title:'{{t("Duplicate to new workflow", { ns: "'.concat(O.CU,'" })}}'),"x-decorator":"FormV2","x-component":"Action.Modal",properties:{title:{type:"string",title:'{{t("Title")}}',"x-decorator":"FormItem","x-component":"Input"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{submit:{type:"void",title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useRevisionAction }}"}},cancel:{type:"void",title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{ cm.useDestroyActionAndRefreshCM }}"}}}}}}}}}}}}}},k=r(5324),F=r(9603),T=r(512);function D(e){var t=e.data,r=t.label,o=t.color,n=t.options,i=(0,s.useCompile)();return c().createElement(a.Space,{direction:"vertical"},c().createElement(a.Tag,{color:o},i(r)),c().createElement(a.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},i(n.description)))}var I=r(7375),R=r(6799),U=r(166),V=r(6773);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function N(e,t,r,o,n,i,c){try{var a=e[i](c),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(o,n)}function q(e){return function(){var t=this,r=arguments;return new Promise(function(o,n){var i=e.apply(t,r);function c(e){N(i,o,n,c,a,"next",e)}function a(e){N(i,o,n,c,a,"throw",e)}c(void 0)})}}function L(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function B(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,o,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i=[],c=!0,a=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){var r,o,n,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:l(0)}),a(c,"throw",{value:l(1)}),a(c,"return",{value:l(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(i=0)),i;)try{if(r=1,o&&(n=2&u[0]?o.return:u[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,u[1])).done)return n;switch(o=0,n&&(u=[2&u[0],n.value]),u[0]){case 0:case 1:n=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3])){i.label=u[1];break}if(6===u[0]&&i.label<n[1]){i.label=n[1],n=u;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(u);break}n[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{r=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function z(){var e,t,r=(e=["\n .ant-tabs-nav-list > :first-child {\n border: none;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return z=function(){return r},r}function K(e){var t=(0,R.useDraggable)({id:e.id,data:e.data}),r=t.attributes,o=t.listeners,n=t.setNodeRef;return c().createElement("div",L({ref:n},o,r),c().createElement("div",null,e.children))}function _(e){var t=(0,R.useDroppable)({id:e.id,data:e.data}),r=t.isOver,o=t.setNodeRef;return c().createElement("div",{ref:o,style:r?{color:"green"}:void 0},e.children)}var G=(0,u.observer)(function(e){var t=e.item;return c().createElement(_,{id:t.id.toString(),data:t},c().createElement("div",null,c().createElement(K,{id:t.id.toString(),data:t},c().createElement(H,{item:t}))))},{displayName:"TabTitle"}),H=function(e){var t=e.item,r=(0,y.useTranslation)().t,o=(0,s.useCompile)();return c().createElement(a.Space,null,c().createElement(a.Badge,{color:t.color}),r(o(t.title)))},Q=(0,u.observer)(function(e){var t=W((0,i.useState)(null),2),r=t[0],o=t[1],n=(0,i.useContext)(Y).refresh,a=(0,s.useAPIClient)(),l=(0,R.useSensor)(R.MouseSensor,{activationConstraint:{distance:10}}),u=(0,R.useSensors)(l);return c().createElement(R.DndContext,{sensors:u,onDragEnd:function(e){return q(function(){var t,r;return $(this,function(i){switch(i.label){case 0:if(t=e.active,r=e.over,setTimeout(function(){o(null)}),!(r&&r.id!==t.id))return[3,2];return[4,a.resource("workflowCategories").move({sourceId:t.id,targetId:r.id})];case 1:i.sent(),n(),i.label=2;case 2:return[2]}})})()},onDragStart:function(e){var t;o(null==(t=e.active)?void 0:t.data.current)}},e.children,c().createElement(R.DragOverlay,null,r?c().createElement("span",{style:{whiteSpace:"nowrap"}},c().createElement(H,{item:r})):null))},{displayName:"DndProvider"}),Y=(0,i.createContext)({});function J(e){var t=e.values,r=e.onEdit,o=e.onRemove,n=(0,s.useCompile)(),l=(0,i.useCallback)(function(e){switch(e.key){case"edit":r(t);break;case"delete":o(t.id)}},[r,o,t]);return c().createElement(a.Dropdown,{menu:{items:[{key:"edit",label:(0,O.vV)("Edit category")},{key:"delete",label:(0,O.vV)("Delete category")}],onClick:l}},c().createElement(I.MenuOutlined,{role:"button","aria-label":n(t.title),style:{padding:8,margin:"-8px"}}))}function X(){var e,t=(0,s.useResourceActionContext)(),r=t.run,o=t.setState,n=t.defaultRequest,p=W((0,i.useState)({tab:"all"}),2),m=p[0],d=p[1],f=W((0,i.useState)(m.tab),2),y=f[0],b=f[1],v=(0,s.useCompile)(),g=(0,s.useAPIClient)(),x=(0,u.useFieldSchema)(),h=a.App.useApp().modal,w=(0,s.useRequest)({resource:"workflowCategories",action:"list",params:{paginate:!1,sort:["sort"]}}),C=w.data,A=w.refresh,S=W((0,i.useState)(!1),2),P=S[0],j=S[1],E=(0,i.useMemo)(function(){return(0,l.createForm)()},[]),k=(0,i.useCallback)(function(e){j(!0);var t=(0,V.cloneDeep)(e);E.setValues(t)},[E]),F=(0,i.useCallback)(function(){j(!1),E.reset()},[E]),T=(0,i.useCallback)(function(e){h.confirm({title:v("{{t('Delete category')}}"),content:v("{{t('Are you sure you want to delete it?')}}"),onOk:function(){return q(function(){return $(this,function(t){switch(t.label){case 0:return[4,g.resource("workflowCategories").destroy({filter:{id:e}})];case 1:return t.sent(),e===+m.tab&&d({tab:"all"}),A(),r(),[2]}})})()}})},[m.tab]),D=(0,i.useMemo)(function(){if(!(null==C?void 0:C.data))return[];var e=C.data.sort(function(e,t){return e.sort-t.sort}).concat().map(function(e){return B(L({},e),{schema:x.properties.main})});return e.find(function(e){return"all"===e.id})||e.unshift({title:'{{t("All", { ns: "'.concat(O.CU,'" })}}'),id:"all",sort:0,closable:!1,schema:x.properties.main}),e.map(function(e){return{label:"all"!==e.id?c().createElement("div",{"data-no-dnd":"true"},c().createElement(G,{item:e})):v(e.title),key:String(e.id),closable:e.closable,closeIcon:c().createElement(J,{values:e,onEdit:k,onRemove:T}),children:c().createElement(a.Card,{variant:"borderless",style:{borderRadius:"0 0.5em 0.5em 0.5em"}},c().createElement(u.RecursionField,{name:y,schema:e.schema,onlyRenderProperties:!0}))}})},[v,null==C?void 0:C.data,y,k,T,x.properties.main]),I=(0,i.useCallback)(function(e){if(d({tab:e}),b((0,U.uid)()),"all"!==e){var t,i={$and:[null==n||null==(t=n.params)?void 0:t.filter,{"categories.id":e}]};r({filter:i}),null==o||o({categories:[+e],params:[{filter:i}]})}else r(),null==o||o({categories:[],params:[]})},[null==n||null==(e=n.params)?void 0:e.filter,r,o]);return((0,i.useEffect)(function(){"all"!==m.tab&&I(m.tab)},[m.tab,I]),C)?c().createElement(Y.Provider,{value:{refresh:A}},c().createElement(Q,null,c().createElement(a.Tabs,{addIcon:c().createElement(s.SchemaComponent,{components:{AddCategory:er},schema:{type:"void",properties:{addCategories:{type:"void",title:'{{ t("Add category", { ns: "'.concat(O.CU,'" }) }}'),"x-component":"AddCategory","x-component-props":{type:"primary"}}}}}),onChange:I,defaultActiveKey:m.tab||"all",type:"editable-card",destroyInactiveTabPane:!0,tabBarStyle:{marginBottom:"0px"},className:(0,s.css)(z()),items:D})),c().createElement(s.ActionContextProvider,{value:{visible:P,setVisible:F,openSize:"small"}},c().createElement(s.SchemaComponent,{scope:{useFormProviderProps:ee,useCancelAction:s.useCancelAction,useEditSubmit:Z},schema:{name:(0,U.uid)(),type:"void","x-decorator":"FormV2","x-decorator-props":{form:E},title:'{{ t("Edit category", { ns: "'.concat(O.CU,'" }) }}'),"x-component":"Action.Modal","x-component-props":{delay:0},properties:{title:{type:"string",title:'{{t("Title")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},color:{type:"string",title:'{{t("Color")}}',required:!1,"x-decorator":"FormItem","x-component":"ColorSelect"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useEditSubmit }}",style:{marginLeft:"8px"}}}}}}}}))):null}function Z(){var e=(0,u.useForm)(),t=(0,s.useActionContext)(),r=(0,s.useResourceActionContext)(),o=(0,i.useContext)(Y).refresh,n=(0,s.useAPIClient)();return{run:function(){return q(function(){var i;return $(this,function(c){switch(c.label){case 0:return[4,e.submit()];case 1:return c.sent(),[4,n.resource("workflowCategories").update({filterByTk:null==(i=e.values)?void 0:i.id,values:e.values})];case 2:return c.sent(),t.setVisible(!1),[4,e.reset()];case 3:return c.sent(),null==o||o(),null==r||r.refresh(),[2]}})})()}}}function ee(){return{form:(0,u.useForm)()}}function et(){var e=(0,u.useForm)(),t=(0,s.useActionContext)().setVisible,r=(0,i.useContext)(Y).refresh,o=(0,s.useAPIClient)();return{run:function(){return q(function(){var n;return $(this,function(i){switch(i.label){case 0:return[4,e.submit()];case 1:return i.sent(),n=(0,V.cloneDeep)(e.values),[4,o.resource("workflowCategories").create({values:n})];case 2:return i.sent(),t(!1),e.reset(),r(),[2]}})})()}}}function er(e){var t=W((0,i.useState)(!1),2),r=t[0],o=t[1],n=(0,y.useTranslation)().t,a=(0,i.useMemo)(function(){return(0,l.createForm)()},[]);return c().createElement(s.ActionContextProvider,{value:{visible:r,setVisible:o,openSize:"small"}},c().createElement("div",{onClick:function(){return o(!0)},title:n("Add category")},c().createElement(I.PlusOutlined,null)),c().createElement(s.SchemaComponent,{schema:{name:"modal",type:"void","x-decorator":"FormV2","x-decorator-props":{form:a},title:'{{ t("Add category") }}',"x-component":"Action.Modal","x-component-props":B(L({},e),{delay:0}),properties:{title:{type:"string",title:'{{t("Title")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},color:{type:"string",title:'{{t("Color")}}',required:!1,"x-decorator":"FormItem","x-component":"ColorSelect"},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useCreateSubmit }}",style:{marginLeft:"8px"}}}}}}},scope:{useCancelAction:s.useCancelAction,useCreateSubmit:et}}))}function eo(e){var t=e.value,r=e.multiple,o=e.fieldNames,n=void 0===o?s.defaultFieldNames:o,i=(0,s.useCompile)();return(r?null!=t?t:[]:t?[t]:[]).map(function(e){return c().createElement(a.Tag,{key:e[n.value],color:e[n.color]},i(e[n.label]))})}var en=r(2815);function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function ec(e,t,r,o,n,i,c){try{var a=e[i](c),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(o,n)}function ea(e){return function(){var t=this,r=arguments;return new Promise(function(o,n){var i=e.apply(t,r);function c(e){ec(i,o,n,c,a,"next",e)}function a(e){ec(i,o,n,c,a,"throw",e)}c(void 0)})}}function el(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,o,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i=[],c=!0,a=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{c||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ei(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ei(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eu(e,t){var r,o,n,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(c,"next",{value:l(0)}),a(c,"throw",{value:l(1)}),a(c,"return",{value:l(2)}),"function"==typeof Symbol&&a(c,Symbol.iterator,{value:function(){return this}}),c;function l(a){return function(l){var u=[a,l];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(i=0)),i;)try{if(r=1,o&&(n=2&u[0]?o.return:u[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,u[1])).done)return n;switch(o=0,n&&(u=[2&u[0],n.value]),u[0]){case 0:case 1:n=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,o=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!n||u[1]>n[0]&&u[1]<n[3])){i.label=u[1];break}if(6===u[0]&&i.label<n[1]){i.label=n[1],n=u;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(u);break}n[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],o=0}finally{r=n=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}function es(e){var t=(0,u.useField)(),r=(0,s.useRecord)(),o=(0,s.usePlugin)(k.default);return(0,u.useFormEffects)(function(e){(0,l.onFieldChange)("type",function(e){var n=r.id||!e.value;if(e.value){var i=o.triggers.get(e.value);null!=i.sync?(n=!0,t.setValue(i.sync)):t.setInitialValue(!1)}t.setPattern(n?"disabled":"editable")})}),(0,i.useEffect)(function(){if(r.id){t.setPattern("disabled");var n,i=o.triggers.get(r.type);null!=i.sync?t.setValue(i.sync):t.setInitialValue(null!=(n=e.value)&&n)}},[r.id,t,o.triggers,r.type,e.value]),c().createElement(F.$i,e)}function ep(e){var t=(0,s.useApp)();e.visible=!!((0,s.usePlugin)("multi-app-share-collection")||"main"!==t.name)}function em(){var e=a.App.useApp().message,t=(0,y.useTranslation)().t,r=(0,s.useResourceContext)().resource;return{run:function(){return ea(function(){return eu(this,function(o){switch(o.label){case 0:return[4,r.sync()];case 1:return o.sent(),e.success(t("Operation succeeded")),[2]}})})()}}}function ed(){var e=a.App.useApp().message,t=(0,y.useTranslation)().t,r=(0,s.useResourceActionContext)().refresh,o=(0,s.useResourceContext)(),n=o.resource,i=o.targetKey,c=(0,s.useActionContext)().setVisible,l=(0,s.useRecord)()[i],p=(0,u.useForm)(),m=(0,u.useField)();return{run:function(){return ea(function(){return eu(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),[4,p.submit()];case 1:return o.sent(),m.data=m.data||{},m.data.loading=!0,[4,n.revision({filterByTk:l,values:p.values})];case 2:return o.sent(),e.success(t("Operation succeeded")),r(),c(!1),[3,5];case 3:return console.error(o.sent()),[3,5];case 4:return m.data&&(m.data.loading=!1),[7];case 5:return[2]}})})()}}}function ef(){var e=(0,s.usePlugin)(k.default),t=el((0,i.useState)(null),2),r=t[0],o=t[1],n=(0,u.useForm)();(0,u.useFormEffects)(function(){(0,l.onFieldValueChange)("type",function(e){var t;o(null!=(t=e.value)?t:null),n.clearFormGraph("config.*")})});var a=r?e.triggers.get(r):null;return(null==a?void 0:a.presetFieldset)?c().createElement(s.SchemaComponent,{key:r,components:a.components,scope:a.scope,schema:{type:"void",properties:{config:{type:"object","x-decorator":"FormItem",title:'{{t("Trigger configuration", { ns: "'.concat(O.CU,'" })}}'),"x-component":"Fieldset",properties:a.presetFieldset}}}}):null}function ey(){var e=a.App.useApp().message,t=(0,y.useTranslation)().t,r=(0,s.useRecord)(),o=(0,s.useResourceContext)().resource,n=(0,s.useResourceActionContext)().refresh,l=el((0,i.useState)(!1),2),u=l[0],p=l[1],m=(0,i.useCallback)(function(i){return ea(function(){return eu(this,function(c){switch(c.label){case 0:if(!(null==r?void 0:r.id))return[2];p(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,o.update({filterByTk:r.id,values:{enabled:i}})];case 2:return c.sent(),setTimeout(function(){return null==n?void 0:n()},0),[3,5];case 3:return console.error(c.sent()),e.error(t("Operation failed")),[3,5];case 4:return p(!1),[7];case 5:return[2]}})})()},[e,r,n,o,t]);return c().createElement(a.Switch,{checked:!!(null==r?void 0:r.enabled),size:"small",disabled:u||!(null==r?void 0:r.id),loading:u,onClick:function(e,t){var r;return null==t||null==(r=t.stopPropagation)?void 0:r.call(t)},onChange:m})}function eb(){var e,t,r=(0,i.useContext)(s.SchemaComponentContext),o=(0,s.usePlugin)(k.default).useTriggersOptions;return c().createElement(s.SchemaComponentContext.Provider,{value:(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},r),t=t={designable:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e)},c().createElement(s.SchemaComponent,{schema:E,components:{CollectionProvider:s.CollectionProvider,WorkflowLink:g,ExecutionResourceProvider:f,ExecutionLink:p.d,OpenDrawer:h,SyncOptionSelect:es,ExecutionStatusColumn:S.t_,Tooltip:a.Tooltip,CategoryTabs:X,EnumerationField:eo,WorkflowEnabledSwitch:ey,TriggerPresetFieldset:ef},scope:{useTriggersOptions:o,useWorkflowSyncReaction:ep,useSyncAction:em,useResourceFilterActionProps:en.A,useRefreshActionProps:T.t,useRevisionAction:ed,TriggerOptionRender:D,ExecutionStatusOptions:C.$A}}))}}}]);