@buildplease/core 1.0.0

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.
@@ -0,0 +1 @@
1
+ import"reflect-metadata";import{Container as e,injectable as t}from"inversify";import{add as n,addDays as r,addHours as i,addMilliseconds as a,addMinutes as o,addMonths as s,addSeconds as c,addWeeks as l,addYears as ee,compareAsc as te,differenceInDays as ne,differenceInHours as re,differenceInMilliseconds as ie,differenceInMinutes as ae,differenceInMonths as oe,differenceInSeconds as se,differenceInWeeks as ce,differenceInYears as le,endOfDay as ue,endOfMonth as de,endOfWeek as fe,endOfYear as pe,format as me,formatISO as he,fromUnixTime as ge,getDate as _e,getDay as ve,getHours as ye,getMinutes as be,getMonth as xe,getSeconds as Se,getUnixTime as Ce,getYear as we,isAfter as Te,isBefore as Ee,isEqual as De,isSameDay as Oe,isValid as u,parseISO as ke,setDate as Ae,setDay as je,setHours as Me,setMinutes as Ne,setMonth as Pe,setSeconds as Fe,setYear as Ie,startOfDay as Le,startOfMonth as Re,startOfWeek as ze,startOfYear as Be,sub as Ve,subDays as He,subHours as Ue,subMilliseconds as We,subMinutes as Ge,subMonths as Ke,subSeconds as qe,subWeeks as Je,subYears as Ye}from"date-fns";import{formatInTimeZone as Xe,fromZonedTime as Ze,getTimezoneOffset as Qe,toZonedTime as $e}from"date-fns-tz";import d from"ms";import{Mutex as et,Semaphore as tt,tryAcquire as nt,withTimeout as rt}from"async-mutex";import f from"bcryptjs";import{z as p}from"zod";export*from"date-fns";const m=`${{name:`buildplease`,displayName:`BuildPlease`,scope:`@buildplease`}.name}.Core.DI`,h={DI:{Formatter:{UnitController:Symbol.for(`${m}.Formatter.UnitController`)},Logger:Symbol.for(`${m}.Logger`)}};var it=class{_container;constructor(){this._container=new e}get container(){return this._container}getInstance(e){return this.container.get(e)}async registerAssemblies(e){e.forEach(e=>e.assemble(this.container))}};function at(e,t,n){if(typeof e!=`string`&&typeof e!=`number`)return null;let r=n?.normalize??(e=>e.trim().toUpperCase()),i=String(e),a=r(i);for(let[e,n]of Object.entries(t))if(Number.isNaN(Number(e))){if(typeof n==`number`){if(!Number.isNaN(Number(i))&&Number(i)===n||r(e)===a)return n}else if(r(n)===a||r(e)===a)return n}return null}function ot(e){return e instanceof Error}function g(e,t={}){if(e==null)return{};let{filterNull:n=!0,filterUndefined:r=!0,filterEmptyString:i=!1,filterEmptyObject:a=!1,filterEmptyArray:o=!1}=t;return Object.keys(e).reduce((s,c)=>{let l=e[c];return _(l)&&Object.getPrototypeOf(l)===null&&(l=void 0),y(l)&&(l=g(l,t)),n&&l===null||r&&l===void 0||i&&l===``||a&&v(l)||o&&Array.isArray(l)&&l.length===0||(s[c]=l),s},{})}function _(e){return typeof e==`object`&&!!e}function v(e){return _(e)&&Object.keys(e).length===0}function st(e){return _(e)&&Object.keys(e).length>0}function y(e){return _(e)&&Object.getPrototypeOf(e)===Object.prototype}var b=class e{value;constructor(e){this.value=e}get isNil(){return this.value==null}map(t){return this.isNil?new e(null):new e(t(this.value))}flatMap(t){return this.isNil?new e(null):t(this.value)}or(e){return this.isNil?e():this.value}orThrow(e){if(this.isNil)throw e||Error(`Conversion Error`);return this.value}orDefault(e){return this.isNil?e:this.value}ifPresent(e){return this.isNil||e(this.value),this}ifAbsent(e){return this.isNil&&e(),this}};function ct(e){return new b(e)}function lt(e){return e!==void 0}function ut(e){return e!==null}function dt(e){return e!=null}function ft(e){try{return new b(e())}catch{return new b(null)}}async function pt(e,t){try{await e()}catch(e){t&&t(e)}}async function mt(e,t){try{return new b(await e())}catch(e){return t&&t(e),new b(null)}}function ht(e){return new Promise(t=>setTimeout(t,e))}function gt(e){return typeof e==`string`&&e.trim().length>0}function _t(e){return e==null||typeof e==`string`&&e.trim().length===0}function vt(e){return typeof e==`string`?e===``?null:e:null}function yt(e){return typeof e!=`string`||e.trim().length===0?null:e.charAt(0).toUpperCase()+e.slice(1)}function bt(e){return e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function xt(e){return typeof e==`object`&&!!e&&typeof e.toJSON==`function`}function St(e){return e==null||[`string`,`number`,`boolean`,`bigint`,`symbol`].includes(typeof e)}Array.prototype.isEmpty=function(){return this==null||this.length===0},String.prototype.capitalized=function(){let e=this==null?``:this.toString();return e.trim()?e.charAt(0).toUpperCase()+e.slice(1):``};var x=class{streetLine1;streetLine2;postalCode;state;city;country;countryCode;constructor(e){this.streetLine1=e.streetLine1,this.streetLine2=e.streetLine2,this.postalCode=e.postalCode,this.state=e.state,this.city=e.city,this.country=e.country,this.countryCode=e.countryCode}toJSON(){return g({streetLine1:this.streetLine1,streetLine2:this.streetLine2,postalCode:this.postalCode,city:this.city,state:this.state,country:this.country,countryCode:this.countryCode},{filterNull:!0,filterUndefined:!0,filterEmptyString:!0})}formatted(){let e=(e,t)=>e.map(e=>e?.trim()).filter(e=>e&&e.length>0).join(t).trim(),t=this.streetLine1;return e([t,e([this.postalCode,this.city],` `),e([this.country],`, `)],`, `)}},S=class{email;fb;ig;phone;web;constructor({email:e,fb:t,ig:n,phone:r,web:i}){this.email=e,this.fb=t,this.ig=n,this.phone=r,this.web=i}toJSON(){return g({email:this.email,fb:this.fb,ig:this.ig,phone:this.phone,web:this.web},{filterNull:!0,filterUndefined:!0,filterEmptyString:!0})}},C=class e{date;constructor(e){if(!e){this.date=new Date;return}if(e instanceof Date){if(!u(e))throw Error(`Invalid date object`);this.date=e;return}let t=ke(e);if(!u(t))throw Error(`Invalid date string`);this.date=t}static fromUnixTimestamp(t,n){return new e(ge(t,n))}static now(){return new e(new Date)}toJSON(){return this.toISOString()}toDate(){return this.date}toUnixTimestamp(){return Ce(this.date)}getTime(){return this.date.getTime()}toISOString(){return he(this.date)}format(e,t){return me(this.date,e,t)}addingDuration(t){return new e(n(this.date,t))}addingMilliseconds(t){return new e(a(this.date,t))}addingSeconds(t){return new e(c(this.date,t))}addingMinutes(t){return new e(o(this.date,t))}addingHours(t){return new e(i(this.date,t))}addingDays(t){return new e(r(this.date,t))}addingWeeks(t){return new e(l(this.date,t))}addingMonths(t){return new e(s(this.date,t))}addingYears(t){return new e(ee(this.date,t))}subtractingDuration(t){return new e(Ve(this.date,t))}subtractingMilliseconds(t){return new e(We(this.date,t))}subtractingSeconds(t){return new e(qe(this.date,t))}subtractingMinutes(t){return new e(Ge(this.date,t))}subtractingHours(t){return new e(Ue(this.date,t))}subtractingDays(t){return new e(He(this.date,t))}subtractingWeeks(t){return new e(Je(this.date,t))}subtractingMonths(t){return new e(Ke(this.date,t))}subtractingYears(t){return new e(Ye(this.date,t))}differenceInMilliseconds(e){return ie(this.date,e.date)}differenceInSeconds(e){return se(this.date,e.date)}differenceInMinutes(e){return ae(this.date,e.date)}differenceInHours(e){return re(this.date,e.date)}differenceInDays(e){return ne(this.date,e.date)}differenceInWeeks(e){return ce(this.date,e.date)}differenceInMonths(e){return oe(this.date,e.date)}differenceInYears(e){return le(this.date,e.date)}isEqualTo(e){return De(this.date,e.date)}isBefore(e){return Ee(this.date,e.date)}isAfter(e){return Te(this.date,e.date)}compareTo(e){return te(this.date,e.date)}isSameDayAs(e){return Oe(this.date,e.date)}startOfDay(){return new e(Le(this.date))}endOfDay(){return new e(ue(this.date))}startOfWeek(){return new e(ze(this.date))}endOfWeek(){return new e(fe(this.date))}startOfMonth(){return new e(Re(this.date))}endOfMonth(){return new e(de(this.date))}startOfYear(){return new e(Be(this.date))}endOfYear(){return new e(pe(this.date))}get dayOfMonth(){return _e(this.date)}get dayOfWeek(){return ve(this.date)}get month(){return xe(this.date)}get year(){return we(this.date)}get hours(){return ye(this.date)}get minutes(){return be(this.date)}get seconds(){return Se(this.date)}settingDayOfMonth(t){return new e(Ae(this.date,t))}settingDayOfWeek(t){return new e(je(this.date,t))}settingMonth(t){return new e(Pe(this.date,t))}settingYear(t){return new e(Ie(this.date,t))}settingHours(t){return new e(Me(this.date,t))}settingMinutes(t){return new e(Ne(this.date,t))}settingSeconds(t){return new e(Fe(this.date,t))}};let Ct=function(e){return e.ISO_DATE=`yyyy-MM-dd`,e.ISO_DATETIME=`yyyy-MM-dd'T'HH:mm:ssXXX`,e.MM_DD_YYYY=`MM/dd/yyyy`,e.FULL_MONTH_DAY_YEAR=`MMMM d, yyyy`,e.ABBR_MONTH_DAY_YEAR=`MMM d, yyyy`,e.RFC_3339=`yyyy-MM-dd'T'HH:mm:ss.SSSxxx`,e.ALT_RSS=`d MMM yyyy HH:mm:ss ZZZ`,e.RSS=`EEE, d MMM yyyy HH:mm:ss ZZZ`,e.HTTP_HEADER=`EEE, dd MMM yyyy HH:mm:ss zzz`,e.STANDARD=`EEE MMM dd HH:mm:ss Z yyyy`,e.EXTENDED=`eee dd-MMM-yyyy GG HH:mm:ss.SSS zzz`,e}({});var wt=class e{utc;timeZone;constructor(e,t){this.timeZone=e,this.utc=t??new Date}static fromUtc(t,n){return new e(n,t)}static fromLocalIso(t,n){let r=Ze(t,n);return new e(n,r)}format(e,t){return Xe(this.utc,this.timeZone,e,t)}toLocalIsoMinutes(e){return this.format(`yyyy-MM-dd'T'HH:mm`,e)}toLocalIsoSeconds(e){return this.format(`yyyy-MM-dd'T'HH:mm:ss`,e)}toISOString(){return this.utc.toISOString()}toUnixTimestamp(){return Math.floor(this.utc.getTime()/1e3)}toZonedDate(){return $e(this.utc,this.timeZone)}timezoneOffsetMs(e){return Qe(this.timeZone,e??this.utc)}},w=class{value;constructor([e,t]){if(e<-180||e>180)throw Error(`Longitude must be between -180 and 180.`);if(t<-90||t>90)throw Error(`Latitude must be between -90 and 90.`);this.value=[e,t]}get longitude(){return this.value[0]}get latitude(){return this.value[1]}toJSON(){return this.value}},T=class{type=`Point`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.toJSON(),...this.bbox&&{bbox:this.bbox}}}},E=class{type=`MultiPoint`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.toJSON()),...this.bbox&&{bbox:this.bbox}}}},D=class{type=`LineString`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.toJSON()),...this.bbox&&{bbox:this.bbox}}}},O=class{type=`MultiLineString`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.map(e=>e.toJSON())),...this.bbox&&{bbox:this.bbox}}}},k=class{type=`Polygon`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.map(e=>e.toJSON())),...this.bbox&&{bbox:this.bbox}}}},Tt=class{type=`MultiPolygon`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.map(e=>e.map(e=>e.toJSON()))),...this.bbox&&{bbox:this.bbox}}}};let Et=function(e){return e.Point=`Point`,e.MultiPoint=`MultiPoint`,e.LineString=`LineString`,e.MultiLineString=`MultiLineString`,e.Polygon=`Polygon`,e.MultiPolygon=`MultiPolygon`,e}({});function A(e){return Error(`Invalid ObjectId value: ${String(e)}`)}var j=class e{value;constructor(e){if(e==null)throw A(e);let t=e.trim();if(t.length===0)throw A(e);this.value=t,Object.freeze(this)}get asString(){return this.value}equals(t){return this.value===e.from(t).value}compare(t){let n=e.from(t).value;return this.value===n?0:this.value<n?-1:1}hash(){return this.value}toJSON(){return this.value}toString(){return this.value}[Symbol.toPrimitive](){return this.value}static from(t){return t instanceof e?t:new e(t)}static isValid(e){return typeof e==`string`&&e.trim().length>0}static toValueSet(t){let n=new Set;for(let r of t)n.add(e.from(r).value);return n}},M=class{day;intervals;constructor(e,t){this.day=e,this.intervals=t}toJSON(){return g({day:this.day,intervals:this.intervals},{filterNull:!0,filterUndefined:!0,filterEmptyString:!0})}},Dt=class{_milliseconds;_long;constructor(e,t){if(this._long=t?.long===!0,e==null)throw Error(`Invalid interval format: ${e}`);if(typeof e==`number`)this._milliseconds=e;else{let t=d(e);if(t===void 0)throw Error(`Invalid interval format: ${e}`);this._milliseconds=t}}get milliseconds(){return this._milliseconds}get seconds(){return Math.floor(this._milliseconds/1e3)}get minutes(){return Math.floor(this._milliseconds/6e4)}get hours(){return Math.floor(this._milliseconds/36e5)}get days(){return Math.floor(this._milliseconds/864e5)}get weeks(){return Math.floor(this._milliseconds/6048e5)}get formatted(){return d(this._milliseconds,{long:this._long})}toString(){return d(this._milliseconds,{long:this._long})}toObject(){return{milliseconds:this._milliseconds,seconds:this.seconds,minutes:this.minutes,hours:this.hours,days:this.days,weeks:this.weeks}}};let Ot=function(e){return e.Byte=`B`,e.Kilobyte=`KB`,e.Megabyte=`MB`,e.Gigabyte=`GB`,e.Terabyte=`TB`,e}({}),kt=function(e){return e.Millimeter=`mm`,e.Centimeter=`cm`,e.Meter=`m`,e.Kilometer=`km`,e}({}),At=function(e){return e.Milligram=`mg`,e.Gram=`g`,e.Kilogram=`kg`,e.Tonne=`t`,e}({});function jt(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let N=class{formatBytes(e,t){let{inputUnit:n=`B`,outputUnit:r=`auto`,decimals:i=1}=t??{},a=e=>e===`B`?1:e===`KB`?1024:e===`MB`?1048576:e===`GB`?1073741824:1099511627776,o=e*a(n),s=r===`auto`?(()=>{for(let e of[`TB`,`GB`,`MB`,`KB`])if(o/a(e)>=1)return e;return`B`})():r,c=o/a(s),l=10**i;return{value:Math.round(c*l)/l,unit:s,bytes:o}}};N=jt([t()],N);var Mt=class{assemble(e){e.bind(h.DI.Formatter.UnitController).to(N)}};function Nt(){return[new Mt]}var Pt=class{async convertArray(e){return Promise.all(e.map(e=>this.convert(e)))}async convertArrayIgnoreInvalid(e){let t=[];for(let n of e)try{let e=await this.convert(n);t.push(e)}catch{}return t}},Ft=class{convertArray(e){return e.map(e=>this.convert(e))}convertArrayIgnoreInvalid(e){return e.reduce((e,t)=>{try{e.push(this.convert(t))}catch{}return e},[])}};let It=function(e){return e.MOBILE=`MOBILE`,e.DESKTOP=`DESKTOP`,e.WEB=`WEB`,e.TABLET=`TABLET`,e}({}),Lt=function(e){return e.IOS=`IOS`,e.ANDROID=`ANDROID`,e.WINDOWS=`WINDOWS`,e.MACOS=`MACOS`,e.LINUX=`LINUX`,e}({}),Rt=function(e){return e.UNKNOWN=`UNKNOWN`,e.ON=`ON`,e.OFF=`OFF`,e}({});var zt=class extends Error{code=`CANCELED`;constructor(e={}){let{message:t=`Request canceled`,cause:n}=e;super(t),this.name=`CanceledError`,n!==void 0&&(this.cause=n)}},Bt=class extends Error{code=`MALFORMED_DATA`;field;constructor(e={}){let{message:t=`Malformed data`,field:n,cause:r}=e;super(t),this.name=`ConversionError`,this.field=n,r!==void 0&&(this.cause=r)}},Vt=class extends Error{code=`NETWORK_ERROR`;constructor(e={}){let{message:t=`Network error`,cause:n}=e;super(t),this.name=`NetworkError`,n!==void 0&&(this.cause=n)}},Ht=class extends Error{code=`TIMEOUT`;constructor(e={}){let{message:t=`Request timeout`,cause:n}=e;super(t),this.name=`TimeoutError`,n!==void 0&&(this.cause=n)}},Ut=class extends Error{code=`UNKNOWN`;constructor(e={}){let{message:t=`Unknown error`,cause:n}=e;super(t),this.name=`UnknownError`,n!==void 0&&(this.cause=n)}};function P(e){return F(Object.values(e.resources))}function F(e,t=[]){let n={},r=new Set(e.flatMap(e=>Object.keys(e)));for(let i of r){let r=[...t,i],a=I(i);if(Object.hasOwn(n,a))throw Error(`Duplicate L10n key property: ${[...t.map(I),a].join(`.`)}`);let o=e.map(e=>e[i]).filter(Wt);n[a]=o.length>0?F(o,r):r.join(`.`)}return n}function I(e){return e.split(/[^a-zA-Z0-9]+/u).filter(e=>!!e).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(``)}function Wt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var L=class e{resources;constructor(e){this.resources=e}extend(t){let n=Gt(this.resources,t.resources);return new e(n)}};function R(e){return new L(e.resources)}function Gt(e,t){let n={};return z(n,e),z(n,t),n}function z(e,t){for(let[n,r]of Object.entries(t)){let t=e[n];if(V(t)&&V(r)){z(t,r);continue}e[n]=B(r)}}function B(e){if(Array.isArray(e))return e.map(e=>B(e));if(V(e)){let t={};return z(t,e),t}return e}function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const H=R({resources:{en:{core:{common:{actions:{save:`Save`,cancel:`Cancel`,delete:`Delete`,confirm:`Confirm`,close:`Close`,back:`Back`,next:`Next`},date_time:{relative:{today:`Today`,tomorrow:`Tomorrow`,yesterday:`Yesterday`},interval:{second:{one:`second`,few:`seconds`,many:`seconds`,other:`seconds`},minute:{one:`minute`,few:`minutes`,many:`minutes`,other:`minutes`},hour:{one:`hour`,few:`hours`,many:`hours`,other:`hours`},day:{one:`day`,few:`days`,many:`days`,other:`days`},week:{one:`week`,few:`weeks`,many:`weeks`,other:`weeks`},month:{one:`month`,few:`months`,many:`months`,other:`months`},year:{one:`year`,few:`years`,many:`years`,other:`years`}},weekday:{monday:`Monday`,tuesday:`Tuesday`,wednesday:`Wednesday`,thursday:`Thursday`,friday:`Friday`,saturday:`Saturday`,sunday:`Sunday`},month:{january:`January`,february:`February`,march:`March`,april:`April`,may:`May`,june:`June`,july:`July`,august:`August`,september:`September`,october:`October`,november:`November`,december:`December`}},validation:{opening_hours:{time_required:`Please specify both opening and closing time, or remove the interval.`,time_range_incomplete:`This interval is incomplete. Please fill in both opening and closing time.`}}}}},sk:{core:{common:{actions:{save:`Uložiť`,cancel:`Zrušiť`,delete:`Odstrániť`,confirm:`Potvrdiť`,close:`Zavrieť`,back:`Späť`,next:`Ďalej`},date_time:{relative:{today:`Dnes`,tomorrow:`Zajtra`,yesterday:`Včera`},interval:{second:{one:`sekunda`,few:`sekundy`,many:`sekundy`,other:`sekúnd`},minute:{one:`minúta`,few:`minúty`,many:`minúty`,other:`minút`},hour:{one:`hodina`,few:`hodiny`,many:`hodiny`,other:`hodín`},day:{one:`deň`,few:`dni`,many:`dni`,other:`dní`},week:{one:`týždeň`,few:`týždne`,many:`týždne`,other:`týždňov`},month:{one:`mesiac`,few:`mesiace`,many:`mesiace`,other:`mesiacov`},year:{one:`rok`,few:`roky`,many:`roky`,other:`rokov`}},weekday:{monday:`Pondelok`,tuesday:`Utorok`,wednesday:`Streda`,thursday:`Štvrtok`,friday:`Piatok`,saturday:`Sobota`,sunday:`Nedeľa`},month:{january:`Január`,february:`Február`,march:`Marec`,april:`Apríl`,may:`Máj`,june:`Jún`,july:`Júl`,august:`August`,september:`September`,october:`Október`,november:`November`,december:`December`}},validation:{opening_hours:{time_required:`Zadajte čas otvorenia aj zatvorenia alebo interval odstráňte.`,time_range_incomplete:`Interval je neúplný. Vyplňte čas otvorenia aj zatvorenia.`}}}}},cs:{core:{common:{actions:{save:`Uložit`,cancel:`Zrušit`,delete:`Odstranit`,confirm:`Potvrdit`,close:`Zavřít`,back:`Zpět`,next:`Další`},date_time:{relative:{today:`Dnes`,tomorrow:`Zítra`,yesterday:`Včera`},interval:{second:{one:`sekunda`,few:`sekundy`,many:`sekundy`,other:`sekund`},minute:{one:`minuta`,few:`minuty`,many:`minuty`,other:`minut`},hour:{one:`hodina`,few:`hodiny`,many:`hodiny`,other:`hodin`},day:{one:`den`,few:`dny`,many:`dny`,other:`dní`},week:{one:`týden`,few:`týdny`,many:`týdny`,other:`týdnů`},month:{one:`měsíc`,few:`měsíce`,many:`měsíce`,other:`měsíců`},year:{one:`rok`,few:`roky`,many:`roky`,other:`let`}},weekday:{monday:`Pondělí`,tuesday:`Úterý`,wednesday:`Středa`,thursday:`Čtvrtek`,friday:`Pátek`,saturday:`Sobota`,sunday:`Neděle`},month:{january:`Leden`,february:`Únor`,march:`Březen`,april:`Duben`,may:`Květen`,june:`Červen`,july:`Červenec`,august:`Srpen`,september:`Září`,october:`Říjen`,november:`Listopad`,december:`Prosinec`}},validation:{opening_hours:{time_required:`Zadejte čas otevření i zavření nebo interval odstraňte.`,time_range_incomplete:`Interval je neúplný. Vyplňte čas otevření i zavření.`}}}}}}}),U=P(H);var Kt=class{values;constructor(e){this.values=e}getLocalized(e){return this.values[e]||null}toJSON(){return this.values}};async function qt(e,t=10){return f.hash(e,t)}async function Jt(e,t){return f.compare(e,t)}const Yt=p.uuid(),Xt=p.iso.datetime().transform(e=>new C(e)),Zt=p.string().trim().min(1).transform(e=>new j(e)),W=p.number().min(-180).max(180),G=p.number().min(-90).max(90),K=p.tuple([W,G]).transform(([e,t])=>new w([e,t])),q=p.union([p.tuple([p.number(),p.number(),p.number(),p.number()]),p.tuple([p.number(),p.number(),p.number(),p.number(),p.number(),p.number()])]),J=p.object({type:p.literal(`Point`),coordinates:K,bbox:q.optional()}).transform(e=>new T(e.coordinates,e.bbox)),Y=p.object({type:p.literal(`MultiPoint`),coordinates:p.array(K).nonempty(),bbox:q.optional()}).transform(e=>new E(e.coordinates,e.bbox)),X=p.object({type:p.literal(`LineString`),coordinates:p.array(K).min(2),bbox:q.optional()}).transform(e=>new D(e.coordinates,e.bbox)),Z=p.object({type:p.literal(`MultiLineString`),coordinates:p.array(p.array(K).min(2)).nonempty(),bbox:q.optional()}).transform(e=>new O(e.coordinates,e.bbox)),Q=p.object({type:p.literal(`Polygon`),coordinates:p.array(p.array(K).min(4)).min(1),bbox:q.optional()}).transform(e=>new k(e.coordinates,e.bbox)),Qt=p.object({type:p.literal(`MultiPolygon`),coordinates:p.array(p.array(p.array(K).min(4)).min(1)).min(1),bbox:q.optional()}).transform(e=>new Tt(e.coordinates,e.bbox)),$t=p.union([J,Y,X,Z,Q,Qt]),en=p.object({open:p.string(),close:p.string()}).superRefine((e,t)=>{let n=e.open.trim(),r=e.close.trim(),i=n.length>0,a=r.length>0,o=(e,n,r)=>{let i={i18n:{key:e,values:r}};t.addIssue({code:`custom`,path:n,params:i})};if(!i&&!a){o(U.Core.Common.Validation.OpeningHours.TimeRequired,[`open`]);return}if(i!==a){let e=i?[`close`]:[`open`];o(U.Core.Common.Validation.OpeningHours.TimeRangeIncomplete,e)}}),$=p.object({day:p.number().int().min(1).max(7),intervals:p.array(en).default([])}).transform(e=>new M(e.day,e.intervals)),tn={UUID:Yt,DateTime:Xt,ObjectId:Zt,Longitude:W,Latitude:G,Coordinates:K,BBox:q,PointGeometry:J,MultiPointGeometry:Y,LineStringGeometry:X,MultiLineStringGeometry:Z,PolygonGeometry:Q,MultiPolygonGeometry:Qt,Geometry:$t,OpeningHour:$,OpeningHours:p.array($),Contacts:p.object({email:p.email().optional().nullable(),fb:p.string().optional().nullable(),ig:p.string().optional().nullable(),phone:p.string().optional().nullable(),web:p.string().optional().nullable()}).transform(e=>new S({email:e.email,fb:e.fb,ig:e.ig,phone:e.phone,web:e.web})),Address:p.object({streetLine1:p.string().min(1),streetLine2:p.string().optional().nullable(),postalCode:p.string().optional().nullable(),city:p.string().optional().nullable(),state:p.string().optional().nullable(),country:p.string().min(1),countryCode:p.string().optional().nullable()}).transform(e=>new x({streetLine1:e.streetLine1,streetLine2:e.streetLine2,postalCode:e.postalCode,state:e.state,city:e.city,country:e.country,countryCode:e.countryCode}))};function nn(){return Nt()}export{x as Address,Pt as AsyncConverter,Ot as ByteUnit,zt as CanceledError,S as Contacts,Bt as ConversionError,Ft as Converter,w as Coordinates,U as CoreL10n,H as CoreL10nResource,h as CoreSymbols,Ct as DateFormat,C as DateTime,It as DeviceType,kt as DistanceUnit,Et as GeoJsonType,L as L10nResource,D as LineString,Kt as LocalizableText,O as MultiLineString,E as MultiPoint,Tt as MultiPolygon,et as Mutex,Vt as NetworkError,Lt as OSType,j as ObjectId,M as OpeningHour,b as Optional,T as Point,k as Polygon,Rt as PushNotificationStatus,it as ScopeController,tt as Semaphore,Dt as TimeInterval,Ht as TimeoutError,N as UnitFormatterControllerImpl,Ut as UnknownError,tn as ValidationSchemas,At as WeightUnit,wt as ZonedDateTime,yt as capitalized,Jt as compareHash,nn as coreAssembly,P as defineL10n,R as defineL10nResource,ht as delay,vt as emptyOrUndefinedStringToNull,g as filterObject,ft as ignoreError,pt as ignoreErrorAsync,mt as ignoreErrorOptionalAsync,lt as isDefined,dt as isDefinedAndNotNull,v as isEmptyObject,ot as isError,bt as isJSONPrimitive,xt as isJSONSerializable,st as isNonEmptyObject,gt as isNonEmptyString,ut as isNotNull,_t as isNullOrEmpty,_ as isObject,y as isPlainObject,St as isPrimitive,qt as makeHash,at as mapToEnum,ct as optional,nt as tryAcquire,rt as withTimeout};
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(e,t,n)=>(s(e,t,`default`),n&&s(n,t,`default`)),l=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));let u=require("node:module"),d=require("consola"),f=require("consola/utils"),p=require("inversify"),m=require("date-fns"),h=require("date-fns-tz"),g=require("ms");g=l(g,1);let _=require("node:path");_=l(_,1);let v=require("node:fs");v=l(v,1);let ee=require("node:url"),y=require("pino");y=l(y,1);let b=require("zod");b=l(b,1);function te(e,t={}){let n=t.includePeers??!0,r=t.includeDependencies??!0,i=t.includeSubpaths??!0,a=t.includeNodeBuiltins??!0,o=t.allowPeerBundling??!1,s=Object.keys(e.peerDependencies??{}),c=Object.keys(e.dependencies??{}),l=S(t.bundle??[]),u=S(t.external??[]);se(u,l),D(l),o||E(s,l);let d=new Set(l.map(w)),f=n?s.filter(e=>!d.has(e)):[],p=r?c.filter(e=>!d.has(e)):[];return{external:C([...a?ne():[],...x([...f,...p,...u],i)]),bundle:C(x(l,i))}}function ne(){let e=S(u.builtinModules.map(T)),t=e.map(e=>`node:${e}`);return C([...e,...t,/^node:/])}function x(e,t){return t?e.map(e=>re(e)):[...e]}function re(e){return ae(e)?e:RegExp(`^${oe(e)}(?:/.*)?$`)}function S(e){return Array.from(new Set(e))}function C(e){let t=new Set,n=[];for(let r of e){let e=ie(r);t.has(e)||(t.add(e),n.push(r))}return n}function ie(e){return typeof e==`string`?`string:${e}`:`regexp:${e.source}/${e.flags}`}function w(e){if(e.startsWith(`@`)){let[t,n]=e.split(`/`);return t&&n?`${t}/${n}`:e}let[t]=e.split(`/`);return t??e}function T(e){return e.startsWith(`node:`)?e.slice(5):e}function ae(e){return e.includes(`*`)||e.startsWith(`^`)||e.endsWith(`$`)}function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function se(e,t){let n=new Set(e.map(w)),r=t.filter(e=>n.has(w(e)));if(r.length!==0)throw Error(`Packages cannot be both external and bundled: ${r.join(`, `)}`)}function E(e,t){let n=new Set(e),r=t.filter(e=>n.has(w(e)));if(r.length!==0)throw Error(`Peer dependencies must stay external and cannot be bundled by default: ${r.join(`, `)}`)}function D(e){let t=new Set(u.builtinModules.map(T)),n=e.filter(e=>ce(e,t));if(n.length!==0)throw Error(`Node.js built-in modules cannot be bundled: ${n.join(`, `)}`)}function ce(e,t){let n=T(e),[r]=n.split(`/`);return r?t.has(r):t.has(n)}const le=/\u001B\[[0-9;]*m/g;var O=class{instance;constructor(e={}){this.instance=(0,d.createConsola)({level:e.enabled===!1?-999:999,formatOptions:{colors:!0,date:!1}})}title(e,t,n=[]){this.printPanel({title:`${e} ${t}`.trim(),renderedTitle:`${f.colors.cyan(f.colors.bold(e))}${t?` ${f.colors.dim(t)}`:``}`,rows:n,formatValue:f.colors.green})}panel(e,t,n){this.printPanel({title:n===void 0?e:`${e} ${n}`,renderedTitle:`${f.colors.cyan(f.colors.bold(e))}${n===void 0?``:` ${f.colors.green(String(n))}`}`,rows:t,formatValue:f.colors.dim})}step(e,t){return`${f.colors.cyan(e.padEnd(10,` `))}${t}`}duration(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}emptyLine(){this.instance.log(``)}log(e,...t){this.instance.log(e,...t)}info(e,...t){this.instance.info(e,...t)}start(e,...t){this.instance.start(e,...t)}success(e,...t){this.instance.success(e,...t)}warn(e,...t){this.instance.warn(e,...t)}error(e,...t){this.instance.error(e,...t)}debug(e,...t){this.instance.debug(e,...t)}printPanel(e){this.instance.log(this.formatPanel(e))}formatPanel(e){let t=this.getPanelWidth(e);return[this.formatPanelTop(e.renderedTitle,t),...e.rows.map(n=>this.formatPanelRow(n,t,e.formatValue)),this.formatPanelBottom(t)].join(`
2
+ `)}formatPanelTop(e,t){let n=Math.max(1,t-this.visibleLength(e)-5);return`${f.colors.dim(`╭─`)} ${e} ${f.colors.dim(`─`.repeat(n))}${f.colors.dim(`╮`)}`}formatPanelBottom(e){return`${f.colors.dim(`╰`)}${f.colors.dim(`─`.repeat(e-2))}${f.colors.dim(`╯`)}`}formatPanelRow(e,t,n){let r=e.label.padEnd(14,` `),i=String(e.value),a=this.visibleLength(r)+this.visibleLength(i)+4,o=Math.max(0,t-a);return`${f.colors.dim(`│`)} ${f.colors.blue(r)}${n(i)}${` `.repeat(o)} ${f.colors.dim(`│`)}`}getPanelWidth(e){return Math.max(48,this.getTitleWidth(e),this.getRowsWidth(e.rows))}getTitleWidth(e){return this.visibleLength(e.title)+6}getRowsWidth(e){return Math.max(0,...e.map(e=>this.getRowWidth(e)))}getRowWidth(e){return 14+this.visibleLength(String(e.value))+4}visibleLength(e){return e.replace(le,``).length}};const k=`${{name:`buildplease`,displayName:`BuildPlease`,scope:`@buildplease`}.name}.Core.DI`,A={DI:{Formatter:{UnitController:Symbol.for(`${k}.Formatter.UnitController`)},Logger:Symbol.for(`${k}.Logger`)}};function ue(e){return e instanceof Error}function j(e,t={}){if(e==null)return{};let{filterNull:n=!0,filterUndefined:r=!0,filterEmptyString:i=!1,filterEmptyObject:a=!1,filterEmptyArray:o=!1}=t;return Object.keys(e).reduce((s,c)=>{let l=e[c];return M(l)&&Object.getPrototypeOf(l)===null&&(l=void 0),de(l)&&(l=j(l,t)),n&&l===null||r&&l===void 0||i&&l===``||a&&N(l)||o&&Array.isArray(l)&&l.length===0||(s[c]=l),s},{})}function M(e){return typeof e==`object`&&!!e}function N(e){return M(e)&&Object.keys(e).length===0}function de(e){return M(e)&&Object.getPrototypeOf(e)===Object.prototype}function fe(e){return e==null||[`string`,`number`,`boolean`,`bigint`,`symbol`].includes(typeof e)}Array.prototype.isEmpty=function(){return this==null||this.length===0},String.prototype.capitalized=function(){let e=this==null?``:this.toString();return e.trim()?e.charAt(0).toUpperCase()+e.slice(1):``};var P=class{streetLine1;streetLine2;postalCode;state;city;country;countryCode;constructor(e){this.streetLine1=e.streetLine1,this.streetLine2=e.streetLine2,this.postalCode=e.postalCode,this.state=e.state,this.city=e.city,this.country=e.country,this.countryCode=e.countryCode}toJSON(){return j({streetLine1:this.streetLine1,streetLine2:this.streetLine2,postalCode:this.postalCode,city:this.city,state:this.state,country:this.country,countryCode:this.countryCode},{filterNull:!0,filterUndefined:!0,filterEmptyString:!0})}formatted(){let e=(e,t)=>e.map(e=>e?.trim()).filter(e=>e&&e.length>0).join(t).trim(),t=this.streetLine1;return e([t,e([this.postalCode,this.city],` `),e([this.country],`, `)],`, `)}},F=class{email;fb;ig;phone;web;constructor({email:e,fb:t,ig:n,phone:r,web:i}){this.email=e,this.fb=t,this.ig=n,this.phone=r,this.web=i}toJSON(){return j({email:this.email,fb:this.fb,ig:this.ig,phone:this.phone,web:this.web},{filterNull:!0,filterUndefined:!0,filterEmptyString:!0})}},I=o({DateFormat:()=>R,DateTime:()=>L});c(I,require("date-fns"));var L=class e{date;constructor(e){if(!e){this.date=new Date;return}if(e instanceof Date){if(!(0,m.isValid)(e))throw Error(`Invalid date object`);this.date=e;return}let t=(0,m.parseISO)(e);if(!(0,m.isValid)(t))throw Error(`Invalid date string`);this.date=t}static fromUnixTimestamp(t,n){return new e((0,m.fromUnixTime)(t,n))}static now(){return new e(new Date)}toJSON(){return this.toISOString()}toDate(){return this.date}toUnixTimestamp(){return(0,m.getUnixTime)(this.date)}getTime(){return this.date.getTime()}toISOString(){return(0,m.formatISO)(this.date)}format(e,t){return(0,m.format)(this.date,e,t)}addingDuration(t){return new e((0,m.add)(this.date,t))}addingMilliseconds(t){return new e((0,m.addMilliseconds)(this.date,t))}addingSeconds(t){return new e((0,m.addSeconds)(this.date,t))}addingMinutes(t){return new e((0,m.addMinutes)(this.date,t))}addingHours(t){return new e((0,m.addHours)(this.date,t))}addingDays(t){return new e((0,m.addDays)(this.date,t))}addingWeeks(t){return new e((0,m.addWeeks)(this.date,t))}addingMonths(t){return new e((0,m.addMonths)(this.date,t))}addingYears(t){return new e((0,m.addYears)(this.date,t))}subtractingDuration(t){return new e((0,m.sub)(this.date,t))}subtractingMilliseconds(t){return new e((0,m.subMilliseconds)(this.date,t))}subtractingSeconds(t){return new e((0,m.subSeconds)(this.date,t))}subtractingMinutes(t){return new e((0,m.subMinutes)(this.date,t))}subtractingHours(t){return new e((0,m.subHours)(this.date,t))}subtractingDays(t){return new e((0,m.subDays)(this.date,t))}subtractingWeeks(t){return new e((0,m.subWeeks)(this.date,t))}subtractingMonths(t){return new e((0,m.subMonths)(this.date,t))}subtractingYears(t){return new e((0,m.subYears)(this.date,t))}differenceInMilliseconds(e){return(0,m.differenceInMilliseconds)(this.date,e.date)}differenceInSeconds(e){return(0,m.differenceInSeconds)(this.date,e.date)}differenceInMinutes(e){return(0,m.differenceInMinutes)(this.date,e.date)}differenceInHours(e){return(0,m.differenceInHours)(this.date,e.date)}differenceInDays(e){return(0,m.differenceInDays)(this.date,e.date)}differenceInWeeks(e){return(0,m.differenceInWeeks)(this.date,e.date)}differenceInMonths(e){return(0,m.differenceInMonths)(this.date,e.date)}differenceInYears(e){return(0,m.differenceInYears)(this.date,e.date)}isEqualTo(e){return(0,m.isEqual)(this.date,e.date)}isBefore(e){return(0,m.isBefore)(this.date,e.date)}isAfter(e){return(0,m.isAfter)(this.date,e.date)}compareTo(e){return(0,m.compareAsc)(this.date,e.date)}isSameDayAs(e){return(0,m.isSameDay)(this.date,e.date)}startOfDay(){return new e((0,m.startOfDay)(this.date))}endOfDay(){return new e((0,m.endOfDay)(this.date))}startOfWeek(){return new e((0,m.startOfWeek)(this.date))}endOfWeek(){return new e((0,m.endOfWeek)(this.date))}startOfMonth(){return new e((0,m.startOfMonth)(this.date))}endOfMonth(){return new e((0,m.endOfMonth)(this.date))}startOfYear(){return new e((0,m.startOfYear)(this.date))}endOfYear(){return new e((0,m.endOfYear)(this.date))}get dayOfMonth(){return(0,m.getDate)(this.date)}get dayOfWeek(){return(0,m.getDay)(this.date)}get month(){return(0,m.getMonth)(this.date)}get year(){return(0,m.getYear)(this.date)}get hours(){return(0,m.getHours)(this.date)}get minutes(){return(0,m.getMinutes)(this.date)}get seconds(){return(0,m.getSeconds)(this.date)}settingDayOfMonth(t){return new e((0,m.setDate)(this.date,t))}settingDayOfWeek(t){return new e((0,m.setDay)(this.date,t))}settingMonth(t){return new e((0,m.setMonth)(this.date,t))}settingYear(t){return new e((0,m.setYear)(this.date,t))}settingHours(t){return new e((0,m.setHours)(this.date,t))}settingMinutes(t){return new e((0,m.setMinutes)(this.date,t))}settingSeconds(t){return new e((0,m.setSeconds)(this.date,t))}};let R=function(e){return e.ISO_DATE=`yyyy-MM-dd`,e.ISO_DATETIME=`yyyy-MM-dd'T'HH:mm:ssXXX`,e.MM_DD_YYYY=`MM/dd/yyyy`,e.FULL_MONTH_DAY_YEAR=`MMMM d, yyyy`,e.ABBR_MONTH_DAY_YEAR=`MMM d, yyyy`,e.RFC_3339=`yyyy-MM-dd'T'HH:mm:ss.SSSxxx`,e.ALT_RSS=`d MMM yyyy HH:mm:ss ZZZ`,e.RSS=`EEE, d MMM yyyy HH:mm:ss ZZZ`,e.HTTP_HEADER=`EEE, dd MMM yyyy HH:mm:ss zzz`,e.STANDARD=`EEE MMM dd HH:mm:ss Z yyyy`,e.EXTENDED=`eee dd-MMM-yyyy GG HH:mm:ss.SSS zzz`,e}({});var z=class e{utc;timeZone;constructor(e,t){this.timeZone=e,this.utc=t??new Date}static fromUtc(t,n){return new e(n,t)}static fromLocalIso(t,n){let r=(0,h.fromZonedTime)(t,n);return new e(n,r)}format(e,t){return(0,h.formatInTimeZone)(this.utc,this.timeZone,e,t)}toLocalIsoMinutes(e){return this.format(`yyyy-MM-dd'T'HH:mm`,e)}toLocalIsoSeconds(e){return this.format(`yyyy-MM-dd'T'HH:mm:ss`,e)}toISOString(){return this.utc.toISOString()}toUnixTimestamp(){return Math.floor(this.utc.getTime()/1e3)}toZonedDate(){return(0,h.toZonedTime)(this.utc,this.timeZone)}timezoneOffsetMs(e){return(0,h.getTimezoneOffset)(this.timeZone,e??this.utc)}},B=class{value;constructor([e,t]){if(e<-180||e>180)throw Error(`Longitude must be between -180 and 180.`);if(t<-90||t>90)throw Error(`Latitude must be between -90 and 90.`);this.value=[e,t]}get longitude(){return this.value[0]}get latitude(){return this.value[1]}toJSON(){return this.value}},V=class{type=`Point`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.toJSON(),...this.bbox&&{bbox:this.bbox}}}},pe=class{type=`MultiPoint`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.toJSON()),...this.bbox&&{bbox:this.bbox}}}},me=class{type=`LineString`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.toJSON()),...this.bbox&&{bbox:this.bbox}}}},he=class{type=`MultiLineString`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.map(e=>e.toJSON())),...this.bbox&&{bbox:this.bbox}}}},ge=class{type=`Polygon`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.map(e=>e.toJSON())),...this.bbox&&{bbox:this.bbox}}}},_e=class{type=`MultiPolygon`;coordinates;bbox;constructor(e,t){this.coordinates=e,this.bbox=t}toJSON(){return{type:this.type,coordinates:this.coordinates.map(e=>e.map(e=>e.map(e=>e.toJSON()))),...this.bbox&&{bbox:this.bbox}}}};let ve=function(e){return e.Point=`Point`,e.MultiPoint=`MultiPoint`,e.LineString=`LineString`,e.MultiLineString=`MultiLineString`,e.Polygon=`Polygon`,e.MultiPolygon=`MultiPolygon`,e}({});function H(e){return Error(`Invalid ObjectId value: ${String(e)}`)}var ye=class e{value;constructor(e){if(e==null)throw H(e);let t=e.trim();if(t.length===0)throw H(e);this.value=t,Object.freeze(this)}get asString(){return this.value}equals(t){return this.value===e.from(t).value}compare(t){let n=e.from(t).value;return this.value===n?0:this.value<n?-1:1}hash(){return this.value}toJSON(){return this.value}toString(){return this.value}[Symbol.toPrimitive](){return this.value}static from(t){return t instanceof e?t:new e(t)}static isValid(e){return typeof e==`string`&&e.trim().length>0}static toValueSet(t){let n=new Set;for(let r of t)n.add(e.from(r).value);return n}},be=class{day;intervals;constructor(e,t){this.day=e,this.intervals=t}toJSON(){return j({day:this.day,intervals:this.intervals},{filterNull:!0,filterUndefined:!0,filterEmptyString:!0})}},xe=class{_milliseconds;_long;constructor(e,t){if(this._long=t?.long===!0,e==null)throw Error(`Invalid interval format: ${e}`);if(typeof e==`number`)this._milliseconds=e;else{let t=(0,g.default)(e);if(t===void 0)throw Error(`Invalid interval format: ${e}`);this._milliseconds=t}}get milliseconds(){return this._milliseconds}get seconds(){return Math.floor(this._milliseconds/1e3)}get minutes(){return Math.floor(this._milliseconds/6e4)}get hours(){return Math.floor(this._milliseconds/36e5)}get days(){return Math.floor(this._milliseconds/864e5)}get weeks(){return Math.floor(this._milliseconds/6048e5)}get formatted(){return(0,g.default)(this._milliseconds,{long:this._long})}toString(){return(0,g.default)(this._milliseconds,{long:this._long})}toObject(){return{milliseconds:this._milliseconds,seconds:this.seconds,minutes:this.minutes,hours:this.hours,days:this.days,weeks:this.weeks}}};let Se=function(e){return e.Byte=`B`,e.Kilobyte=`KB`,e.Megabyte=`MB`,e.Gigabyte=`GB`,e.Terabyte=`TB`,e}({}),Ce=function(e){return e.Millimeter=`mm`,e.Centimeter=`cm`,e.Meter=`m`,e.Kilometer=`km`,e}({}),we=function(e){return e.Milligram=`mg`,e.Gram=`g`,e.Kilogram=`kg`,e.Tonne=`t`,e}({});c(o({Address:()=>P,ByteUnit:()=>Se,Contacts:()=>F,Coordinates:()=>B,DateFormat:()=>R,DateTime:()=>L,DistanceUnit:()=>Ce,GeoJsonType:()=>ve,LineString:()=>me,MultiLineString:()=>he,MultiPoint:()=>pe,MultiPolygon:()=>_e,ObjectId:()=>ye,OpeningHour:()=>be,Point:()=>V,Polygon:()=>ge,TimeInterval:()=>xe,WeightUnit:()=>we,ZonedDateTime:()=>z}),I);function U(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let W=class{formatBytes(e,t){let{inputUnit:n=`B`,outputUnit:r=`auto`,decimals:i=1}=t??{},a=e=>e===`B`?1:e===`KB`?1024:e===`MB`?1048576:e===`GB`?1073741824:1099511627776,o=e*a(n),s=r===`auto`?(()=>{for(let e of[`TB`,`GB`,`MB`,`KB`])if(o/a(e)>=1)return e;return`B`})():r,c=o/a(s),l=10**i;return{value:Math.round(c*l)/l,unit:s,bytes:o}}};W=U([(0,p.injectable)()],W);var Te=class{assemble(e){e.bind(A.DI.Formatter.UnitController).to(W)}};function Ee(){return[new Te]}let De=function(e){return e.Critical=`CRITICAL`,e.Serious=`SERIOUS`,e.Important=`IMPORTANT`,e.Notice=`NOTICE`,e.Routine=`ROUTINE`,e}({});function G(e,t){if(_.default.isAbsolute(t))return _.default.normalize(t);let n;try{let t=new URL(e);if(t.protocol!==`file:`)throw Error(`Unsupported URL protocol "${t.protocol}"`);n=_.default.dirname((0,ee.fileURLToPath)(t))}catch{n=e}return _.default.resolve(n,t)}function Oe(e,t={}){let n=G(process.cwd(),e);if(!v.default.existsSync(n))return;let r=v.default.statSync(n),{recursive:i=!0,force:a=!0,cleanOnly:o=!1}=t;if(o&&r.isDirectory()){for(let e of v.default.readdirSync(n))v.default.rmSync(_.default.join(n,e),{recursive:i,force:a});return}if(o&&r.isFile()){v.default.truncateSync(n,0);return}v.default.rmSync(n,{recursive:r.isDirectory()?i:!1,force:a,maxRetries:3,retryDelay:100})}function K(e){let t=G(process.cwd(),e),n=v.default.existsSync(t)&&v.default.statSync(t).isDirectory()?t:_.default.dirname(t);if(!v.default.existsSync(n))throw Error(`Directory "${n}" does not exist.`);return t}function ke(e){let t=G(process.cwd(),e);_.default.extname(e)&&console.warn(`[createDirectory] Warning: "${e}" looks like a file path.`);try{if(!v.default.existsSync(t))v.default.mkdirSync(t,{recursive:!0});else if(!v.default.statSync(t).isDirectory())throw Error(`"${t}" exists but is not a directory.`);return t}catch(e){throw Error(`Failed to create directory "${t}": ${e.message}`)}}function Ae(e,t=``){let n=G(process.cwd(),e);K(_.default.dirname(n));let r=je(n);if(!r)v.default.writeFileSync(n,t,{encoding:`utf8`,flag:`w`});else{if(!r.isFile())throw Error(`"${n}" exists but is not a file.`);t&&v.default.writeFileSync(n,t,{encoding:`utf8`,flag:`a`})}return n}function je(e){try{return v.default.statSync(e)}catch{return}}async function Me(e,t={}){let n=G(process.cwd(),e),r;try{r=await v.promises.stat(n)}catch(e){if((t.force??!0)&&e.code===`ENOENT`)return;throw e}let{recursive:i=!0,force:a=!0,cleanOnly:o=!1}=t;if(o&&r.isDirectory()){let e=await v.promises.readdir(n);for(let t of e)await v.promises.rm(_.default.join(n,t),{recursive:i,force:a});return}if(o&&r.isFile()){await v.promises.truncate(n,0);return}await v.promises.rm(n,{recursive:r.isDirectory()?i:!1,force:a,maxRetries:3,retryDelay:100})}async function q(e){let t=G(process.cwd(),e),n;try{n=await v.promises.stat(t)}catch{}let r=n?.isDirectory()?t:_.default.dirname(t);try{if(!(await v.promises.stat(r)).isDirectory())throw Error(`"${r}" exists but is not a directory.`)}catch(e){throw e.code===`ENOENT`?Error(`Directory "${r}" does not exist.`):e}return t}async function Ne(e){let t=G(process.cwd(),e);_.default.extname(e)&&console.warn(`[createDirectory] Warning: "${e}" looks like a file path (has extension).`);try{let e;try{e=await v.promises.stat(t)}catch{}if(!e)await v.promises.mkdir(t,{recursive:!0});else if(!e.isDirectory())throw Error(`"${t}" exists but is not a directory.`);return t}catch(e){throw Error(`Failed to create directory "${t}": ${e.message}`)}}async function Pe(e,t=``){let n=G(process.cwd(),e);await q(_.default.dirname(n));try{let e=await Fe(n);if(!e)await v.promises.writeFile(n,t,{encoding:`utf8`,flag:`w`});else{if(!e.isFile())throw Error(`"${n}" exists but is not a file.`);t&&await v.promises.writeFile(n,t,{encoding:`utf8`,flag:`a`})}return n}catch(e){throw Error(`Failed to create file "${n}": ${e.message}`)}}async function Fe(e){try{return await v.promises.stat(e)}catch(e){if(e.code===`ENOENT`)return;throw e}}const J={filterNull:!0,filterUndefined:!0,filterEmptyString:!0,filterEmptyArray:!0,filterEmptyObject:!0};var Y=class{options;instance;constructor(e){this.options=e,this.instance=this.makeInstance()}info(e,t){this.log(`info`,e,t)}debug(e,t){this.log(`debug`,e,t)}trace(e,t){this.log(`trace`,e,t)}warn(e,t){this.log(`warn`,e,t)}error(e,t){this.log(`error`,e,t)}fatal(e,t){this.log(`fatal`,e,t)}child(e){return this.instance.child(e)}log(e,t,n){this.instance[e]({msg:t,...this.formatLogOptions(n)})}formatLogOptions(e){return e?j({flag:e.flag,details:this.formatUnknown(e.details),error:this.formatUnknown(e.error),metadata:this.formatUnknown(e.metadata)},J):{}}formatUnknown(e){if(ue(e)){let t={type:e.constructor.name,message:e.message};this.options.debug&&e.stack&&(t.stack=e.stack);for(let n of Object.keys(e))n in t||(t[n]=e[n]);let n=j(t,J);return N(n)?void 0:n}if(Buffer.isBuffer(e))return`[Buffer]`;if(e&&typeof e.pipe==`function`)return`[Stream]`;if(M(e))try{let t=JSON.stringify(e);if(t===void 0)return;let n=JSON.parse(t);if(Array.isArray(n))return n.length>0?n:void 0;if(M(n)){let e=j(n,J);return N(e)?void 0:e}return n}catch{return{type:`NonSerializableObject`}}return fe(e)?e:String(e)}makeInstance(){if(!this.options.enabled)return(0,y.default)({enabled:!1,timestamp:!0});let e=this.options.transports,t={level:this.makeGlobalLogLevel(e),enabled:!0,timestamp:!0,transport:{targets:this.makeTransportTargets(e)}};return(0,y.default)(t)}makeTransportTargets(e){if(e.filter(e=>e.type===`console`).length>1)throw Error(`[Logger] Multiple console transports are not supported.`);return e.map(e=>{switch(e.type){case`console`:return this.makeConsoleTransportTarget(e);case`file`:return this.makeFileTransportTarget(e)}})}makeConsoleTransportTarget(e){return{target:`pino-pretty`,level:this.makeTransportLevel(e.level),options:e.pretty}}makeFileTransportTarget(e){let t=this.makeTransportLevel(e.level),n=_.default.isAbsolute(e.path)?_.default.normalize(e.path):G(process.cwd(),e.path);return K(_.default.dirname(n)),{target:`pino/file`,level:t,options:{destination:n}}}makeTransportLevel(e){return this.options.debug?`trace`:e??`info`}makeGlobalLogLevel(e){if(this.options.debug)return`trace`;let t=e.at(0);if(!t)return`info`;let n={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},r=this.makeTransportLevel(t.level);for(let t of e.slice(1)){let e=this.makeTransportLevel(t.level);n[e]<n[r]&&(r=e)}return r}},Ie=class{options;constructor(e){this.options=e}assemble(e){e.bind(A.DI.Logger).toConstantValue(new Y(this.options))}};function Le(e={}){let t=e.logger??{enabled:!1};return[...Ee(),new Ie(t)]}function X(e){return process.env[e]?.trim()||void 0}function Re(e){let t=X(e);if(!t)throw Error(`Missing required environment variable: ${e}`);return t}const Z=b.default.string().trim().min(1).transform(e=>{let{prefix:t,base:n}=ze(e),r=Be(n);return{original:e,prefix:t,base:n,kebab:Ve(r),snake:He(r),camel:Ue(r),pascal:We(r)}}),Q=b.default.looseObject({name:Z,version:b.default.string().trim().min(1),private:b.default.boolean().optional(),type:b.default.enum([`module`,`commonjs`]).optional(),dependencies:b.default.record(b.default.string(),b.default.string()).default({}),peerDependencies:b.default.record(b.default.string(),b.default.string()).default({}),devDependencies:b.default.record(b.default.string(),b.default.string()).default({})});function ze(e){let t=/^@([^/]+)\/(.+)$/.exec(e);return t&&t[2]?{prefix:t[1],base:t[2]}:{base:e}}function Be(e){let t=e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[^a-zA-Z0-9]+/g,` `).trim().toLowerCase();return t?t.split(/\s+/):[]}function Ve(e){return e.join(`-`)}function He(e){return e.join(`_`)}function Ue(e){if(e.length===0)return``;let[t,...n]=e;return t+n.map($).join(``)}function We(e){return e.map($).join(``)}function $(e){return e.length===0?``:e.charAt(0).toUpperCase()+e.slice(1)}function Ge(e){let t,n;try{t=v.default.readFileSync(e,`utf8`)}catch(t){throw Error(`Failed to read package.json at ${e}`,{cause:t})}try{n=JSON.parse(t)}catch(t){throw Error(`Failed to parse package.json at ${e}`,{cause:t})}try{return Q.parse(n)}catch(t){throw Error(`Invalid package.json at ${e}`,{cause:t})}}exports.Console=O,exports.LogFlag=De,exports.LoggerImpl=Y,exports.PackageJSONSchema=Q,exports.PackageNameSchema=Z,exports.coreNodeAssembly=Le,exports.createDirectory=ke,exports.createDirectoryAsync=Ne,exports.createFile=Ae,exports.createFileAsync=Pe,exports.ensureDirectory=K,exports.ensureDirectoryAsync=q,exports.loadPackageJSON=Ge,exports.makeDependencyBundlingPolicy=te,exports.optionalEnvironmentVariable=X,exports.removePath=Oe,exports.removePathAsync=Me,exports.requiredEnvironmentVariable=Re,exports.resolvePath=G;
@@ -0,0 +1,454 @@
1
+ import { Bindings, Level, Logger as Logger$1 } from "pino";
2
+ import { PrettyOptions } from "pino-pretty";
3
+ import { Container } from "inversify";
4
+ import z from "zod";
5
+ //#region src-node/bundling/dependency-bundling-policy.d.ts
6
+ /**
7
+ * A module matcher used by dependency bundling policies.
8
+ *
9
+ * Matchers are intentionally generic so the produced policy can be mapped to
10
+ * different bundlers without coupling this API to one build tool.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * 'zod'
15
+ * /^zod(?:\/.*)?$/
16
+ * /^@buildplease\/core(?:\/.*)?$/
17
+ * ```
18
+ */
19
+ type DependencyBundlingMatcher = string | RegExp;
20
+ /**
21
+ * Minimal package manifest shape required to create a dependency bundling policy.
22
+ *
23
+ * The helper intentionally depends only on standard package manifest dependency
24
+ * fields, not on a framework-specific package model.
25
+ */
26
+ type DependencyBundlingPackageJSON = {
27
+ /**
28
+ * Runtime dependencies declared by the package.
29
+ */
30
+ dependencies?: Record<string, string>;
31
+ /**
32
+ * Peer dependencies owned by the consuming application/package.
33
+ */
34
+ peerDependencies?: Record<string, string>;
35
+ };
36
+ /**
37
+ * Describes how package dependencies should be handled by a bundler.
38
+ *
39
+ * This type is bundler-agnostic. Concrete build tools should map it to their
40
+ * own configuration shape.
41
+ *
42
+ * @example tsdown
43
+ * ```ts
44
+ * deps: {
45
+ * neverBundle: policy.external,
46
+ * alwaysBundle: policy.bundle,
47
+ * }
48
+ * ```
49
+ *
50
+ * @example Generic module bundler
51
+ * ```ts
52
+ * external: policy.external
53
+ * noExternal: policy.bundle
54
+ * ```
55
+ */
56
+ type DependencyBundlingPolicy = {
57
+ /**
58
+ * Dependencies or module ids that must stay external.
59
+ *
60
+ * External dependencies are not bundled into the generated output. The emitted
61
+ * file keeps them as runtime imports/requires, so the consuming application or
62
+ * package manager remains responsible for providing them.
63
+ */
64
+ external: DependencyBundlingMatcher[];
65
+ /**
66
+ * Dependencies or module ids that must be bundled.
67
+ *
68
+ * Bundled dependencies are forced into the generated output even when the
69
+ * bundler would normally externalize them.
70
+ *
71
+ * Use this only for packages that would otherwise stay external but must be
72
+ * shipped inside the generated artifact. Imported dev dependencies already
73
+ * bundle by default in tsdown and do not need to be forced here.
74
+ */
75
+ bundle: DependencyBundlingMatcher[];
76
+ };
77
+ /**
78
+ * Options for creating a dependency bundling policy from a package manifest.
79
+ */
80
+ type MakeDependencyBundlingPolicyOptions = {
81
+ /**
82
+ * Dependency/module ids that must be bundled into the output.
83
+ *
84
+ * Use this only when manifest classification would otherwise externalize a
85
+ * package that must be shipped inside the generated artifact. Imported dev
86
+ * dependencies already bundle by default in tsdown.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * bundle: ['some-runtime-dependency']
91
+ * ```
92
+ */
93
+ bundle?: readonly string[];
94
+ /**
95
+ * Additional dependency/module ids that must stay external.
96
+ *
97
+ * Use this for optional dependencies, dynamic imports, virtual modules, native
98
+ * packages, or runtime-provided modules that are not declared in the package
99
+ * manifest.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * external: ['pino/file', '#imports']
104
+ * ```
105
+ */
106
+ external?: readonly string[];
107
+ /**
108
+ * Whether `peerDependencies` should be externalized.
109
+ *
110
+ * Peer dependencies should normally stay external because they are owned by the
111
+ * consuming application/package. Bundling them can create duplicate runtime
112
+ * instances and broken shared contracts.
113
+ *
114
+ * @defaultValue `true`
115
+ */
116
+ includePeers?: boolean;
117
+ /**
118
+ * Whether `dependencies` should be externalized.
119
+ *
120
+ * Libraries should normally keep dependencies external to avoid shipping
121
+ * duplicate copies into consumers. Apps or CLIs may choose to bundle selected
122
+ * dependencies for a more self-contained output.
123
+ *
124
+ * @defaultValue `true`
125
+ */
126
+ includeDependencies?: boolean;
127
+ /**
128
+ * Whether generated package matchers should also match subpath imports.
129
+ *
130
+ * When enabled, a package such as `zod` also matches imports like `zod/v4` using
131
+ * a regular expression matcher.
132
+ *
133
+ * @defaultValue `true`
134
+ */
135
+ includeSubpaths?: boolean;
136
+ /**
137
+ * Whether Node.js built-in modules should be externalized.
138
+ *
139
+ * Enable this for Node.js outputs. Disable it for browser-only outputs so
140
+ * accidental imports such as `node:fs` fail during bundling instead of being
141
+ * silently preserved.
142
+ *
143
+ * @defaultValue `true`
144
+ */
145
+ includeNodeBuiltins?: boolean;
146
+ /**
147
+ * Whether peer dependencies may be forced into the bundle.
148
+ *
149
+ * This is disabled by default because bundling peer dependencies usually
150
+ * violates the package contract. Enable only for intentionally standalone
151
+ * artifacts where duplicate peer instances are acceptable.
152
+ *
153
+ * @defaultValue `false`
154
+ */
155
+ allowPeerBundling?: boolean;
156
+ };
157
+ //#endregion
158
+ //#region src-node/bundling/make-dependency-bundling-policy.d.ts
159
+ declare function makeDependencyBundlingPolicy(pkg: DependencyBundlingPackageJSON, opts?: MakeDependencyBundlingPolicyOptions): DependencyBundlingPolicy;
160
+ //#endregion
161
+ //#region src-node/console/console-options.d.ts
162
+ interface ConsoleOptions {
163
+ readonly enabled?: boolean;
164
+ }
165
+ //#endregion
166
+ //#region src-node/console/console.d.ts
167
+ interface ConsolePanelRow {
168
+ readonly label: string;
169
+ readonly value: string | number;
170
+ }
171
+ declare class Console {
172
+ private readonly instance;
173
+ constructor(options?: ConsoleOptions);
174
+ title(product: string, command: string, rows?: readonly ConsolePanelRow[]): void;
175
+ panel(title: string, rows: readonly ConsolePanelRow[], badge?: string | number): void;
176
+ step(label: string, message: string): string;
177
+ duration(ms: number): string;
178
+ emptyLine(): void;
179
+ log(message?: unknown, ...args: unknown[]): void;
180
+ info(message?: unknown, ...args: unknown[]): void;
181
+ start(message?: unknown, ...args: unknown[]): void;
182
+ success(message?: unknown, ...args: unknown[]): void;
183
+ warn(message?: unknown, ...args: unknown[]): void;
184
+ error(message?: unknown, ...args: unknown[]): void;
185
+ debug(message?: unknown, ...args: unknown[]): void;
186
+ private printPanel;
187
+ private formatPanel;
188
+ private formatPanelTop;
189
+ private formatPanelBottom;
190
+ private formatPanelRow;
191
+ private getPanelWidth;
192
+ private getTitleWidth;
193
+ private getRowsWidth;
194
+ private getRowWidth;
195
+ private visibleLength;
196
+ }
197
+ //#endregion
198
+ //#region src-node/logger/log-flag.d.ts
199
+ declare enum LogFlag {
200
+ Critical = "CRITICAL",
201
+ Serious = "SERIOUS",
202
+ Important = "IMPORTANT",
203
+ Notice = "NOTICE",
204
+ Routine = "ROUTINE"
205
+ }
206
+ //#endregion
207
+ //#region src-node/logger/log-options.d.ts
208
+ interface LogOptions {
209
+ readonly flag?: LogFlag;
210
+ readonly details?: unknown;
211
+ readonly error?: unknown;
212
+ readonly metadata?: unknown;
213
+ }
214
+ //#endregion
215
+ //#region src-node/logger/logger-options.d.ts
216
+ interface BaseLoggerTransportOptions {
217
+ readonly level?: Level;
218
+ }
219
+ interface LoggerConsoleTransportOptions extends BaseLoggerTransportOptions {
220
+ readonly type: 'console';
221
+ readonly target: 'pino-pretty';
222
+ readonly pretty?: PrettyOptions;
223
+ }
224
+ interface LoggerFileTransportOptions extends BaseLoggerTransportOptions {
225
+ readonly type: 'file';
226
+ readonly path: string;
227
+ }
228
+ type LoggerTransportOptions = LoggerConsoleTransportOptions | LoggerFileTransportOptions;
229
+ type LoggerOptions = {
230
+ readonly enabled: false;
231
+ readonly debug?: boolean;
232
+ readonly transports?: never;
233
+ } | {
234
+ readonly enabled: true;
235
+ readonly debug?: boolean;
236
+ readonly transports: readonly [LoggerTransportOptions, ...LoggerTransportOptions[]];
237
+ };
238
+ //#endregion
239
+ //#region src-node/logger/logger.d.ts
240
+ interface Logger {
241
+ readonly instance: Logger$1;
242
+ info(title: string, options?: LogOptions): void;
243
+ debug(title: string, options?: LogOptions): void;
244
+ trace(title: string, options?: LogOptions): void;
245
+ warn(title: string, options?: LogOptions): void;
246
+ error(title: string, options?: LogOptions): void;
247
+ fatal(title: string, options?: LogOptions): void;
248
+ child(bindings: Bindings): Logger$1;
249
+ }
250
+ declare class LoggerImpl implements Logger {
251
+ private readonly options;
252
+ readonly instance: Logger$1;
253
+ constructor(options: LoggerOptions);
254
+ info(title: string, options?: LogOptions): void;
255
+ debug(title: string, options?: LogOptions): void;
256
+ trace(title: string, options?: LogOptions): void;
257
+ warn(title: string, options?: LogOptions): void;
258
+ error(title: string, options?: LogOptions): void;
259
+ fatal(title: string, options?: LogOptions): void;
260
+ child(bindings: Bindings): Logger$1;
261
+ private log;
262
+ private formatLogOptions;
263
+ private formatUnknown;
264
+ private makeInstance;
265
+ private makeTransportTargets;
266
+ private makeConsoleTransportTarget;
267
+ private makeFileTransportTarget;
268
+ private makeTransportLevel;
269
+ private makeGlobalLogLevel;
270
+ }
271
+ //#endregion
272
+ //#region src/di/assembly.d.ts
273
+ type AssemblyContainer = Container;
274
+ interface Assembly {
275
+ assemble(container: AssemblyContainer): void;
276
+ }
277
+ //#endregion
278
+ //#region src-node/di/core-node-assembly.d.ts
279
+ interface CoreNodeAssemblyOptions {
280
+ readonly logger?: LoggerOptions;
281
+ }
282
+ declare function coreNodeAssembly(options?: CoreNodeAssemblyOptions): Assembly[];
283
+ //#endregion
284
+ //#region src-node/environment/environment-variable.d.ts
285
+ declare function optionalEnvironmentVariable(name: string): string | undefined;
286
+ declare function requiredEnvironmentVariable(name: string): string;
287
+ //#endregion
288
+ //#region src-node/file/file-sync.d.ts
289
+ /**
290
+ * Resolve `relative` against `base`, unless `relative` is already absolute,
291
+ * in which case just normalize and return it.
292
+ *
293
+ * @param {string} base
294
+ * A `file://` URL or filesystem path to serve as the base.
295
+ * @param {string} relative
296
+ * A relative path (e.g. `./foo` or `../bar`) or an absolute filesystem path.
297
+ * @returns {string}
298
+ * The resulting absolute (normalized) filesystem path.
299
+ * @throws {Error}
300
+ * If `base` is a non-file URL or cannot be parsed.
301
+ */
302
+ declare function resolvePath(base: string, relative: string): string;
303
+ /**
304
+ * Remove or clean a file or directory.
305
+ *
306
+ * @param {string} target
307
+ * File or directory path (relative or absolute).
308
+ * @param {object} [opts]
309
+ * Removal options.
310
+ * @param {boolean} [opts.recursive=true]
311
+ * Recurse into subdirectories when deleting a directory.
312
+ * @param {boolean} [opts.force=true]
313
+ * Ignore “not found” errors.
314
+ * @param {boolean} [opts.cleanOnly=false]
315
+ * When true:
316
+ * - For a directory: delete its contents but leave the directory itself.
317
+ * - For a file: truncate it without deleting the file.
318
+ * @returns {void}
319
+ */
320
+ declare function removePath(target: string, opts?: {
321
+ recursive?: boolean;
322
+ force?: boolean;
323
+ cleanOnly?: boolean;
324
+ }): void;
325
+ /**
326
+ * Ensures the directory for a given path exists.
327
+ *
328
+ * @param {string} targetPath
329
+ * File or directory path (relative or absolute).
330
+ * @returns {string}
331
+ * The absolute, resolved path.
332
+ * @throws {Error}
333
+ * If the target directory does not exist.
334
+ */
335
+ declare function ensureDirectory(targetPath: string): string;
336
+ /**
337
+ * Creates a directory if it doesn't exist.
338
+ *
339
+ * @param {string} dirPath
340
+ * The path to the directory (relative or absolute).
341
+ * @returns {string}
342
+ * The absolute path to the created directory.
343
+ * @throws {Error}
344
+ * If the path is invalid or a file already exists at that path.
345
+ */
346
+ declare function createDirectory(dirPath: string): string;
347
+ /**
348
+ * Creates a file if it doesn't exist, and optionally seeds/appends content.
349
+ * Also ensures its parent directory exists.
350
+ *
351
+ * @param {string} filePath
352
+ * Path to the file (relative or absolute).
353
+ * @param {string} [content='']
354
+ * Optional string to write into the file (appended if it already exists).
355
+ * @returns {string}
356
+ * The absolute path to the created file.
357
+ * @throws {Error}
358
+ * If the path exists but is not a file, or if writing fails.
359
+ */
360
+ declare function createFile(filePath: string, content?: string): string;
361
+ //#endregion
362
+ //#region src-node/file/file-async.d.ts
363
+ /**
364
+ * Remove or clean a file or directory.
365
+ *
366
+ * @async
367
+ * @param target - File or directory path (relative or absolute).
368
+ * @param opts - Removal options.
369
+ * @param [opts.recursive=true] - Recurse into subdirectories when deleting a directory.
370
+ * @param [opts.force=true] - Ignore “not found” errors (i.e. don’t throw if the path doesn’t exist).
371
+ * @param [opts.cleanOnly=false] - If true:
372
+ * - For a directory: delete its contents but leave the directory itself.
373
+ * - For a file: truncate it (empty its contents) without deleting the file.
374
+ */
375
+ declare function removePathAsync(target: string, opts?: {
376
+ recursive?: boolean;
377
+ force?: boolean;
378
+ cleanOnly?: boolean;
379
+ }): Promise<void>;
380
+ /**
381
+ * Ensures the directory for a given path exists.
382
+ *
383
+ * @async
384
+ * @param targetPath - File or directory path.
385
+ * @returns Absolute resolved path.
386
+ * @throws {Error} If the target directory does not exist.
387
+ */
388
+ declare function ensureDirectoryAsync(targetPath: string): Promise<string>;
389
+ /**
390
+ * Creates a directory if it doesn't exist.
391
+ *
392
+ * @async
393
+ * @param dirPath - The path to the directory.
394
+ * @returns Absolute path to the created directory.
395
+ * @throws {Error} If the directory cannot be created or path is invalid.
396
+ */
397
+ declare function createDirectoryAsync(dirPath: string): Promise<string>;
398
+ /**
399
+ * Creates a file if it doesn't exist, and optionally seeds/appends content.
400
+ * Also ensures its parent directory exists.
401
+ *
402
+ * @async
403
+ * @param filePath - Path to the file (relative or absolute).
404
+ * @param content - Optional string to write into the file (appended if exists).
405
+ * @returns Absolute path to the created file.
406
+ * @throws If the path exists but is not a file, or writing fails.
407
+ */
408
+ declare function createFileAsync(filePath: string, content?: string): Promise<string>;
409
+ //#endregion
410
+ //#region src-node/package-json/package-json.d.ts
411
+ interface PackageNameModel {
412
+ readonly original: string;
413
+ readonly prefix: string | undefined;
414
+ readonly base: string;
415
+ readonly kebab: string;
416
+ readonly snake: string;
417
+ readonly camel: string;
418
+ readonly pascal: string;
419
+ }
420
+ declare const PackageNameSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PackageNameModel, string>>;
421
+ type PackageJSONModel = z.output<typeof PackageJSONSchema>;
422
+ declare const PackageJSONSchema: z.ZodObject<{
423
+ name: z.ZodPipe<z.ZodString, z.ZodTransform<PackageNameModel, string>>;
424
+ version: z.ZodString;
425
+ private: z.ZodOptional<z.ZodBoolean>;
426
+ type: z.ZodOptional<z.ZodEnum<{
427
+ module: "module";
428
+ commonjs: "commonjs";
429
+ }>>;
430
+ dependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
431
+ peerDependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
432
+ devDependencies: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
433
+ }, z.core.$loose>;
434
+ //#endregion
435
+ //#region src-node/package-json/load-package.d.ts
436
+ /**
437
+ * Loads and validates a `package.json` file from the given filesystem path.
438
+ *
439
+ * Node-only utility. Intended for build-time, CLI, or server runtime usage.
440
+ *
441
+ * @param path
442
+ * Absolute or relative path to a `package.json` file.
443
+ *
444
+ * @returns
445
+ * Parsed and validated {@link PackageJSONModel}.
446
+ *
447
+ * @throws
448
+ * - If the file cannot be read.
449
+ * - If the file is not valid JSON.
450
+ * - If the contents do not match {@link PackageJSONSchema}.
451
+ */
452
+ declare function loadPackageJSON(path: string): PackageJSONModel;
453
+ //#endregion
454
+ export { BaseLoggerTransportOptions, Console, ConsoleOptions, ConsolePanelRow, CoreNodeAssemblyOptions, DependencyBundlingMatcher, DependencyBundlingPackageJSON, DependencyBundlingPolicy, LogFlag, LogOptions, Logger, LoggerConsoleTransportOptions, LoggerFileTransportOptions, LoggerImpl, LoggerOptions, LoggerTransportOptions, MakeDependencyBundlingPolicyOptions, PackageJSONModel, PackageJSONSchema, PackageNameModel, PackageNameSchema, coreNodeAssembly, createDirectory, createDirectoryAsync, createFile, createFileAsync, ensureDirectory, ensureDirectoryAsync, loadPackageJSON, makeDependencyBundlingPolicy, optionalEnvironmentVariable, removePath, removePathAsync, requiredEnvironmentVariable, resolvePath };