firstly 0.0.11 → 0.0.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/esm/BaseEnum.d.ts +2 -0
  3. package/esm/BaseEnum.js +2 -0
  4. package/esm/FF_Fields.js +0 -1
  5. package/esm/ROUTES.d.ts +2 -2
  6. package/esm/ROUTES.js +10 -5
  7. package/esm/SqlDatabase/FF_LogToConsole.d.ts +1 -0
  8. package/esm/SqlDatabase/FF_LogToConsole.js +22 -16
  9. package/esm/api/index.d.ts +19 -21
  10. package/esm/api/index.js +72 -62
  11. package/esm/auth/{client/Auth.d.ts → AuthController.d.ts} +18 -25
  12. package/esm/auth/{client/Auth.js → AuthController.js} +48 -44
  13. package/esm/auth/{client/Entities.d.ts → Entities.d.ts} +4 -3
  14. package/esm/auth/{client/Entities.js → Entities.js} +7 -7
  15. package/esm/auth/README.md +0 -10
  16. package/esm/auth/index.d.ts +5 -149
  17. package/esm/auth/index.js +5 -316
  18. package/esm/auth/{AuthController.server.d.ts → server/AuthController.server.d.ts} +10 -10
  19. package/esm/auth/{AuthController.server.js → server/AuthController.server.js} +126 -164
  20. package/esm/auth/server/handleAuth.d.ts +2 -0
  21. package/esm/auth/server/handleAuth.js +140 -0
  22. package/esm/auth/server/helperDb.d.ts +10 -0
  23. package/esm/auth/server/helperDb.js +56 -0
  24. package/esm/auth/server/helperFirstly.d.ts +1 -0
  25. package/esm/auth/server/helperFirstly.js +8 -0
  26. package/esm/auth/server/helperOslo.d.ts +7 -0
  27. package/esm/auth/server/helperOslo.js +24 -0
  28. package/esm/auth/server/helperRemultServer.d.ts +5 -0
  29. package/esm/auth/server/helperRemultServer.js +44 -0
  30. package/esm/auth/{RoleHelpers.d.ts → server/helperRole.d.ts} +1 -1
  31. package/esm/auth/{RoleHelpers.js → server/helperRole.js} +1 -1
  32. package/esm/auth/server/index.d.ts +5 -0
  33. package/esm/auth/server/index.js +5 -0
  34. package/esm/auth/server/module.d.ts +238 -0
  35. package/esm/auth/server/module.js +184 -0
  36. package/esm/auth/{providers → server/providers}/github.d.ts +6 -5
  37. package/esm/auth/{providers → server/providers}/github.js +30 -21
  38. package/esm/auth/{providers/index.d.ts → server/providers/helperProvider.d.ts} +0 -2
  39. package/esm/auth/{providers/index.js → server/providers/helperProvider.js} +5 -6
  40. package/esm/auth/static/assets/{Page-BEFYPjis.d.ts → Page-Bb8bFlrP.d.ts} +1 -1
  41. package/esm/auth/static/assets/{Page-DtgkOCJs.js → Page-Bb8bFlrP.js} +1 -1
  42. package/esm/auth/static/assets/{Page-DtgkOCJs.d.ts → Page-BxomFlZ8.d.ts} +1 -1
  43. package/esm/auth/static/assets/{Page-BEFYPjis.js → Page-BxomFlZ8.js} +1 -1
  44. package/esm/auth/static/assets/Page-CaIYu0-y.d.ts +6 -0
  45. package/esm/auth/static/assets/Page-CaIYu0-y.js +19 -0
  46. package/esm/auth/static/assets/Page-MkYglNtu.css +1 -0
  47. package/esm/auth/static/assets/index-Bl0Bk5u0.d.ts +64 -0
  48. package/esm/auth/static/assets/index-Bl0Bk5u0.js +2 -0
  49. package/esm/auth/static/assets/{index-CR_3yNaJ.css → index-R27C_TlP.css} +1 -1
  50. package/esm/auth/static/index.html +2 -2
  51. package/esm/auth/types.d.ts +5 -0
  52. package/esm/bin/cmd.js +3 -6
  53. package/esm/cellsBuildor.js +6 -6
  54. package/esm/changeLog/index.d.ts +0 -36
  55. package/esm/changeLog/index.js +3 -43
  56. package/esm/changeLog/server/index.d.ts +36 -0
  57. package/esm/changeLog/server/index.js +42 -0
  58. package/esm/cron/{index.d.ts → server/index.d.ts} +1 -1
  59. package/esm/cron/server/index.js +103 -0
  60. package/esm/feedback/FeedbackController.js +3 -3
  61. package/esm/feedback/index.d.ts +0 -16
  62. package/esm/feedback/index.js +0 -11
  63. package/esm/feedback/server/index.d.ts +17 -0
  64. package/esm/feedback/server/index.js +13 -0
  65. package/esm/helper.js +3 -3
  66. package/esm/index.d.ts +2 -16
  67. package/esm/index.js +2 -3
  68. package/esm/mail/index.d.ts +2 -30
  69. package/esm/mail/index.js +2 -79
  70. package/esm/mail/server/index.d.ts +31 -0
  71. package/esm/mail/server/index.js +88 -0
  72. package/esm/storeItem.d.ts +4 -1
  73. package/esm/storeItem.js +8 -2
  74. package/esm/storeList.d.ts +5 -2
  75. package/esm/storeList.js +1 -1
  76. package/esm/sveltekit/server/index.d.ts +11 -0
  77. package/esm/sveltekit/server/index.js +21 -0
  78. package/esm/ui/Clipboardable.svelte +5 -2
  79. package/esm/ui/Field.svelte +3 -0
  80. package/esm/ui/Loading.svelte +4 -1
  81. package/esm/ui/Tooltip.svelte +1 -1
  82. package/esm/ui/dialog/DialogForm.svelte +1 -1
  83. package/esm/ui/dialog/DialogPrimitive.svelte +0 -1
  84. package/esm/ui/dialog/dialog.d.ts +6 -3
  85. package/esm/ui/dialog/dialog.js +1 -1
  86. package/esm/ui/internals/FieldContainer.svelte +0 -1
  87. package/esm/vite/index.js +24 -25
  88. package/package.json +50 -38
  89. package/esm/auth/Adapter.d.ts +0 -10
  90. package/esm/auth/Adapter.js +0 -50
  91. package/esm/auth/client/index.d.ts +0 -7
  92. package/esm/auth/client/index.js +0 -7
  93. package/esm/auth/helper.d.ts +0 -6
  94. package/esm/auth/helper.js +0 -14
  95. package/esm/auth/providers/strava.d.ts +0 -30
  96. package/esm/auth/providers/strava.js +0 -60
  97. package/esm/auth/static/assets/Page-BGTO8LC5.css +0 -1
  98. package/esm/auth/static/assets/Page-Cfysx_UV.d.ts +0 -6
  99. package/esm/auth/static/assets/Page-Cfysx_UV.js +0 -18
  100. package/esm/auth/static/assets/index-QypqCYwC.d.ts +0 -63
  101. package/esm/auth/static/assets/index-QypqCYwC.js +0 -2
  102. package/esm/cron/index.js +0 -102
  103. package/esm/handle/index.d.ts +0 -7
  104. package/esm/handle/index.js +0 -40
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Page-Cfysx_UV.js","assets/Page-BGTO8LC5.css"])))=>i.map(i=>d[i]);
2
- var me=Object.defineProperty;var ye=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var v=(e,t,n)=>ye(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const c of r.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(s){if(s.ep)return;s.ep=!0;const r=n(s);fetch(s.href,r)}})();const ge="modulepreload",be=function(e){return"/api/static/"+e},X={},R=function(t,n,o){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),c=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));s=Promise.all(n.map(u=>{if(u=be(u),u in X)return;X[u]=!0;const l=u.endsWith(".css"),i=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${i}`))return;const a=document.createElement("link");if(a.rel=l?"stylesheet":ge,l||(a.as="script",a.crossOrigin=""),a.href=u,c&&a.setAttribute("nonce",c),document.head.appendChild(a),l)return new Promise((f,d)=>{a.addEventListener("load",f),a.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${u}`)))})}))}return s.then(()=>t()).catch(r=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=r,window.dispatchEvent(c),!c.defaultPrevented)throw r})};function _(){}function ve(e,t){for(const n in t)e[n]=t[n];return e}function we(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function N(e,t,n,o,s){e.__svelte_meta={loc:{file:t,line:n,column:o,char:s}}}function te(e){return e()}function z(){return Object.create(null)}function S(e){e.forEach(te)}function T(e){return typeof e=="function"}function $e(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function Ye(e,t){return e!=e?t==t:e!==t}function ke(e){return Object.keys(e).length===0}function Ze(e,t){if(e!=null&&typeof e.subscribe!="function")throw new Error(`'${t}' is not a store with a 'subscribe' method`)}function ne(e,...t){if(e==null){for(const o of t)o(void 0);return _}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function et(e){let t;return ne(e,n=>t=n)(),t}function tt(e,t,n){e.$$.on_destroy.push(ne(t,n))}function nt(e,t,n,o){if(e){const s=oe(e,t,n,o);return e[0](s)}}function oe(e,t,n,o){return e[1]&&o?ve(n.ctx.slice(),e[1](o(t))):n.ctx}function ot(e,t,n,o){if(e[2]&&o){const s=e[2](o(n));if(t.dirty===void 0)return s;if(typeof s=="object"){const r=[],c=Math.max(t.dirty.length,s.length);for(let u=0;u<c;u+=1)r[u]=t.dirty[u]|s[u];return r}return t.dirty|s}return t.dirty}function rt(e,t,n,o,s,r){if(s){const c=oe(t,n,o,r);e.p(c,s)}}function st(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let o=0;o<n;o++)t[o]=-1;return t}return-1}function ct(e){const t={};for(const n in e)n[0]!=="$"&&(t[n]=e[n]);return t}function it(e,t){const n={};t=new Set(t);for(const o in e)!t.has(o)&&o[0]!=="$"&&(n[o]=e[o]);return n}function ut(e,t,n){return e.set(n),t}function lt(e){return e&&T(e.destroy)?e.destroy:_}const Ee=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function De(e,t){e.appendChild(t)}function Oe(e,t,n){e.insertBefore(t,n||null)}function re(e){e.parentNode&&e.parentNode.removeChild(e)}function Se(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function q(e){return document.createElement(e)}function V(e){return document.createTextNode(e)}function se(){return V(" ")}function ce(){return V("")}function Ae(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function ft(e){return function(t){return t.preventDefault(),e.call(this,t)}}function ie(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const Re=["width","height"];function at(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const o in t)t[o]==null?e.removeAttribute(o):o==="style"?e.style.cssText=t[o]:o==="__value"?e.value=e[o]=t[o]:n[o]&&n[o].set&&Re.indexOf(o)===-1?e[o]=t[o]:ie(e,o,t[o])}function xe(e){return Array.from(e.childNodes)}function dt(e,t){e.value=t??""}function _t(e,t,n){e.classList.toggle(t,!!n)}function Pe(e,t,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:o})}let D;function p(e){D=e}function E(){if(!D)throw new Error("Function called outside component initialization");return D}function G(e){E().$$.on_mount.push(e)}function ht(e){E().$$.on_destroy.push(e)}function pt(e,t){return E().$$.context.set(e,t),t}function mt(e){return E().$$.context.get(e)}function yt(e){return E().$$.context.has(e)}function gt(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(o=>o.call(this,t))}const $=[],H=[];let k=[];const P=[],je=Promise.resolve();let j=!1;function Ce(){j||(j=!0,je.then(F))}function C(e){k.push(e)}function bt(e){P.push(e)}const x=new Set;let w=0;function F(){if(w!==0)return;const e=D;do{try{for(;w<$.length;){const t=$[w];w++,p(t),Le(t.$$)}}catch(t){throw $.length=0,w=0,t}for(p(null),$.length=0,w=0;H.length;)H.pop()();for(let t=0;t<k.length;t+=1){const n=k[t];x.has(n)||(x.add(n),n())}k.length=0}while($.length);for(;P.length;)P.pop()();j=!1,x.clear(),p(e)}function Le(e){if(e.fragment!==null){e.update(),S(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(C)}}function Me(e){const t=[],n=[];k.forEach(o=>e.indexOf(o)===-1?t.push(o):n.push(o)),n.forEach(o=>o()),k=t}const A=new Set;let g;function ue(){g={r:0,c:[],p:g}}function le(){g.r||S(g.c),g=g.p}function b(e,t){e&&e.i&&(A.delete(e),e.i(t))}function O(e,t,n,o){if(e&&e.o){if(A.has(e))return;A.add(e),g.c.push(()=>{A.delete(e),o&&(n&&e.d(1),o())}),e.o(t)}else o&&o()}function J(e,t){const n=t.token={};function o(s,r,c,u){if(t.token!==n)return;t.resolved=u;let l=t.ctx;c!==void 0&&(l=l.slice(),l[c]=u);const i=s&&(t.current=s)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach((f,d)=>{d!==r&&f&&(ue(),O(f,1,1,()=>{t.blocks[d]===f&&(t.blocks[d]=null)}),le())}):t.block.d(1),i.c(),b(i,1),i.m(t.mount(),t.anchor),a=!0),t.block=i,t.blocks&&(t.blocks[r]=i),a&&F()}if(we(e)){const s=E();if(e.then(r=>{p(s),o(t.then,1,t.value,r),p(null)},r=>{if(p(s),o(t.catch,2,t.error,r),p(null),!t.hasCatch)throw r}),t.current!==t.pending)return o(t.pending,0),!0}else{if(t.current!==t.then)return o(t.then,1,t.value,e),!0;t.resolved=e}}function Be(e,t,n){const o=t.slice(),{resolved:s}=e;e.current===e.then&&(o[e.value]=s),e.current===e.catch&&(o[e.error]=s),e.block.p(o,n)}function Ie(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function vt(e,t,n){const o=e.$$.props[t];o!==void 0&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function Ne(e){e&&e.c()}function fe(e,t,n){const{fragment:o,after_update:s}=e.$$;o&&o.m(t,n),C(()=>{const r=e.$$.on_mount.map(te).filter(T);e.$$.on_destroy?e.$$.on_destroy.push(...r):S(r),e.$$.on_mount=[]}),s.forEach(C)}function ae(e,t){const n=e.$$;n.fragment!==null&&(Me(n.after_update),S(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Te(e,t){e.$$.dirty[0]===-1&&($.push(e),Ce(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function qe(e,t,n,o,s,r,c=null,u=[-1]){const l=D;p(e);const i=e.$$={fragment:null,ctx:[],props:r,update:_,not_equal:s,bound:z(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:z(),dirty:u,skip_bound:!1,root:t.target||l.$$.root};c&&c(i.root);let a=!1;if(i.ctx=n?n(e,t.props||{},(f,d,...K)=>{const W=K.length?K[0]:d;return i.ctx&&s(i.ctx[f],i.ctx[f]=W)&&(!i.skip_bound&&i.bound[f]&&i.bound[f](W),a&&Te(e,f)),d}):[],i.update(),a=!0,S(i.before_update),i.fragment=o?o(i.ctx):!1,t.target){if(t.hydrate){const f=xe(t.target);i.fragment&&i.fragment.l(f),f.forEach(re)}else i.fragment&&i.fragment.c();t.intro&&b(e.$$.fragment),fe(e,t.target,t.anchor),F()}p(l)}class Ve{constructor(){v(this,"$$");v(this,"$$set")}$destroy(){ae(this,1),this.$destroy=_}$on(t,n){if(!T(n))return _;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const s=o.indexOf(n);s!==-1&&o.splice(s,1)}}$set(t){this.$$set&&!ke(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Fe="4.2.18",Ue="4";function h(e,t){document.dispatchEvent(Pe(e,{version:Fe,...t},{bubbles:!0}))}function wt(e,t){h("SvelteDOMInsert",{target:e,node:t}),De(e,t)}function m(e,t,n){h("SvelteDOMInsert",{target:e,node:t,anchor:n}),Oe(e,t,n)}function y(e){h("SvelteDOMRemove",{node:e}),re(e)}function Ke(e,t,n,o,s,r,c){const u=o===!0?["capture"]:o?Array.from(Object.keys(o)):[];s&&u.push("preventDefault"),r&&u.push("stopPropagation"),c&&u.push("stopImmediatePropagation"),h("SvelteDOMAddEventListener",{node:e,event:t,handler:n,modifiers:u});const l=Ae(e,t,n,o);return()=>{h("SvelteDOMRemoveEventListener",{node:e,event:t,handler:n,modifiers:u}),l()}}function de(e,t,n){ie(e,t,n),n==null?h("SvelteDOMRemoveAttribute",{node:e,attribute:t}):h("SvelteDOMSetAttribute",{node:e,attribute:t,value:n})}function We(e,t){t=""+t,e.data!==t&&(h("SvelteDOMSetData",{node:e,data:t}),e.data=t)}function Q(e){if(typeof e!="string"&&!(e&&typeof e=="object"&&"length"in e)&&!(typeof Symbol=="function"&&e&&Symbol.iterator in e))throw new Error("{#each} only works with iterable values.");return Ie(e)}function Xe(e,t,n){for(const o of Object.keys(t))~n.indexOf(o)||console.warn(`<${e}> received an unexpected slot "${o}".`)}class ze extends Ve{constructor(n){if(!n||!n.target&&!n.$$inline)throw new Error("'target' is a required option");super();v(this,"$$prop_def");v(this,"$$events_def");v(this,"$$slot_def")}$destroy(){super.$destroy(),this.$destroy=()=>{console.warn("Component was already destroyed")}}$capture_state(){}$inject_state(){}}typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ue);const{Object:Ge,console:Y}=Ee,U="src/App.svelte";function Z(e,t,n){const o=e.slice();return o[6]=t[n],o}function ee(e){e[9]=e[10].default}function L(e){let t,n,o,s={ctx:e,current:null,token:null,hasCatch:!1,pending:pe,then:he,catch:_e,value:10,blocks:[,,,]};J(n=e[1],s);const r={c:function(){t=ce(),s.block.c()},m:function(u,l){m(u,t,l),s.block.m(u,s.anchor=l),s.mount=()=>t.parentNode,s.anchor=t,o=!0},p:function(u,l){e=u,s.ctx=e,l&2&&n!==(n=e[1])&&J(n,s)||Be(s,e,l)},i:function(u){o||(b(s.block),o=!0)},o:function(u){for(let l=0;l<3;l+=1){const i=s.blocks[l];O(i)}o=!1},d:function(u){u&&y(t),s.block.d(u),s.token=null,s=null}};return h("SvelteRegisterBlock",{block:r,id:L.name,type:"if",source:"(19:2) {#if activeModuleRef}",ctx:e}),r}function _e(e){const t={c:_,m:_,p:_,i:_,o:_,d:_};return h("SvelteRegisterBlock",{block:t,id:_e.name,type:"catch",source:'(1:0) <script lang=\\"ts\\">import { onMount }',ctx:e}),t}function he(e){ee(e);let t,n;t=new e[9]({props:{firstlyData:e[0]},$$inline:!0});const o={c:function(){Ne(t.$$.fragment)},m:function(r,c){fe(t,r,c),n=!0},p:function(r,c){ee(r);const u={};c&1&&(u.firstlyData=r[0]),t.$set(u)},i:function(r){n||(b(t.$$.fragment,r),n=!0)},o:function(r){O(t.$$.fragment,r),n=!1},d:function(r){ae(t,r)}};return h("SvelteRegisterBlock",{block:o,id:he.name,type:"then",source:"(20:62) <ModuleComponent {firstlyData}",ctx:e}),o}function pe(e){const t={c:_,m:_,p:_,i:_,o:_,d:_};return h("SvelteRegisterBlock",{block:t,id:pe.name,type:"pending",source:'(1:0) <script lang=\\"ts\\">import { onMount }',ctx:e}),t}function M(e){let t=console.info(e[0])+"",n,o,s,r=Q(e[3]()),c=[];for(let l=0;l<r.length;l+=1)c[l]=B(Z(e,r,l));const u={c:function(){n=V(t),o=se(),s=q("div");for(let i=0;i<c.length;i+=1)c[i].c();de(s,"class","debug s-XsEmFtvddWTw"),N(s,U,38,2,681)},m:function(i,a){m(i,n,a),m(i,o,a),m(i,s,a);for(let f=0;f<c.length;f+=1)c[f]&&c[f].m(s,null)},p:function(i,a){if(a&1&&t!==(t=console.info(i[0])+"")&&We(n,t),a&12){r=Q(i[3]());let f;for(f=0;f<r.length;f+=1){const d=Z(i,r,f);c[f]?c[f].p(d,a):(c[f]=B(d),c[f].c(),c[f].m(s,null))}for(;f<c.length;f+=1)c[f].d(1);c.length=r.length}},d:function(i){i&&(y(n),y(o),y(s)),Se(c,i)}};return h("SvelteRegisterBlock",{block:u,id:M.name,type:"if",source:"(26:0) {#if firstlyData.debug}",ctx:e}),u}function B(e){let t,n,o;function s(){return e[4](e[6])}const r={c:function(){t=q("button"),t.textContent=`Load ${e[6]}`,de(t,"class","s-XsEmFtvddWTw"),N(t,U,40,6,739)},m:function(u,l){m(u,t,l),n||(o=Ke(t,"click",s,!1,!1,!1,!1),n=!0)},p:function(u,l){e=u},d:function(u){u&&y(t),n=!1,o()}};return h("SvelteRegisterBlock",{block:r,id:B.name,type:"each",source:"(29:4) {#each getKeys() as module}",ctx:e}),r}function I(e){let t,n,o,s,r=e[1]&&L(e),c=e[0].debug&&M(e);const u={c:function(){t=q("main"),r&&r.c(),n=se(),c&&c.c(),o=ce(),N(t,U,28,0,461)},l:function(i){throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option")},m:function(i,a){m(i,t,a),r&&r.m(t,null),m(i,n,a),c&&c.m(i,a),m(i,o,a),s=!0},p:function(i,[a]){i[1]?r?(r.p(i,a),a&2&&b(r,1)):(r=L(i),r.c(),b(r,1),r.m(t,null)):r&&(ue(),O(r,1,1,()=>{r=null}),le()),i[0].debug?c?c.p(i,a):(c=M(i),c.c(),c.m(o.parentNode,o)):c&&(c.d(1),c=null)},i:function(i){s||(b(r),s=!0)},o:function(i){O(r),s=!1},d:function(i){i&&(y(t),y(n),y(o)),r&&r.d(),c&&c.d(i)}};return h("SvelteRegisterBlock",{block:u,id:I.name,type:"component",source:"",ctx:e}),u}function He(e,t,n){let{$$slots:o={},$$scope:s}=t;Xe("App",o,[]);let{firstlyData:r}=t;const c={auth:R(()=>import("./Page-Cfysx_UV.js"),__vite__mapDeps([0,1])),admin:R(()=>import("./Page-BEFYPjis.js"),[]),storage:R(()=>import("./Page-DtgkOCJs.js"),[])};let u;function l(d){n(1,u=c[d])}const i=()=>Object.keys(c);G(()=>{l(r.module)}),e.$$.on_mount.push(function(){r===void 0&&!("firstlyData"in t||e.$$.bound[e.$$.props.firstlyData])&&Y.warn("<App> was created without expected prop 'firstlyData'")});const a=["firstlyData"];Ge.keys(t).forEach(d=>{!~a.indexOf(d)&&d.slice(0,2)!=="$$"&&d!=="slot"&&Y.warn(`<App> was created with unknown prop '${d}'`)});const f=d=>l(d);return e.$$set=d=>{"firstlyData"in d&&n(0,r=d.firstlyData)},e.$capture_state=()=>({onMount:G,firstlyData:r,modules:c,activeModuleRef:u,loadModule:l,getKeys:i}),e.$inject_state=d=>{"firstlyData"in d&&n(0,r=d.firstlyData),"activeModuleRef"in d&&n(1,u=d.activeModuleRef)},t&&"$$inject"in t&&e.$inject_state(t.$$inject),[r,u,l,i,f]}class Je extends ze{constructor(t){super(t),qe(this,t,He,I,$e,{firstlyData:0}),h("SvelteRegisterComponent",{component:this,tagName:"App",options:t,id:I.name})}get firstlyData(){throw new Error("<App>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'")}set firstlyData(t){throw new Error("<App>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'")}}new Je({target:document.getElementById("app"),props:{firstlyData}});export{rt as A,st as B,ot as C,ve as D,it as E,ct as F,q as G,at as H,N as I,lt as J,Ke as K,gt as L,V as M,se as N,de as O,_t as P,wt as Q,dt as R,ze as S,ft as T,We as U,Ne as V,fe as W,ae as X,H as Y,vt as Z,bt as _,$e as a,qe as b,Ye as c,h as d,Ee as e,tt as f,et as g,Xe as h,T as i,yt as j,mt as k,pt as l,ut as m,_ as n,ht as o,nt as p,ce as q,S as r,ne as s,m as t,b as u,Ze as v,ue as w,O as x,le as y,y as z};
package/esm/cron/index.js DELETED
@@ -1,102 +0,0 @@
1
- import { CronJob } from 'cron';
2
- import { green, Log, magenta, red, yellow } from '@kitql/helpers';
3
- const log = new Log('firstly | cron');
4
- export const jobs = {};
5
- /**
6
- * Link to a nice Cheatsheet TODO
7
- */
8
- export const cronTime = {
9
- /**
10
- * Every morning is actually at 4 am and 7 minutes. (because I like this number!)
11
- */
12
- every_morning: '0 7 4 * * *',
13
- /**
14
- * Every second
15
- */
16
- every_second: '* * * * * *',
17
- /**
18
- * Every minute
19
- */
20
- every_minute: '0 * * * * *',
21
- /**
22
- * Every 10 minute
23
- */
24
- every_10_minute: '*/10 * * * *',
25
- /**
26
- * Every friday at 5:11 am
27
- */
28
- every_friday_morning: '11 5 * * 5',
29
- };
30
- /**
31
- * usage:
32
- *
33
- * ```ts
34
- * import { cron, cronTime } from 'firstly/cron'
35
- *
36
- * export const api = firstly({
37
- * modules: [
38
- * cron([{
39
- * topic: 'first_cron',
40
- * cronTime: cronTime.every_second,
41
- * onTick: () => { console.log('hello') },
42
- * start: !dev, // Start in production
43
- * // runOnInit: dev, // nice in dev environement
44
- * }])
45
- * ]
46
- * })
47
- * ```
48
- *
49
- * using [cron](https://www.npmjs.com/package/cron) library under the hood
50
- */
51
- export const cron = (jobsInfos) => {
52
- return {
53
- name: 'cron',
54
- initApi: async () => {
55
- jobsInfos.forEach((infos) => {
56
- const { topic, runOnInit, logs, concurrent, ...params } = infos;
57
- const concurrentToUse = concurrent ?? 1;
58
- const onTickSaved = params.onTick;
59
- const fullOnTick = async () => {
60
- if (jobs[topic].concurrentInProgress < concurrentToUse) {
61
- jobs[topic].concurrentInProgress = jobs[topic].concurrentInProgress + 1;
62
- if (logs?.starting === undefined || logs?.starting === true) {
63
- logJobs(topic, job, 'starting...', false, false);
64
- }
65
- // @ts-ignore
66
- await onTickSaved();
67
- if (logs?.ended === undefined || logs?.ended === true) {
68
- logJobs(topic, job, 'done');
69
- }
70
- jobs[topic].concurrentInProgress = jobs[topic].concurrentInProgress - 1;
71
- }
72
- else {
73
- logJobs(topic, job, `skipped because of concurrent limit (${yellow(concurrentToUse.toString())})`, false, false);
74
- }
75
- };
76
- params.onTick = fullOnTick;
77
- const job = CronJob.from(params);
78
- jobs[topic] = { job, concurrentInProgress: 0 };
79
- logJobs(topic, job, 'setup done');
80
- // If not it will be done too early
81
- if (runOnInit) {
82
- job.fireOnTick();
83
- }
84
- });
85
- },
86
- };
87
- };
88
- const logJobs = (topic, job, message, with_metadata = true, isSuccess = true) => {
89
- const l = [];
90
- l.push(magenta(`[${topic}]`));
91
- l.push(message);
92
- if (with_metadata) {
93
- // If the job is "stopped", there will still be a next date, but it will not fire it. The job has to start.
94
- l.push(`(${job.running ? green('running') : red('stopped')}, next at ${yellow(job.nextDate().toISO())})`);
95
- }
96
- if (isSuccess) {
97
- log.success(l.join(' '));
98
- }
99
- else {
100
- log.info(l.join(' '));
101
- }
102
- };
@@ -1,7 +0,0 @@
1
- import type { Handle } from '@sveltejs/kit';
2
- import type { RemultSveltekitServer } from 'remult/remult-sveltekit';
3
- import type { Module } from '../api';
4
- export declare const firstly: (api: {
5
- server: RemultSveltekitServer;
6
- modulesSorted: Module[];
7
- }) => Handle;
@@ -1,40 +0,0 @@
1
- import { sequence } from '@sveltejs/kit/hooks';
2
- // const log = new Log('firstly')
3
- /**
4
- * to bring `remult.` on the server side (after this hook, you have assess to `remult.user` for example !)
5
- */
6
- const internalRemultHandle = (api, modules) => async (h) => {
7
- return await api.withRemult(h.event, async () => {
8
- if (modules !== undefined) {
9
- for (let i = 0; i < modules.length; i++) {
10
- const early = modules[i].earlyReturn;
11
- if (early) {
12
- const ret = await early(h);
13
- if (ret.early) {
14
- return ret.resolve;
15
- }
16
- }
17
- }
18
- }
19
- return await h.resolve(h.event);
20
- });
21
- };
22
- export const firstly = ({ server, modulesSorted }) => {
23
- const handlesPre = [];
24
- const handlesPost = [];
25
- for (let i = 0; i < modulesSorted.length; i++) {
26
- if (modulesSorted[i].handlePreRemult) {
27
- handlesPre.push(modulesSorted[i].handlePreRemult);
28
- }
29
- if (modulesSorted[i].handlePosRemult) {
30
- handlesPost.push(modulesSorted[i].handlePosRemult);
31
- }
32
- }
33
- return sequence(
34
- // First
35
- sequence(...handlesPre),
36
- // Then
37
- internalRemultHandle(server, modulesSorted),
38
- // Finally
39
- sequence(...handlesPost));
40
- };