@ezpaarse-project/ezreeport-sdk-js 1.0.0-beta.11 → 1.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/ezreeport-sdk-js.mjs +4 -4
- package/dist/browser/ezreeport-sdk-js.mjs.map +1 -1
- package/dist/browser/ezreeport-sdk-js.umd.js +1 -1
- package/dist/browser/ezreeport-sdk-js.umd.js.map +1 -1
- package/dist/node/package.json +1 -1
- package/dist/node/src/modules/crons.js +1 -1
- package/dist/node/src/modules/crons.js.map +1 -1
- package/dist/node/src/modules/health.js +1 -1
- package/dist/node/src/modules/health.js.map +1 -1
- package/dist/node/src/modules/queues.js +1 -1
- package/dist/node/src/modules/queues.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist/browser/ezreeport-sdk-js.mjs +0 -2426
- package/dist/dist/browser/ezreeport-sdk-js.mjs.map +0 -1
- package/dist/dist/browser/ezreeport-sdk-js.umd.js +0 -6
- package/dist/dist/browser/ezreeport-sdk-js.umd.js.map +0 -1
- package/dist/dist/dist/browser/ezreeport-sdk-js.mjs +0 -2426
- package/dist/dist/dist/browser/ezreeport-sdk-js.mjs.map +0 -1
- package/dist/dist/dist/browser/ezreeport-sdk-js.umd.js +0 -6
- package/dist/dist/dist/browser/ezreeport-sdk-js.umd.js.map +0 -1
- package/dist/dist/dist/node/package.json +0 -58
- package/dist/dist/dist/node/src/index.js +0 -43
- package/dist/dist/dist/node/src/index.js.map +0 -1
- package/dist/dist/dist/node/src/lib/axios.js +0 -95
- package/dist/dist/dist/node/src/lib/axios.js.map +0 -1
- package/dist/dist/dist/node/src/lib/promises.js +0 -41
- package/dist/dist/dist/node/src/lib/promises.js.map +0 -1
- package/dist/dist/dist/node/src/lib/utils.js +0 -24
- package/dist/dist/dist/node/src/lib/utils.js.map +0 -1
- package/dist/dist/dist/node/src/modules/auth.js +0 -111
- package/dist/dist/dist/node/src/modules/auth.js.map +0 -1
- package/dist/dist/dist/node/src/modules/auth.public.js +0 -11
- package/dist/dist/dist/node/src/modules/auth.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/crons.js +0 -128
- package/dist/dist/dist/node/src/modules/crons.js.map +0 -1
- package/dist/dist/dist/node/src/modules/crons.public.js +0 -11
- package/dist/dist/dist/node/src/modules/crons.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/elastic.js +0 -31
- package/dist/dist/dist/node/src/modules/elastic.js.map +0 -1
- package/dist/dist/dist/node/src/modules/elastic.public.js +0 -7
- package/dist/dist/dist/node/src/modules/elastic.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/health.js +0 -60
- package/dist/dist/dist/node/src/modules/health.js.map +0 -1
- package/dist/dist/dist/node/src/modules/health.public.js +0 -9
- package/dist/dist/dist/node/src/modules/health.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/history.js +0 -62
- package/dist/dist/dist/node/src/modules/history.js.map +0 -1
- package/dist/dist/dist/node/src/modules/history.public.js +0 -6
- package/dist/dist/dist/node/src/modules/history.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/namespaces.js +0 -15
- package/dist/dist/dist/node/src/modules/namespaces.js.map +0 -1
- package/dist/dist/dist/node/src/modules/namespaces.public.js +0 -3
- package/dist/dist/dist/node/src/modules/namespaces.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/queues.js +0 -179
- package/dist/dist/dist/node/src/modules/queues.js.map +0 -1
- package/dist/dist/dist/node/src/modules/queues.public.js +0 -13
- package/dist/dist/dist/node/src/modules/queues.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/reports.js +0 -267
- package/dist/dist/dist/node/src/modules/reports.js.map +0 -1
- package/dist/dist/dist/node/src/modules/reports.public.js +0 -13
- package/dist/dist/dist/node/src/modules/reports.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/setup.js +0 -35
- package/dist/dist/dist/node/src/modules/setup.js.map +0 -1
- package/dist/dist/dist/node/src/modules/setup.public.js +0 -12
- package/dist/dist/dist/node/src/modules/setup.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasks.base.js +0 -51
- package/dist/dist/dist/node/src/modules/tasks.base.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasks.js +0 -281
- package/dist/dist/dist/node/src/modules/tasks.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasks.public.js +0 -21
- package/dist/dist/dist/node/src/modules/tasks.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasksActivity.js +0 -62
- package/dist/dist/dist/node/src/modules/tasksActivity.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasksActivity.public.js +0 -6
- package/dist/dist/dist/node/src/modules/tasksActivity.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasksPresets.js +0 -102
- package/dist/dist/dist/node/src/modules/tasksPresets.js.map +0 -1
- package/dist/dist/dist/node/src/modules/tasksPresets.public.js +0 -10
- package/dist/dist/dist/node/src/modules/tasksPresets.public.js.map +0 -1
- package/dist/dist/dist/node/src/modules/templates.js +0 -136
- package/dist/dist/dist/node/src/modules/templates.js.map +0 -1
- package/dist/dist/dist/node/src/modules/templates.public.js +0 -11
- package/dist/dist/dist/node/src/modules/templates.public.js.map +0 -1
- package/dist/dist/dist/test +0 -0
- package/dist/dist/dist/types/src/index.d.ts +0 -32
- package/dist/dist/dist/types/src/lib/axios.d.ts +0 -51
- package/dist/dist/dist/types/src/lib/promises.d.ts +0 -21
- package/dist/dist/dist/types/src/lib/utils.d.ts +0 -27
- package/dist/dist/dist/types/src/modules/auth.d.ts +0 -90
- package/dist/dist/dist/types/src/modules/auth.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/crons.d.ts +0 -102
- package/dist/dist/dist/types/src/modules/crons.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/elastic.d.ts +0 -22
- package/dist/dist/dist/types/src/modules/elastic.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/health.d.ts +0 -53
- package/dist/dist/dist/types/src/modules/health.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/history.d.ts +0 -38
- package/dist/dist/dist/types/src/modules/history.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/namespaces.d.ts +0 -29
- package/dist/dist/dist/types/src/modules/namespaces.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/queues.d.ts +0 -120
- package/dist/dist/dist/types/src/modules/queues.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/reports.d.ts +0 -204
- package/dist/dist/dist/types/src/modules/reports.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/setup.d.ts +0 -17
- package/dist/dist/dist/types/src/modules/setup.public.d.ts +0 -2
- package/dist/dist/dist/types/src/modules/tasks.base.d.ts +0 -48
- package/dist/dist/dist/types/src/modules/tasks.d.ts +0 -243
- package/dist/dist/dist/types/src/modules/tasks.public.d.ts +0 -2
- package/dist/dist/dist/types/src/modules/tasksActivity.d.ts +0 -36
- package/dist/dist/dist/types/src/modules/tasksActivity.public.d.ts +0 -5
- package/dist/dist/dist/types/src/modules/tasksPresets.d.ts +0 -83
- package/dist/dist/dist/types/src/modules/tasksPresets.public.d.ts +0 -1
- package/dist/dist/dist/types/src/modules/templates.d.ts +0 -153
- package/dist/dist/dist/types/src/modules/templates.public.d.ts +0 -1
- package/dist/dist/node/package.json +0 -58
- package/dist/dist/node/src/index.js +0 -43
- package/dist/dist/node/src/index.js.map +0 -1
- package/dist/dist/node/src/lib/axios.js +0 -95
- package/dist/dist/node/src/lib/axios.js.map +0 -1
- package/dist/dist/node/src/lib/promises.js +0 -41
- package/dist/dist/node/src/lib/promises.js.map +0 -1
- package/dist/dist/node/src/lib/utils.js +0 -24
- package/dist/dist/node/src/lib/utils.js.map +0 -1
- package/dist/dist/node/src/modules/auth.js +0 -111
- package/dist/dist/node/src/modules/auth.js.map +0 -1
- package/dist/dist/node/src/modules/auth.public.js +0 -11
- package/dist/dist/node/src/modules/auth.public.js.map +0 -1
- package/dist/dist/node/src/modules/crons.js +0 -128
- package/dist/dist/node/src/modules/crons.js.map +0 -1
- package/dist/dist/node/src/modules/crons.public.js +0 -11
- package/dist/dist/node/src/modules/crons.public.js.map +0 -1
- package/dist/dist/node/src/modules/elastic.js +0 -31
- package/dist/dist/node/src/modules/elastic.js.map +0 -1
- package/dist/dist/node/src/modules/elastic.public.js +0 -7
- package/dist/dist/node/src/modules/elastic.public.js.map +0 -1
- package/dist/dist/node/src/modules/health.js +0 -60
- package/dist/dist/node/src/modules/health.js.map +0 -1
- package/dist/dist/node/src/modules/health.public.js +0 -9
- package/dist/dist/node/src/modules/health.public.js.map +0 -1
- package/dist/dist/node/src/modules/history.js +0 -62
- package/dist/dist/node/src/modules/history.js.map +0 -1
- package/dist/dist/node/src/modules/history.public.js +0 -6
- package/dist/dist/node/src/modules/history.public.js.map +0 -1
- package/dist/dist/node/src/modules/namespaces.js +0 -15
- package/dist/dist/node/src/modules/namespaces.js.map +0 -1
- package/dist/dist/node/src/modules/namespaces.public.js +0 -3
- package/dist/dist/node/src/modules/namespaces.public.js.map +0 -1
- package/dist/dist/node/src/modules/queues.js +0 -179
- package/dist/dist/node/src/modules/queues.js.map +0 -1
- package/dist/dist/node/src/modules/queues.public.js +0 -13
- package/dist/dist/node/src/modules/queues.public.js.map +0 -1
- package/dist/dist/node/src/modules/reports.js +0 -267
- package/dist/dist/node/src/modules/reports.js.map +0 -1
- package/dist/dist/node/src/modules/reports.public.js +0 -13
- package/dist/dist/node/src/modules/reports.public.js.map +0 -1
- package/dist/dist/node/src/modules/setup.js +0 -35
- package/dist/dist/node/src/modules/setup.js.map +0 -1
- package/dist/dist/node/src/modules/setup.public.js +0 -12
- package/dist/dist/node/src/modules/setup.public.js.map +0 -1
- package/dist/dist/node/src/modules/tasks.base.js +0 -51
- package/dist/dist/node/src/modules/tasks.base.js.map +0 -1
- package/dist/dist/node/src/modules/tasks.js +0 -281
- package/dist/dist/node/src/modules/tasks.js.map +0 -1
- package/dist/dist/node/src/modules/tasks.public.js +0 -21
- package/dist/dist/node/src/modules/tasks.public.js.map +0 -1
- package/dist/dist/node/src/modules/tasksActivity.js +0 -62
- package/dist/dist/node/src/modules/tasksActivity.js.map +0 -1
- package/dist/dist/node/src/modules/tasksActivity.public.js +0 -6
- package/dist/dist/node/src/modules/tasksActivity.public.js.map +0 -1
- package/dist/dist/node/src/modules/tasksPresets.js +0 -102
- package/dist/dist/node/src/modules/tasksPresets.js.map +0 -1
- package/dist/dist/node/src/modules/tasksPresets.public.js +0 -10
- package/dist/dist/node/src/modules/tasksPresets.public.js.map +0 -1
- package/dist/dist/node/src/modules/templates.js +0 -136
- package/dist/dist/node/src/modules/templates.js.map +0 -1
- package/dist/dist/node/src/modules/templates.public.js +0 -11
- package/dist/dist/node/src/modules/templates.public.js.map +0 -1
- package/dist/dist/test +0 -0
- package/dist/dist/types/src/index.d.ts +0 -32
- package/dist/dist/types/src/lib/axios.d.ts +0 -51
- package/dist/dist/types/src/lib/promises.d.ts +0 -21
- package/dist/dist/types/src/lib/utils.d.ts +0 -27
- package/dist/dist/types/src/modules/auth.d.ts +0 -90
- package/dist/dist/types/src/modules/auth.public.d.ts +0 -1
- package/dist/dist/types/src/modules/crons.d.ts +0 -102
- package/dist/dist/types/src/modules/crons.public.d.ts +0 -1
- package/dist/dist/types/src/modules/elastic.d.ts +0 -22
- package/dist/dist/types/src/modules/elastic.public.d.ts +0 -1
- package/dist/dist/types/src/modules/health.d.ts +0 -53
- package/dist/dist/types/src/modules/health.public.d.ts +0 -1
- package/dist/dist/types/src/modules/history.d.ts +0 -38
- package/dist/dist/types/src/modules/history.public.d.ts +0 -1
- package/dist/dist/types/src/modules/namespaces.d.ts +0 -29
- package/dist/dist/types/src/modules/namespaces.public.d.ts +0 -1
- package/dist/dist/types/src/modules/queues.d.ts +0 -120
- package/dist/dist/types/src/modules/queues.public.d.ts +0 -1
- package/dist/dist/types/src/modules/reports.d.ts +0 -204
- package/dist/dist/types/src/modules/reports.public.d.ts +0 -1
- package/dist/dist/types/src/modules/setup.d.ts +0 -17
- package/dist/dist/types/src/modules/setup.public.d.ts +0 -2
- package/dist/dist/types/src/modules/tasks.base.d.ts +0 -48
- package/dist/dist/types/src/modules/tasks.d.ts +0 -243
- package/dist/dist/types/src/modules/tasks.public.d.ts +0 -2
- package/dist/dist/types/src/modules/tasksActivity.d.ts +0 -36
- package/dist/dist/types/src/modules/tasksActivity.public.d.ts +0 -5
- package/dist/dist/types/src/modules/tasksPresets.d.ts +0 -83
- package/dist/dist/types/src/modules/tasksPresets.public.d.ts +0 -1
- package/dist/dist/types/src/modules/templates.d.ts +0 -153
- package/dist/dist/types/src/modules/templates.public.d.ts +0 -1
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Dn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ye=Symbol("internals");function z(e){return e&&String(e).trim().toLowerCase()}function X(e){return e===!1||e==null?e:a.isArray(e)?e.map(X):String(e)}function jn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Un=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function pe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Bn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Mn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let Z=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,l,d){const f=z(l);if(!f)throw new Error("header name must be a non-empty string");const u=a.findKey(s,f);(!u||s[u]===void 0||d===!0||d===void 0&&s[u]!==!1)&&(s[u||l]=X(c))}const i=(c,l)=>a.forEach(c,(d,f)=>o(d,f,l));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!Un(t)?i(Fn(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=z(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return jn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=z(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||pe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=z(i),i){const c=a.findKey(r,i);c&&(!n||pe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||pe(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=X(s),delete n[o];return}const c=t?Bn(o):String(o).trim();c!==o&&delete n[o],n[c]=X(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
3
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ye]=this[Ye]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=z(i);r[c]||(Mn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};Z.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(Z.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(Z);const O=Z;function he(e,t){const n=this||de,r=t||n,s=O.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Ve(e){return!!(e&&e.__CANCEL__)}function I(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(I,y,{__CANCEL__:!0});function Hn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const zn=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function In(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ge(e,t){return e&&!In(t)?qn(e,t):t}const Jn=C.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function Wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const d=Date.now(),f=r[o];i||(i=d),n[s]=l,r[s]=d;let u=o,T=0;for(;u!==s;)T+=n[u++],u=u%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-i<t)return;const _=f&&d-f;return _?Math.round(T*1e3/_):void 0}}function Qe(e,t){let n=0;const r=Kn(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,c=o-n,l=r(c),d=o<=i;n=o;const f={loaded:o,total:i,progress:i?o/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i&&d?(i-o)/l:void 0,event:s};f[t?"download":"upload"]=!0,e(f)}}const me={http:Sn,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const o=O.from(e.headers).normalize();let{responseType:i,withXSRFToken:c}=e,l;function d(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let f;if(a.isFormData(s)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((f=o.getContentType())!==!1){const[m,...A]=f?f.split(";").map(R=>R.trim()).filter(Boolean):[];o.setContentType([m||"multipart/form-data",...A].join("; "))}}let u=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",A=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+A))}const T=Ge(e.baseURL,e.url);u.open(e.method.toUpperCase(),Ie(T,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function _(){if(!u)return;const m=O.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),R={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:m,config:e,request:u};Hn(function($){n($),d()},function($){r($),d()},R),u=null}if("onloadend"in u?u.onloadend=_:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(_)},u.onabort=function(){u&&(r(new y("Request aborted",y.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let A=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const R=e.transitional||Je;e.timeoutErrorMessage&&(A=e.timeoutErrorMessage),r(new y(A,R.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,u)),u=null},C.hasStandardBrowserEnv&&(c&&a.isFunction(c)&&(c=c(e)),c||c!==!1&&Jn(T))){const m=e.xsrfHeaderName&&e.xsrfCookieName&&zn.read(e.xsrfCookieName);m&&o.set(e.xsrfHeaderName,m)}s===void 0&&o.setContentType(null),"setRequestHeader"in u&&a.forEach(o.toJSON(),function(A,R){u.setRequestHeader(R,A)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&i!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Qe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Qe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=m=>{u&&(r(!m||m.type?new I(null,e,u):m),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const h=Wn(T);if(h&&C.protocols.indexOf(h)===-1){r(new y("Unsupported protocol "+h+":",y.ERR_BAD_REQUEST,e));return}u.send(s||null)})}};a.forEach(me,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xe=e=>`- ${e}`,Yn=e=>a.isFunction(e)||e===null||e===!1,Ze={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!Yn(n)&&(r=me[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
|
|
4
4
|
`+o.map(Xe).join(`
|
|
5
|
-
`):" "+Xe(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:me};function ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new I(null,e)}function et(e){return ye(e),e.headers=O.from(e.headers),e.data=he.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ze.getAdapter(e.adapter||de.adapter)(e).then(function(r){return ye(e),r.data=he.call(e,e.transformResponse,r),r.headers=O.from(r.headers),r},function(r){return Ve(r)||(ye(e),r&&r.response&&(r.response.data=he.call(e,e.transformResponse,r.response),r.response.headers=O.from(r.response.headers))),Promise.reject(r)})}const tt=e=>e instanceof O?e.toJSON():e;function D(e,t){t=t||{};const n={};function r(d,f,u){return a.isPlainObject(d)&&a.isPlainObject(f)?a.merge.call({caseless:u},d,f):a.isPlainObject(f)?a.merge({},f):a.isArray(f)?f.slice():f}function s(d,f,u){if(a.isUndefined(f)){if(!a.isUndefined(d))return r(void 0,d,u)}else return r(d,f,u)}function o(d,f){if(!a.isUndefined(f))return r(void 0,f)}function i(d,f){if(a.isUndefined(f)){if(!a.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function c(d,f,u){if(u in t)return r(d,f);if(u in e)return r(void 0,d)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,f)=>s(tt(d),tt(f),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(f){const u=l[f]||s,T=u(e[f],t[f],f);a.isUndefined(T)&&u!==c||(n[f]=T)}),n}const nt="1.6.4",ge={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ge[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rt={};ge.transitional=function(t,n,r){function s(o,i){return"[Axios v"+nt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!rt[i]&&(rt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Vn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],l=c===void 0||i(c,o,e);if(l!==!0)throw new y("option "+o+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const be={assertOptions:Vn,validators:ge},N=be.validators;let ee=class{constructor(t){this.defaults=t,this.interceptors={request:new qe,response:new qe}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=D(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&be.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:be.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=O.concat(i,o);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let f,u=0,T;if(!l){const h=[et.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,d),T=h.length,f=Promise.resolve(n);u<T;)f=f.then(h[u++],h[u++]);return f}T=c.length;let _=n;for(u=0;u<T;){const h=c[u++],m=c[u++];try{_=h(_)}catch(A){m.call(this,A);break}}try{f=et.call(this,_)}catch(h){return Promise.reject(h)}for(u=0,T=d.length;u<T;)f=f.then(d[u++],d[u++]);return f}getUri(t){t=D(this.defaults,t);const n=Ge(t.baseURL,t.url);return Ie(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){ee.prototype[t]=function(n,r){return this.request(D(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(D(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ee.prototype[t]=n(),ee.prototype[t+"Form"]=n(!0)});const te=ee,Gn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new I(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function Qn(e){return function(n){return e.apply(null,n)}}function Xn(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(we).forEach(([e,t])=>{we[t]=e});const Zn=we;function st(e){const t=new te(e),n=Ce(te.prototype.request,t);return a.extend(n,te.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return st(D(e,s))},n}const w=st(de);w.Axios=te,w.CanceledError=I,w.CancelToken=Gn,w.isCancel=Ve,w.VERSION=nt,w.toFormData=Q,w.AxiosError=y,w.Cancel=w.CanceledError,w.all=function(t){return Promise.all(t)},w.spread=Qn,w.isAxiosError=Xn,w.mergeConfig=D,w.AxiosHeaders=O,w.formToJSON=e=>Ke(a.isHTMLForm(e)?new FormData(e):e),w.getAdapter=Ze.getAdapter,w.HttpStatusCode=Zn,w.default=w;const{Axios:as,AxiosError:er,CanceledError:cs,isCancel:us,CancelToken:ls,VERSION:fs,all:ds,Cancel:ps,isAxiosError:hs,spread:ms,toFormData:ys,AxiosHeaders:gs,HttpStatusCode:bs,formToJSON:ws,getAdapter:Es,mergeConfig:Ts}=w,ot=w.create({headers:{"Content-Type":"application/json"}}),L=async(e,...t)=>{try{return await ot[e](...t)}catch(n){if(!(n instanceof er)||!n.response)throw n;const r=n.response;let s="";switch(r.status){case 400:s="Check parameters or API token";break;case 401:s="You must be logged before using this function, use `auth.login(token)`";break;case 403:s="You dont have enough permissions";break;case 404:s="Check parameters";break;case 409:s="Request conflit with current state";break;case 500:s="Something went wrong with server";break}throw s=`${n.code} (${r.status}) - ${s}: ${r.data.content.message}`,new Error(s)}},p=Object.assign(ot,{$get:async(...e)=>(await L("get",...e)).data,$post:async(...e)=>(await L("post",...e)).data,$put:async(...e)=>(await L("put",...e)).data,$patch:async(...e)=>(await L("patch",...e)).data,$delete:async(...e)=>(await L("delete",...e)).data}),it=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),tr=e=>({...e,namespace:it(e.namespace),createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),nr=e=>({...e,memberships:(e==null?void 0:e.memberships.map(tr))??[],createdAt:b(e.createdAt),updatedAt:e!=null&&e.updatedAt?b(e.updatedAt):void 0}),at=e=>{p.defaults.headers.common.authorization=`Bearer ${e}`},ct=()=>{p.defaults.headers.common.authorization=void 0},ut=()=>{const e=p.defaults.headers.common.authorization;if(!e||typeof e!="string")return!1;const[,t]=e.split("Bearer ");return!!t},rr=Object.freeze(Object.defineProperty({__proto__:null,getCurrentNamespaces:()=>p.$get("/me/namespaces"),getCurrentPermissions:()=>p.$get("/me/permissions"),getCurrentUser:async()=>{const{content:e,...t}=await p.$get("/me");return{...t,content:nr(e)}},isLogged:ut,login:at,logout:ct},Symbol.toStringTag,{value:"Module"})),F=e=>({...e,nextRun:e.nextRun?b(e.nextRun):void 0,lastRun:e.lastRun?b(e.lastRun):void 0}),sr=Object.freeze(Object.defineProperty({__proto__:null,forceCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$post(`/crons/${t}/force`,{});return{...r,content:F(n)}},getAllCrons:async()=>{const{content:e,...t}=await p.$get("/crons");return{...t,content:e.map(F)}},getCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$get(`/crons/${t}`);return{...r,content:F(n)}},startCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$put(`/crons/${t}/start`,{});return{...r,content:F(n)}},stopCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$put(`/crons/${t}/stop`,{});return{...r,content:F(n)}},updateCron:async e=>{const{name:t,...n}=e,{content:r,...s}=await p.$patch(`/crons/${t}`,n);return{...s,content:F(r)}}},Symbol.toStringTag,{value:"Module"})),lt=()=>p.$get("/health"),or=()=>p.$get("/health/all"),ft=e=>p.$get(`/health/${e}`),ir=Object.freeze(Object.defineProperty({__proto__:null,checkAllConnectedService:or,checkConnectedService:ft,checkCurrentService:async()=>{const{content:{current:e}}=await lt();return ft(e)},getAllConnectedServices:lt},Symbol.toStringTag,{value:"Module"}));var dt=(e=>(e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.BIENNIAL="BIENNIAL",e.YEARLY="YEARLY",e))(dt||{});const ne=e=>({...e,nextRun:b(e.nextRun),lastRun:e.lastRun?b(e.lastRun):void 0,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),pt=e=>{const{namespace:t,...n}=e,{namespaceId:r,...s}=ne({namespaceId:t.id,...n});return{...s,namespace:it(t)}},ar=e=>({...e,createdAt:b(e.createdAt)}),cr=e=>({...e,task:pt(e.task),createdAt:b(e.createdAt)}),ht=Object.freeze(Object.defineProperty({__proto__:null,getAllEntries:async(e,t)=>{const{data:{content:n,...r}}=await L("get","/tasks-activity",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(cr)}}},Symbol.toStringTag,{value:"Module"})),ur=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),Ee=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),lr=Object.freeze(Object.defineProperty({__proto__:null,createTasksPreset:async e=>{const{content:t,...n}=await p.$post("/tasks-presets/",e);return{...n,content:Ee(t)}},deleteTasksPreset:async e=>{const t=typeof e=="string"?e:e.id;await p.$delete(`/tasks-presets/${t}`)},getAllTasksPresets:async()=>{const{content:e,...t}=await p.$get("/tasks-presets");return{...t,content:e.map(ur)}},getTasksPreset:async e=>{const t=typeof e=="string"?e:e.id,{content:n,...r}=await p.$get(`/tasks-presets/${t}`);return{...r,content:Ee(n)}},upsertTasksPreset:async e=>{const{id:t,...n}=e,{content:r,...s}=await p.$put(`/tasks-presets/${t}`,n);return{...s,content:Ee(r)}}},Symbol.toStringTag,{value:"Module"})),fr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Te=e=>({...e,added:b(e.added),started:e.started?b(e.started):void 0,ended:e.ended?b(e.ended):void 0}),dr=()=>p.$get("/queues"),pr=async e=>{const t=typeof e=="string"?e:e.name;return p.$get(`/queues/${t}`)},hr=async e=>{const{name:t,...n}=e;return p.$patch(`/queues/${t}`,n)},mr=async e=>{const t=typeof e=="string"?e:e.name;return p.$put(`/queues/${t}/pause`)},yr=async e=>{const t=typeof e=="string"?e:e.name;return p.$put(`/queues/${t}/resume`)},gr=async(e,t)=>{const n=typeof e=="string"?e:e.name,{data:{content:r,...s}}=await L("get",`/queues/${n}/jobs`,{params:t});return{...s,content:r.map(Te)}},q=async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await p.$get(`/queues/${r}/jobs/${s}`,{params:{namespaces:n}});return{...i,content:Te(o)}},br=Object.freeze(Object.defineProperty({__proto__:null,getAllQueues:dr,getJob:q,getQueue:pr,getQueueJobs:gr,pauseQueue:mr,resumeQueue:yr,retryJob:async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await p.$post(`/queues/${r}/jobs/${s}/retry`,{params:{namespaces:n}});return{...i,content:Te(o)}},updateQueue:hr},Symbol.toStringTag,{value:"Module"}));function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ae={exports:{}},j=typeof Reflect=="object"?Reflect:null,mt=j&&typeof j.apply=="function"?j.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},re;j&&typeof j.ownKeys=="function"?re=j.ownKeys:Object.getOwnPropertySymbols?re=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:re=function(t){return Object.getOwnPropertyNames(t)};function Er(e){console&&console.warn&&console.warn(e)}var yt=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}Ae.exports=g,Ae.exports.once=Sr,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var gt=10;function se(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return gt},set:function(e){if(typeof e!="number"||e<0||yt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");gt=e}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||yt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function bt(e){return e._maxListeners===void 0?g.defaultMaxListeners:e._maxListeners}g.prototype.getMaxListeners=function(){return bt(this)},g.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var s=t==="error",o=this._events;if(o!==void 0)s=s&&o.error===void 0;else if(!s)return!1;if(s){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")mt(l,this,n);else for(var d=l.length,f=Rt(l,d),r=0;r<d;++r)mt(f[r],this,n);return!0};function wt(e,t,n,r){var s,o,i;if(se(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),i===void 0)i=o[t]=n,++e._eventsCount;else if(typeof i=="function"?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=bt(e),s>0&&i.length>s&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,Er(c)}return e}g.prototype.addListener=function(t,n){return wt(this,t,n,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(t,n){return wt(this,t,n,!0)};function Tr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Et(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=Tr.bind(r);return s.listener=n,r.wrapFn=s,s}g.prototype.once=function(t,n){return se(n),this.on(t,Et(this,t,n)),this},g.prototype.prependOnceListener=function(t,n){return se(n),this.prependListener(t,Et(this,t,n)),this},g.prototype.removeListener=function(t,n){var r,s,o,i,c;if(se(n),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===n||r[i].listener===n){c=r[i].listener,o=i;break}if(o<0)return this;o===0?r.shift():Ar(r,o),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,c||n)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(t){var n,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),i;for(s=0;s<o.length;++s)i=o[s],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this};function Tt(e,t,n){var r=e._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?Rr(s):Rt(s,s.length)}g.prototype.listeners=function(t){return Tt(this,t,!0)},g.prototype.rawListeners=function(t){return Tt(this,t,!1)},g.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):At.call(e,t)},g.prototype.listenerCount=At;function At(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?re(this._events):[]};function Rt(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Ar(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Rr(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Sr(e,t){return new Promise(function(n,r){function s(i){e.removeListener(t,o),r(i)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}St(e,t,o,{once:!0}),t!=="error"&&_r(e,s,{once:!0})})}function _r(e,t,n){typeof e.on=="function"&&St(e,"error",t,n)}function St(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){r.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var vr=Ae.exports;const Cr=wr(vr),Or=(e,t=new Cr)=>{const n={emit:(o,...i)=>(t.emit(o.toString(),...i),n)},r=e(n),s=Object.assign(r,{on:(o,i)=>(t.on(o.toString(),(...c)=>i(...c)),s),once:(o,i)=>(t.once(o.toString(),(...c)=>i(...c)),s),off:(o,i)=>(t.off(o.toString(),(...c)=>i(...c)),s)});return s},Lr=e=>new Promise(t=>{setTimeout(t,e)}),Nr=e=>({start:b(e.start),end:b(e.end)}),Pr=e=>({...e,createdAt:b(e.createdAt),destroyAt:b(e.destroyAt),period:e.period?Nr(e.period):void 0}),Re=e=>({...e,detail:Pr(e.detail)}),_t=(e,t,n)=>{var s,o;const r=typeof e=="string"?e:e.id;return p.$post(`/tasks/${r}/_run`,null,{params:{test_emails:t==null?void 0:t.testEmails,period_start:(s=t==null?void 0:t.period)==null?void 0:s.start,period_end:(o=t==null?void 0:t.period)==null?void 0:o.end,namespaces:n}})},$r=(...e)=>Or(async t=>{const{content:{id:n,queue:r}}=await _t(...e);t.emit("started",{id:n,queue:r});let s;do{const{content:{progress:o,status:i,result:c}}=await q(r,n,e[2]);s={progress:o,status:i,result:c},t.emit("progress",{progress:o,status:i});let l=1e3;s.status==="active"&&(l=250),await Lr(l)}while(["completed","failed","stuck"].includes(s.status)===!1);if(!s.result)throw new Error("Generation failed with weird error");return Re(s.result)}),U=async(e,t,n)=>(await L("get",`/reports/${e}`,{responseType:n,params:{namespaces:t}})).data,kr=Object.freeze(Object.defineProperty({__proto__:null,getReportDebugByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await q(e,t,n);if(!s)throw new Error("Job have no result");return U(((o=s.detail)==null?void 0:o.files.debug)??"",n,r)},getReportDebugByName:(e,t,n)=>U(`${e}.deb.json`,t,n),getReportDetailByJob:async(e,t,n,r)=>{var i;const{content:{result:s}}=await q(e,t,n);if(!s)throw new Error("Job have no result");const o=await U(((i=s.detail)==null?void 0:i.files.detail)??"",n,r);return!r||r==="json"?Re(o):o},getReportDetailByName:async(e,t,n)=>{const r=await U(`${e}.det.json`,t,n);return!n||n==="json"?Re(r):r},getReportFileByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await q(e,t,n);if(!s)throw new Error("Job have no result");return U(((o=s.detail)==null?void 0:o.files.report)??"",n,r)},getReportFileByName:(e,t,n,r="pdf")=>U(`${e}.rep.${r}`,t,n),startAndListenGeneration:$r,startGeneration:_t},Symbol.toStringTag,{value:"Module"})),xr=Object.freeze(Object.defineProperty({__proto__:null,isLogged:ut,isURLset:()=>!!p.defaults.baseURL,login:at,logout:ct,setURL:e=>{p.defaults.baseURL=e},unsetURL:()=>{p.defaults.baseURL=void 0}},Symbol.toStringTag,{value:"Module"})),Se=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),_e=e=>{const{body:t,tasks:n,...r}=e;return{...Se(r),tasks:n.map(ne),body:t}},Dr=async()=>{const{content:e,...t}=await p.$get("/templates");return{...t,content:e.map(Se)}},Fr=async e=>{const t=typeof e=="string"?e:e.id,{content:n,...r}=await p.$get(`/templates/${t}`);return{...r,content:_e(n)}},jr=async e=>{const{content:t,...n}=await p.$post("/templates",e);return{...n,content:_e(t)}},vt=async e=>{const{id:t,...n}=e,{content:r,...s}=await p.$put(`/templates/${t}`,n);return{...s,content:_e(r)}},Ur=vt,Br=async e=>{const t=typeof e=="string"?e:e.id;await p.$delete(`/templates/${t}`)},k=e=>{const{activity:t,template:n,targets:r,extends:s,...o}=e;return{...pt(o),extends:Se(s),activity:t.map(ar),template:n,targets:r}},Mr=async(e,t)=>{const{data:{content:n,...r}}=await L("get","/tasks",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(({tags:s,_count:o,...i})=>({tags:s,_count:o,...ne(i)}))}},Hr=e=>p.$get("/tasks/_targets",{params:{namespaces:e}}),zr=async(e,t)=>{const{content:n,...r}=await p.$get(`/tasks/_targets/${e}/tasks`,{params:{namespaces:t}});return{...r,content:n.map(({tags:s,...o})=>({tags:s,...ne(o)}))}},Ir=async(e,t,n)=>{const r=typeof t=="string"?t:t.id;await p.$delete(`/tasks/_targets/${e}/tasks/${r}`,{params:{namespaces:n}})},qr=async(e,t)=>{const{content:n,...r}=await p.$post("/tasks",e,{params:{namespaces:t}});return{...r,content:k(n)}},Jr=async(e,t,n)=>{const{content:r,...s}=await p.$post(`/tasks/_from-preset/${e}`,t,{params:{namespaces:n}});return{...s,content:k(r)}},Wr=async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await p.$get(`/tasks/${n}`,{params:{namespaces:t}});return{...s,content:k(r)}},Ct=async(e,t)=>{const{id:n,...r}=e,{content:s,...o}=await p.$put(`/tasks/${n}`,r,{params:{namespaces:t}});return{...o,content:k(s)}},Kr=Object.freeze(Object.defineProperty({__proto__:null,Recurrence:dt,createTask:qr,createTaskFromPreset:Jr,deleteTask:async(e,t)=>{const n=typeof e=="string"?e:e.id;await p.$delete(`/tasks/${n}`,{params:{namespaces:t}})},disableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await p.$put(`/tasks/${n}/_disable`,void 0,{params:{namespaces:t}});return{...s,content:k(r)}},enableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await p.$put(`/tasks/${n}/_enable`,void 0,{params:{namespaces:t}});return{...s,content:k(r)}},getAllTargets:Hr,getAllTasks:Mr,getTask:Wr,getTasksOfTarget:zr,linkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id,{content:o,...i}=await p.$put(`/tasks/${r}/_link/${s}`,void 0,{params:{namespaces:n}});return{...i,content:k(o)}},unlinkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id;await p.$delete(`/tasks/${r}/_link/${s}`,{params:{namespaces:n}})},unsubTargetOfTask:Ir,updateTask:Ct,upsertTask:Ct},Symbol.toStringTag,{value:"Module"})),Yr=Object.freeze(Object.defineProperty({__proto__:null,createTemplate:jr,deleteTemplate:Br,getAllTemplates:Dr,getTemplate:Fr,updateTemplate:Ur,upsertTemplate:vt},Symbol.toStringTag,{value:"Module"})),Vr=Object.freeze(Object.defineProperty({__proto__:null,getAllIndices:e=>p.$get("/elastic/indices",{params:{namespace:e}}),getIndexMapping:(e,t)=>p.$get(`/elastic/indices/${e}`,{params:{namespace:t}})},Symbol.toStringTag,{value:"Module"})),Gr="1.0.0-beta.11";E.auth=rr,E.crons=sr,E.elastic=Vr,E.health=ir,E.history=ht,E.namespaces=fr,E.queues=br,E.reports=kr,E.setup=xr,E.tasks=Kr,E.tasksActivity=ht,E.tasksPresets=lr,E.templates=Yr,E.version=Gr,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
`):" "+Xe(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:me};function ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new I(null,e)}function et(e){return ye(e),e.headers=O.from(e.headers),e.data=he.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ze.getAdapter(e.adapter||de.adapter)(e).then(function(r){return ye(e),r.data=he.call(e,e.transformResponse,r),r.headers=O.from(r.headers),r},function(r){return Ve(r)||(ye(e),r&&r.response&&(r.response.data=he.call(e,e.transformResponse,r.response),r.response.headers=O.from(r.response.headers))),Promise.reject(r)})}const tt=e=>e instanceof O?e.toJSON():e;function D(e,t){t=t||{};const n={};function r(d,f,u){return a.isPlainObject(d)&&a.isPlainObject(f)?a.merge.call({caseless:u},d,f):a.isPlainObject(f)?a.merge({},f):a.isArray(f)?f.slice():f}function s(d,f,u){if(a.isUndefined(f)){if(!a.isUndefined(d))return r(void 0,d,u)}else return r(d,f,u)}function o(d,f){if(!a.isUndefined(f))return r(void 0,f)}function i(d,f){if(a.isUndefined(f)){if(!a.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function c(d,f,u){if(u in t)return r(d,f);if(u in e)return r(void 0,d)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(d,f)=>s(tt(d),tt(f),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(f){const u=l[f]||s,T=u(e[f],t[f],f);a.isUndefined(T)&&u!==c||(n[f]=T)}),n}const nt="1.6.4",ge={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ge[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const rt={};ge.transitional=function(t,n,r){function s(o,i){return"[Axios v"+nt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!rt[i]&&(rt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Vn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],l=c===void 0||i(c,o,e);if(l!==!0)throw new y("option "+o+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const be={assertOptions:Vn,validators:ge},N=be.validators;let ee=class{constructor(t){this.defaults=t,this.interceptors={request:new qe,response:new qe}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=D(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&be.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:be.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=O.concat(i,o);const c=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const d=[];this.interceptors.response.forEach(function(m){d.push(m.fulfilled,m.rejected)});let f,u=0,T;if(!l){const h=[et.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,d),T=h.length,f=Promise.resolve(n);u<T;)f=f.then(h[u++],h[u++]);return f}T=c.length;let _=n;for(u=0;u<T;){const h=c[u++],m=c[u++];try{_=h(_)}catch(A){m.call(this,A);break}}try{f=et.call(this,_)}catch(h){return Promise.reject(h)}for(u=0,T=d.length;u<T;)f=f.then(d[u++],d[u++]);return f}getUri(t){t=D(this.defaults,t);const n=Ge(t.baseURL,t.url);return Ie(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){ee.prototype[t]=function(n,r){return this.request(D(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(D(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}ee.prototype[t]=n(),ee.prototype[t+"Form"]=n(!0)});const te=ee,Gn=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new I(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function Qn(e){return function(n){return e.apply(null,n)}}function Xn(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(we).forEach(([e,t])=>{we[t]=e});const Zn=we;function st(e){const t=new te(e),n=Ce(te.prototype.request,t);return a.extend(n,te.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return st(D(e,s))},n}const w=st(de);w.Axios=te,w.CanceledError=I,w.CancelToken=Gn,w.isCancel=Ve,w.VERSION=nt,w.toFormData=Q,w.AxiosError=y,w.Cancel=w.CanceledError,w.all=function(t){return Promise.all(t)},w.spread=Qn,w.isAxiosError=Xn,w.mergeConfig=D,w.AxiosHeaders=O,w.formToJSON=e=>Ke(a.isHTMLForm(e)?new FormData(e):e),w.getAdapter=Ze.getAdapter,w.HttpStatusCode=Zn,w.default=w;const{Axios:as,AxiosError:er,CanceledError:cs,isCancel:us,CancelToken:ls,VERSION:fs,all:ds,Cancel:ps,isAxiosError:hs,spread:ms,toFormData:ys,AxiosHeaders:gs,HttpStatusCode:bs,formToJSON:ws,getAdapter:Es,mergeConfig:Ts}=w,ot=w.create({headers:{"Content-Type":"application/json"}}),L=async(e,...t)=>{try{return await ot[e](...t)}catch(n){if(!(n instanceof er)||!n.response)throw n;const r=n.response;let s="";switch(r.status){case 400:s="Check parameters or API token";break;case 401:s="You must be logged before using this function, use `auth.login(token)`";break;case 403:s="You dont have enough permissions";break;case 404:s="Check parameters";break;case 409:s="Request conflit with current state";break;case 500:s="Something went wrong with server";break}throw s=`${n.code} (${r.status}) - ${s}: ${r.data.content.message}`,new Error(s)}},p=Object.assign(ot,{$get:async(...e)=>(await L("get",...e)).data,$post:async(...e)=>(await L("post",...e)).data,$put:async(...e)=>(await L("put",...e)).data,$patch:async(...e)=>(await L("patch",...e)).data,$delete:async(...e)=>(await L("delete",...e)).data}),it=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),tr=e=>({...e,namespace:it(e.namespace),createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),nr=e=>({...e,memberships:(e==null?void 0:e.memberships.map(tr))??[],createdAt:b(e.createdAt),updatedAt:e!=null&&e.updatedAt?b(e.updatedAt):void 0}),at=e=>{p.defaults.headers.common.authorization=`Bearer ${e}`},ct=()=>{p.defaults.headers.common.authorization=void 0},ut=()=>{const e=p.defaults.headers.common.authorization;if(!e||typeof e!="string")return!1;const[,t]=e.split("Bearer ");return!!t},rr=Object.freeze(Object.defineProperty({__proto__:null,getCurrentNamespaces:()=>p.$get("/me/namespaces"),getCurrentPermissions:()=>p.$get("/me/permissions"),getCurrentUser:async()=>{const{content:e,...t}=await p.$get("/me");return{...t,content:nr(e)}},isLogged:ut,login:at,logout:ct},Symbol.toStringTag,{value:"Module"})),F=e=>({...e,nextRun:e.nextRun?b(e.nextRun):void 0,lastRun:e.lastRun?b(e.lastRun):void 0}),sr=Object.freeze(Object.defineProperty({__proto__:null,forceCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$post(`/crons/${t}/_force`,{});return{...r,content:F(n)}},getAllCrons:async()=>{const{content:e,...t}=await p.$get("/crons");return{...t,content:e.map(F)}},getCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$get(`/crons/${t}`);return{...r,content:F(n)}},startCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$put(`/crons/${t}/start`,{});return{...r,content:F(n)}},stopCron:async e=>{const t=typeof e=="string"?e:e.name,{content:n,...r}=await p.$put(`/crons/${t}/stop`,{});return{...r,content:F(n)}},updateCron:async e=>{const{name:t,...n}=e,{content:r,...s}=await p.$patch(`/crons/${t}`,n);return{...s,content:F(r)}}},Symbol.toStringTag,{value:"Module"})),lt=()=>p.$get("/health"),or=()=>p.$get("/health/_all"),ft=e=>p.$get(`/health/${e}`),ir=Object.freeze(Object.defineProperty({__proto__:null,checkAllConnectedService:or,checkConnectedService:ft,checkCurrentService:async()=>{const{content:{current:e}}=await lt();return ft(e)},getAllConnectedServices:lt},Symbol.toStringTag,{value:"Module"}));var dt=(e=>(e.DAILY="DAILY",e.WEEKLY="WEEKLY",e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.BIENNIAL="BIENNIAL",e.YEARLY="YEARLY",e))(dt||{});const ne=e=>({...e,nextRun:b(e.nextRun),lastRun:e.lastRun?b(e.lastRun):void 0,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),pt=e=>{const{namespace:t,...n}=e,{namespaceId:r,...s}=ne({namespaceId:t.id,...n});return{...s,namespace:it(t)}},ar=e=>({...e,createdAt:b(e.createdAt)}),cr=e=>({...e,task:pt(e.task),createdAt:b(e.createdAt)}),ht=Object.freeze(Object.defineProperty({__proto__:null,getAllEntries:async(e,t)=>{const{data:{content:n,...r}}=await L("get","/tasks-activity",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(cr)}}},Symbol.toStringTag,{value:"Module"})),ur=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),Ee=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),lr=Object.freeze(Object.defineProperty({__proto__:null,createTasksPreset:async e=>{const{content:t,...n}=await p.$post("/tasks-presets/",e);return{...n,content:Ee(t)}},deleteTasksPreset:async e=>{const t=typeof e=="string"?e:e.id;await p.$delete(`/tasks-presets/${t}`)},getAllTasksPresets:async()=>{const{content:e,...t}=await p.$get("/tasks-presets");return{...t,content:e.map(ur)}},getTasksPreset:async e=>{const t=typeof e=="string"?e:e.id,{content:n,...r}=await p.$get(`/tasks-presets/${t}`);return{...r,content:Ee(n)}},upsertTasksPreset:async e=>{const{id:t,...n}=e,{content:r,...s}=await p.$put(`/tasks-presets/${t}`,n);return{...s,content:Ee(r)}}},Symbol.toStringTag,{value:"Module"})),fr=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Te=e=>({...e,added:b(e.added),started:e.started?b(e.started):void 0,ended:e.ended?b(e.ended):void 0}),dr=()=>p.$get("/queues"),pr=async e=>{const t=typeof e=="string"?e:e.name;return p.$get(`/queues/${t}`)},hr=async e=>{const{name:t,...n}=e;return p.$patch(`/queues/${t}`,n)},mr=async e=>{const t=typeof e=="string"?e:e.name;return p.$put(`/queues/${t}/pause`)},yr=async e=>{const t=typeof e=="string"?e:e.name;return p.$put(`/queues/${t}/resume`)},gr=async(e,t)=>{const n=typeof e=="string"?e:e.name,{data:{content:r,...s}}=await L("get",`/queues/${n}/jobs`,{params:t});return{...s,content:r.map(Te)}},q=async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await p.$get(`/queues/${r}/jobs/${s}`,{params:{namespaces:n}});return{...i,content:Te(o)}},br=Object.freeze(Object.defineProperty({__proto__:null,getAllQueues:dr,getJob:q,getQueue:pr,getQueueJobs:gr,pauseQueue:mr,resumeQueue:yr,retryJob:async(e,t,n)=>{const r=typeof e=="string"?e:e.name,s=typeof t=="string"||typeof t=="number"?t:t.id,{content:o,...i}=await p.$post(`/queues/${r}/jobs/${s}/_retry`,{params:{namespaces:n}});return{...i,content:Te(o)}},updateQueue:hr},Symbol.toStringTag,{value:"Module"}));function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ae={exports:{}},j=typeof Reflect=="object"?Reflect:null,mt=j&&typeof j.apply=="function"?j.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},re;j&&typeof j.ownKeys=="function"?re=j.ownKeys:Object.getOwnPropertySymbols?re=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:re=function(t){return Object.getOwnPropertyNames(t)};function Er(e){console&&console.warn&&console.warn(e)}var yt=Number.isNaN||function(t){return t!==t};function g(){g.init.call(this)}Ae.exports=g,Ae.exports.once=Sr,g.EventEmitter=g,g.prototype._events=void 0,g.prototype._eventsCount=0,g.prototype._maxListeners=void 0;var gt=10;function se(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(g,"defaultMaxListeners",{enumerable:!0,get:function(){return gt},set:function(e){if(typeof e!="number"||e<0||yt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");gt=e}}),g.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},g.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||yt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function bt(e){return e._maxListeners===void 0?g.defaultMaxListeners:e._maxListeners}g.prototype.getMaxListeners=function(){return bt(this)},g.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var s=t==="error",o=this._events;if(o!==void 0)s=s&&o.error===void 0;else if(!s)return!1;if(s){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")mt(l,this,n);else for(var d=l.length,f=Rt(l,d),r=0;r<d;++r)mt(f[r],this,n);return!0};function wt(e,t,n,r){var s,o,i;if(se(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),i===void 0)i=o[t]=n,++e._eventsCount;else if(typeof i=="function"?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=bt(e),s>0&&i.length>s&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,Er(c)}return e}g.prototype.addListener=function(t,n){return wt(this,t,n,!1)},g.prototype.on=g.prototype.addListener,g.prototype.prependListener=function(t,n){return wt(this,t,n,!0)};function Tr(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Et(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=Tr.bind(r);return s.listener=n,r.wrapFn=s,s}g.prototype.once=function(t,n){return se(n),this.on(t,Et(this,t,n)),this},g.prototype.prependOnceListener=function(t,n){return se(n),this.prependListener(t,Et(this,t,n)),this},g.prototype.removeListener=function(t,n){var r,s,o,i,c;if(se(n),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===n||r[i].listener===n){c=r[i].listener,o=i;break}if(o<0)return this;o===0?r.shift():Ar(r,o),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,c||n)}return this},g.prototype.off=g.prototype.removeListener,g.prototype.removeAllListeners=function(t){var n,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),i;for(s=0;s<o.length;++s)i=o[s],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this};function Tt(e,t,n){var r=e._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?Rr(s):Rt(s,s.length)}g.prototype.listeners=function(t){return Tt(this,t,!0)},g.prototype.rawListeners=function(t){return Tt(this,t,!1)},g.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):At.call(e,t)},g.prototype.listenerCount=At;function At(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}g.prototype.eventNames=function(){return this._eventsCount>0?re(this._events):[]};function Rt(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function Ar(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Rr(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Sr(e,t){return new Promise(function(n,r){function s(i){e.removeListener(t,o),r(i)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}St(e,t,o,{once:!0}),t!=="error"&&_r(e,s,{once:!0})})}function _r(e,t,n){typeof e.on=="function"&&St(e,"error",t,n)}function St(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){r.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var vr=Ae.exports;const Cr=wr(vr),Or=(e,t=new Cr)=>{const n={emit:(o,...i)=>(t.emit(o.toString(),...i),n)},r=e(n),s=Object.assign(r,{on:(o,i)=>(t.on(o.toString(),(...c)=>i(...c)),s),once:(o,i)=>(t.once(o.toString(),(...c)=>i(...c)),s),off:(o,i)=>(t.off(o.toString(),(...c)=>i(...c)),s)});return s},Lr=e=>new Promise(t=>{setTimeout(t,e)}),Nr=e=>({start:b(e.start),end:b(e.end)}),Pr=e=>({...e,createdAt:b(e.createdAt),destroyAt:b(e.destroyAt),period:e.period?Nr(e.period):void 0}),Re=e=>({...e,detail:Pr(e.detail)}),_t=(e,t,n)=>{var s,o;const r=typeof e=="string"?e:e.id;return p.$post(`/tasks/${r}/_run`,null,{params:{test_emails:t==null?void 0:t.testEmails,period_start:(s=t==null?void 0:t.period)==null?void 0:s.start,period_end:(o=t==null?void 0:t.period)==null?void 0:o.end,namespaces:n}})},$r=(...e)=>Or(async t=>{const{content:{id:n,queue:r}}=await _t(...e);t.emit("started",{id:n,queue:r});let s;do{const{content:{progress:o,status:i,result:c}}=await q(r,n,e[2]);s={progress:o,status:i,result:c},t.emit("progress",{progress:o,status:i});let l=1e3;s.status==="active"&&(l=250),await Lr(l)}while(["completed","failed","stuck"].includes(s.status)===!1);if(!s.result)throw new Error("Generation failed with weird error");return Re(s.result)}),U=async(e,t,n)=>(await L("get",`/reports/${e}`,{responseType:n,params:{namespaces:t}})).data,kr=Object.freeze(Object.defineProperty({__proto__:null,getReportDebugByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await q(e,t,n);if(!s)throw new Error("Job have no result");return U(((o=s.detail)==null?void 0:o.files.debug)??"",n,r)},getReportDebugByName:(e,t,n)=>U(`${e}.deb.json`,t,n),getReportDetailByJob:async(e,t,n,r)=>{var i;const{content:{result:s}}=await q(e,t,n);if(!s)throw new Error("Job have no result");const o=await U(((i=s.detail)==null?void 0:i.files.detail)??"",n,r);return!r||r==="json"?Re(o):o},getReportDetailByName:async(e,t,n)=>{const r=await U(`${e}.det.json`,t,n);return!n||n==="json"?Re(r):r},getReportFileByJob:async(e,t,n,r)=>{var o;const{content:{result:s}}=await q(e,t,n);if(!s)throw new Error("Job have no result");return U(((o=s.detail)==null?void 0:o.files.report)??"",n,r)},getReportFileByName:(e,t,n,r="pdf")=>U(`${e}.rep.${r}`,t,n),startAndListenGeneration:$r,startGeneration:_t},Symbol.toStringTag,{value:"Module"})),xr=Object.freeze(Object.defineProperty({__proto__:null,isLogged:ut,isURLset:()=>!!p.defaults.baseURL,login:at,logout:ct,setURL:e=>{p.defaults.baseURL=e},unsetURL:()=>{p.defaults.baseURL=void 0}},Symbol.toStringTag,{value:"Module"})),Se=e=>({...e,createdAt:b(e.createdAt),updatedAt:e.updatedAt?b(e.updatedAt):void 0}),_e=e=>{const{body:t,tasks:n,...r}=e;return{...Se(r),tasks:n.map(ne),body:t}},Dr=async()=>{const{content:e,...t}=await p.$get("/templates");return{...t,content:e.map(Se)}},Fr=async e=>{const t=typeof e=="string"?e:e.id,{content:n,...r}=await p.$get(`/templates/${t}`);return{...r,content:_e(n)}},jr=async e=>{const{content:t,...n}=await p.$post("/templates",e);return{...n,content:_e(t)}},vt=async e=>{const{id:t,...n}=e,{content:r,...s}=await p.$put(`/templates/${t}`,n);return{...s,content:_e(r)}},Ur=vt,Br=async e=>{const t=typeof e=="string"?e:e.id;await p.$delete(`/templates/${t}`)},k=e=>{const{activity:t,template:n,targets:r,extends:s,...o}=e;return{...pt(o),extends:Se(s),activity:t.map(ar),template:n,targets:r}},Mr=async(e,t)=>{const{data:{content:n,...r}}=await L("get","/tasks",{params:{namespaces:t,...e??{}}});return{...r,content:n.map(({tags:s,_count:o,...i})=>({tags:s,_count:o,...ne(i)}))}},Hr=e=>p.$get("/tasks/_targets",{params:{namespaces:e}}),zr=async(e,t)=>{const{content:n,...r}=await p.$get(`/tasks/_targets/${e}/tasks`,{params:{namespaces:t}});return{...r,content:n.map(({tags:s,...o})=>({tags:s,...ne(o)}))}},Ir=async(e,t,n)=>{const r=typeof t=="string"?t:t.id;await p.$delete(`/tasks/_targets/${e}/tasks/${r}`,{params:{namespaces:n}})},qr=async(e,t)=>{const{content:n,...r}=await p.$post("/tasks",e,{params:{namespaces:t}});return{...r,content:k(n)}},Jr=async(e,t,n)=>{const{content:r,...s}=await p.$post(`/tasks/_from-preset/${e}`,t,{params:{namespaces:n}});return{...s,content:k(r)}},Wr=async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await p.$get(`/tasks/${n}`,{params:{namespaces:t}});return{...s,content:k(r)}},Ct=async(e,t)=>{const{id:n,...r}=e,{content:s,...o}=await p.$put(`/tasks/${n}`,r,{params:{namespaces:t}});return{...o,content:k(s)}},Kr=Object.freeze(Object.defineProperty({__proto__:null,Recurrence:dt,createTask:qr,createTaskFromPreset:Jr,deleteTask:async(e,t)=>{const n=typeof e=="string"?e:e.id;await p.$delete(`/tasks/${n}`,{params:{namespaces:t}})},disableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await p.$put(`/tasks/${n}/_disable`,void 0,{params:{namespaces:t}});return{...s,content:k(r)}},enableTask:async(e,t)=>{const n=typeof e=="string"?e:e.id,{content:r,...s}=await p.$put(`/tasks/${n}/_enable`,void 0,{params:{namespaces:t}});return{...s,content:k(r)}},getAllTargets:Hr,getAllTasks:Mr,getTask:Wr,getTasksOfTarget:zr,linkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id,{content:o,...i}=await p.$put(`/tasks/${r}/_link/${s}`,void 0,{params:{namespaces:n}});return{...i,content:k(o)}},unlinkTaskToTemplate:async(e,t,n)=>{const r=typeof e=="string"?e:e.id,s=typeof t=="string"?t:t.id;await p.$delete(`/tasks/${r}/_link/${s}`,{params:{namespaces:n}})},unsubTargetOfTask:Ir,updateTask:Ct,upsertTask:Ct},Symbol.toStringTag,{value:"Module"})),Yr=Object.freeze(Object.defineProperty({__proto__:null,createTemplate:jr,deleteTemplate:Br,getAllTemplates:Dr,getTemplate:Fr,updateTemplate:Ur,upsertTemplate:vt},Symbol.toStringTag,{value:"Module"})),Vr=Object.freeze(Object.defineProperty({__proto__:null,getAllIndices:e=>p.$get("/elastic/indices",{params:{namespace:e}}),getIndexMapping:(e,t)=>p.$get(`/elastic/indices/${e}`,{params:{namespace:t}})},Symbol.toStringTag,{value:"Module"})),Gr="1.0.0-beta.12";E.auth=rr,E.crons=sr,E.elastic=Vr,E.health=ir,E.history=ht,E.namespaces=fr,E.queues=br,E.reports=kr,E.setup=xr,E.tasks=Kr,E.tasksActivity=ht,E.tasksPresets=lr,E.templates=Yr,E.version=Gr,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
6
6
|
//# sourceMappingURL=ezreeport-sdk-js.umd.js.map
|