@lunora/server 1.0.0-alpha.88 → 1.0.0-alpha.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ACTION_CACHE_DEFAULT_TTL_MS as t,ACTION_CACHE_TABLE as n,actionCacheExtension as i,cacheKeyFor as a,defineActionCache as f}from"./packem_shared/ACTION_CACHE_DEFAULT_TTL_MS-DRJUQGut.mjs";import{initLunora as m}from"./packem_shared/initLunora-B2sfmFJ6.mjs";import{createSecrets as p}from"./packem_shared/createSecrets-CyrEddTF.mjs";import{flushDeferredDeletes as c,withDeferredDeletes as l}from"./packem_shared/flushDeferredDeletes-DEJXlhop.mjs";import{DOCUMENT_HISTORY_REDACTED_FIELDS as u,DOCUMENT_HISTORY_TABLE as S,defineDocumentHistory as T,documentHistoryExtension as h}from"./packem_shared/DOCUMENT_HISTORY_REDACTED_FIELDS-KTkC4xOc.mjs";import{LunoraEnvError as g,defineEnv as R,redactSecrets as _}from"./packem_shared/LunoraEnvError-
|
|
1
|
+
import{ACTION_CACHE_DEFAULT_TTL_MS as t,ACTION_CACHE_TABLE as n,actionCacheExtension as i,cacheKeyFor as a,defineActionCache as f}from"./packem_shared/ACTION_CACHE_DEFAULT_TTL_MS-DRJUQGut.mjs";import{initLunora as m}from"./packem_shared/initLunora-B2sfmFJ6.mjs";import{createSecrets as p}from"./packem_shared/createSecrets-CyrEddTF.mjs";import{flushDeferredDeletes as c,withDeferredDeletes as l}from"./packem_shared/flushDeferredDeletes-DEJXlhop.mjs";import{DOCUMENT_HISTORY_REDACTED_FIELDS as u,DOCUMENT_HISTORY_TABLE as S,defineDocumentHistory as T,documentHistoryExtension as h}from"./packem_shared/DOCUMENT_HISTORY_REDACTED_FIELDS-KTkC4xOc.mjs";import{LunoraEnvError as g,defineEnv as R,redactSecrets as _}from"./packem_shared/LunoraEnvError-_BakoYQ3.mjs";import{LunoraError as L}from"./packem_shared/LunoraError-DcKdk9Ti.mjs";import{bindOrm as I,bindTableFacade as y}from"./packem_shared/bindOrm-lWdeDi9P.mjs";import{httpAction as P,httpRoute as b,httpRouter as F,isSafeHeaderValue as O,serveStorageObject as H}from"./packem_shared/httpAction-D3b9-YiY.mjs";import{defineIdentity as U}from"./packem_shared/defineIdentity-DwkNKwYa.mjs";import{onConnect as v,onDisconnect as B,onShardInit as V}from"./packem_shared/onConnect-BLRoOpv2.mjs";import{DEFAULT_LIMIT as j,DEFAULT_MAX_LIMIT as W,clampLimit as Y,defineListArgs as J}from"./packem_shared/DEFAULT_LIMIT-DC-M6faS.mjs";import{defineMigration as Q}from"./packem_shared/defineMigration-7GI9Qbtd.mjs";import{defineMutator as q}from"./packem_shared/defineMutator-DKy8UtbB.mjs";import{c as G,d as Z,a as $,b as ee,e as oe,f as re,g as te,h as ne,i as ie,j as ae,k as fe,m as se}from"./packem_shared/plugin-DQcLxTx1.mjs";import{PRESENCE_DEFAULT_TTL_MS as de,PRESENCE_TABLE as pe,definePresence as xe,presenceExtension as ce}from"./packem_shared/PRESENCE_DEFAULT_TTL_MS-BpSPSCwL.mjs";import{protectPublic as Ee}from"./packem_shared/protectPublic-Bo4G9xaV.mjs";import{onQueryChange as Se}from"./packem_shared/onQueryChange-pRK6Dh3g.mjs";import{defineShape as he}from"./packem_shared/defineShape-DYxbNl5W.mjs";import{anyApi as ge}from"./types.mjs";import{cronJobs as _e}from"@lunora/scheduler";import{ValidationError as Le,v as Ce}from"@lunora/values";import{allowAll as ye,deny as Me,isDeny as Pe,toWhereInput as be}from"./packem_shared/allowAll-DkRAgItV.mjs";import{asBucketStorage as Oe}from"./packem_shared/asBucketStorage-BthCnWop.mjs";import{buildMaskRegistry as Ne}from"./packem_shared/buildMaskRegistry-72SL8fJn.mjs";import{buildRlsReadRegistry as ke,composeShapeReadWhere as ve}from"./packem_shared/buildRlsReadRegistry-Deq8inqS.mjs";import{createPolicyDsl as Ve,definePermission as we,definePolicies as je,definePolicy as We,defineRole as Ye}from"./packem_shared/createPolicyDsl-DNfByAUX.mjs";import{defineStorageRule as Ke,defineStorageRules as Qe}from"./packem_shared/defineStorageRule-BvxHVq3b.mjs";import{mask as qe}from"./packem_shared/mask-Da7q82ZC.mjs";import{r as Ge}from"./packem_shared/middleware-DEW0yLvU.mjs";import{storageRules as $e}from"./packem_shared/storageRules-CyaiZ0av.mjs";const e="0.0.0";export{t as ACTION_CACHE_DEFAULT_TTL_MS,n as ACTION_CACHE_TABLE,j as DEFAULT_LIMIT,W as DEFAULT_MAX_LIMIT,u as DOCUMENT_HISTORY_REDACTED_FIELDS,S as DOCUMENT_HISTORY_TABLE,g as LunoraEnvError,L as LunoraError,de as PRESENCE_DEFAULT_TTL_MS,pe as PRESENCE_TABLE,e as VERSION,Le as ValidationError,i as actionCacheExtension,ye as allowAll,ge as anyApi,Oe as asBucketStorage,I as bindOrm,y as bindTableFacade,Ne as buildMaskRegistry,ke as buildRlsReadRegistry,a as cacheKeyFor,Y as clampLimit,G as composePluginMiddleware,ve as composeShapeReadWhere,Ve as createPolicyDsl,p as createSecrets,_e as cronJobs,f as defineActionCache,Z as defineAggregateIndex,$ as defineComponent,T as defineDocumentHistory,R as defineEnv,U as defineIdentity,J as defineListArgs,Q as defineMigration,q as defineMutator,we as definePermission,ee as definePlugin,je as definePolicies,We as definePolicy,xe as definePresence,oe as defineRankIndex,Ye as defineRole,re as defineSchema,te as defineSchemaExtension,he as defineShape,Ke as defineStorageRule,Qe as defineStorageRules,ne as defineTable,ie as defineVectorIndex,Me as deny,h as documentHistoryExtension,c as flushDeferredDeletes,P as httpAction,b as httpRoute,F as httpRouter,ae as indexFieldsFromSchema,m as initLunora,fe as installPlugins,Pe as isDeny,O as isSafeHeaderValue,qe as mask,se as mergeSchemaExtension,v as onConnect,B as onDisconnect,Se as onQueryChange,V as onShardInit,ce as presenceExtension,Ee as protectPublic,_ as redactSecrets,Ge as rls,H as serveStorageObject,$e as storageRules,be as toWhereInput,Ce as v,l as withDeferredDeletes};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{LunoraError as A}from"@lunora/errors";import{optionalInner as h}from"@lunora/values";const b=/(?:key|password|secret|token)$/iu,d=t=>b.test(t),
|
|
1
|
+
import{LunoraError as A}from"@lunora/errors";import{optionalInner as h}from"@lunora/values";const b=/(?:key|password|secret|token)$/iu,d=t=>b.test(t),L=[/^sk_/u,/^pk_/u,/^rk_/u,/^ghp_/u,/^gho_/u,/^ghs_/u,/^ghr_/u,/^github_pat_/u,/^xox[baprs]-/u,/^AKIA/u,/^AIza/u,/^Bearer\s/u],w=/[\w./+-]{24,}/gu,p=/^[\w./+-]+$/u,I=/\b(?:(?:sk|pk|rk|ghp|gho|ghs|ghr)_[\w./+-]*|github_pat_[\w./+-]*|xox[baprs]-[\w./+-]*)/gu,N=/\b(?:AKIA|AIza)[\w./+-]+|Bearer\s+[\w./+-]+/gu,v=/:\/\/([\w.%+-]*):[\w.%+-]+@/gu,a="[redacted]",D=t=>{if(L.some(n=>n.test(t)))return!0;const e=t.trim();return e.length>=24&&p.test(e)},S=/(["'])(?<inner>(?:\\.|(?!\1).)*)\1/gu,y=/\b(?<key>[A-Za-z_]\w*)\s*[=:]\s*\S+/gu,T=t=>{let e=t;return e=e.replaceAll(S,(n,...r)=>{const s=r.at(-1);return s?.inner!==void 0&&D(s.inner)?a:n}),e=e.replaceAll(v,(n,r)=>`://${r}:${a}@`),e=e.replaceAll(I,a),e=e.replaceAll(N,a),e=e.replaceAll(y,(n,...r)=>{const s=r.at(-1);return s?.key!==void 0&&d(s.key)?`${s.key}=${a}`:n}),e=e.replaceAll(w,a),e},R=(t,e,n)=>{const r=T(t);return typeof n=="string"&&n!==""&&d(e)?r.replaceAll(n,a):r};class g extends A{failures;constructor(e){const n=e.map(r=>` - ${r.key}: ${r.message}`).join(`
|
|
2
2
|
`);super("ENV_INVALID",`Invalid environment (${String(e.length)} key(s)):
|
|
3
3
|
${n}`,{name:"LunoraEnvError"}),this.failures=e}}const $=new Set(["1","on","true","yes"]),K=new Set(["0","false","no","off"]),O=/^-?\d+$/u,k=t=>{if(t.kind!=="optional")return t.kind;const e=h(t);return e?k(e):t.kind},U=(t,e)=>{if(typeof e!="string")return e;switch(k(t)){case"bigint":return O.test(e.trim())?BigInt(e.trim()):e;case"boolean":{const n=e.trim().toLowerCase();return $.has(n)?!0:K.has(n)?!1:e}case"number":{const n=e.trim();if(n==="")return e;const r=Number(n);return Number.isNaN(r)?e:r}default:return e}},_=(t,e,n,r)=>{const s=n[t];if(s===void 0&&e.kind==="optional")return{ok:!0,value:void 0};const c=e.safeParse(U(e,s));return c.ok?{ok:!0,value:c.value}:(r.push({key:t,message:R(c.error.message,t,s)}),{ok:!1})},m=t=>{if(typeof t!="object"||t===null)throw new g([{key:"<env>",message:`expected an object, received ${t===null?"null":typeof t}`}]);return t},F=t=>{const e=Object.keys(t),n=new WeakMap,r=(s=>{const c=m(s);let i=n.get(c);i===void 0&&(i=new Map,n.set(c,i));const l=i,E=u=>{if(l.has(u))return l.get(u);const o=[],f=_(u,t[u],c,o);if(!f.ok)throw new g(o);return l.set(u,f.value),f.value};return new Proxy({},{get(u,o){if(!(typeof o!="string"||!(o in t)))return E(o)},getOwnPropertyDescriptor(u,o){if(typeof o=="string"&&o in t)return{configurable:!0,enumerable:!0,value:E(o),writable:!1}},has(u,o){return typeof o=="string"&&o in t},ownKeys(){return e}})});return r.parse=s=>{const c=m(s),i=[],l={};for(const E of e){const u=_(E,t[E],c,i);u.ok&&u.value!==void 0&&(l[E]=u.value)}if(i.length>0)throw new g(i);return l},r};export{g as LunoraEnvError,F as defineEnv,T as redactSecrets};
|