@lunora/config 1.0.0-alpha.457 → 1.0.0-alpha.458

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 (37) hide show
  1. package/dist/cloudflare/index.d.mts +131 -4
  2. package/dist/cloudflare/index.d.ts +131 -4
  3. package/dist/cloudflare/index.mjs +1 -1
  4. package/dist/index.d.mts +2 -2
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.mjs +1 -1
  7. package/dist/packem_shared/{POLICY_SCAFFOLD_ENDPOINT-Dbf2T3ge.mjs → POLICY_SCAFFOLD_ENDPOINT-CXr3lZGF.mjs} +1 -1
  8. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-B8WSlhBx.mjs +1 -0
  9. package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-CH9VLiit.mjs → SCHEMA_EDIT_ENDPOINT-CUN4q8oi.mjs} +1 -1
  10. package/dist/packem_shared/{STUDIO_PATH-DS-RQwqa.mjs → STUDIO_PATH-BFXK7eku.mjs} +1 -1
  11. package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-Cf3uQ2s0.mjs +1 -0
  12. package/dist/packem_shared/{assertWranglerSatisfiesSchema-DmkdB-OW.mjs → assertWranglerSatisfiesSchema-BSIX4ljM.mjs} +1 -1
  13. package/dist/packem_shared/asset-headers-CGvrhfGW.mjs +4 -0
  14. package/dist/packem_shared/collectExportGaps-CJPSXdEn.mjs +2 -0
  15. package/dist/packem_shared/emitProjectAssetHeaders-C0Ec7nsF.mjs +1 -0
  16. package/dist/packem_shared/env-flag-u4B05gLp.mjs +1 -0
  17. package/dist/packem_shared/{infer-bindings.d-oAX6QJZ1.d.mts → infer-bindings.d-Tkaosiub.d.mts} +11 -1
  18. package/dist/packem_shared/{infer-bindings.d-oAX6QJZ1.d.ts → infer-bindings.d-Tkaosiub.d.ts} +11 -1
  19. package/dist/packem_shared/inferLunoraBindings-D0QDcugr.mjs +1 -0
  20. package/dist/packem_shared/is-plain-object-CWxHeOY1.mjs +1 -0
  21. package/dist/packem_shared/reconcile-assets-DXQsm--3.mjs +1 -0
  22. package/dist/packem_shared/{reconcileBindingsSafely-DxqNSWgO.mjs → reconcileBindingsSafely-BKL4MGWX.mjs} +1 -1
  23. package/dist/packem_shared/spa-assets-C591NPiX.mjs +1 -0
  24. package/dist/packem_shared/withTailConsumer-BUDKESwC.mjs +1 -0
  25. package/dist/packem_shared/wranglerCodegenInputs-BPoRg-2G.mjs +1 -0
  26. package/dist/packem_shared/{write-atomic-BqwShT1P.mjs → write-atomic-B8e7rVyT.mjs} +1 -1
  27. package/dist/packem_shared/writeAssetHeaders-BWSEaedL.mjs +1 -0
  28. package/dist/studio-host/index.mjs +1 -1
  29. package/package.json +2 -2
  30. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-C8qfwbaA.mjs +0 -1
  31. package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-07SNQ0rP.mjs +0 -1
  32. package/dist/packem_shared/collectExportGaps-DdO9kQl-.mjs +0 -2
  33. package/dist/packem_shared/guards-Buu_E7mP.mjs +0 -1
  34. package/dist/packem_shared/inferLunoraBindings-D_ZmrP5I.mjs +0 -1
  35. package/dist/packem_shared/validate-bindings-PVHSAU6M.mjs +0 -1
  36. package/dist/packem_shared/withTailConsumer-CF3pk_Ov.mjs +0 -1
  37. package/dist/packem_shared/wranglerCodegenInputs-kVsmyTP0.mjs +0 -1
@@ -1 +0,0 @@
1
- import{i as u,a as f}from"./guards-Buu_E7mP.mjs";import{o as v}from"./validate-bindings-PVHSAU6M.mjs";const _=new Set(["1","enabled","on","true","yes"]),A=s=>typeof s=="string"&&_.has(s.trim().toLowerCase()),b=(s,t,e,i)=>{s!==void 0&&typeof s!="boolean"&&e.push(`${t} must be a boolean${i===void 0?"":` (${i})`}`)},O=(s,t,e)=>{s!==void 0&&(typeof s!="number"||Number.isNaN(s)||s<0||s>1)&&e.push(`${t} must be a number in [0, 1] (the fraction of requests sampled)`)},N=(s,t,e)=>{const i=s.send_email;if(i===void 0)return;if(!Array.isArray(i)){t.push("send_email must be an array of { name, destination_address? } entries");return}const n=i;for(const[o,a]of n.entries())(!a||typeof a!="object"||typeof a.name!="string"||a.name.length===0)&&e.push(`send_email[${String(o)}] has no non-empty "name" naming the send-email binding — set one before deploying`)},k=(s,t)=>{b(s.logpush,"logpush",t,'set "logpush": true to enable Cloudflare Logpush')},I=(s,t)=>{const e=s.secrets;if(e===void 0)return;const i=typeof e=="object"&&e!==null&&!Array.isArray(e)?e.required:void 0;(!Array.isArray(i)||i.some(n=>typeof n!="string"||n===""))&&t.push('secrets must be an object whose "required" is an array of secret names (e.g. { "required": ["API_KEY"] })')},m=3e5,C=(s,t)=>{const{limits:e}=s;if(e===void 0)return;if(typeof e!="object"||Array.isArray(e)){t.push('limits must be an object (e.g. { "cpu_ms": 30000 })');return}const i=e.cpu_ms;if(i!==void 0){if(typeof i!="number"||!Number.isFinite(i)||!Number.isInteger(i)||i<=0){t.push("limits.cpu_ms must be a positive integer number of milliseconds");return}i>m&&t.push(`limits.cpu_ms must be at most ${String(m)} (Cloudflare's per-invocation ceiling)`)}},p=new Set(["off","smart","targeted"]),w=(s,t)=>{const{placement:e}=s;if(e===void 0)return;if(typeof e!="object"||e===null||Array.isArray(e)){t.push('placement must be an object (e.g. { "mode": "smart" })');return}const{mode:i}=e;i!==void 0&&(typeof i!="string"||!p.has(i))&&t.push(`placement.mode must be one of ${[...p].map(n=>`"${n}"`).join(", ")}`)},c={kind:"boolean"},h={kind:"samplingRate"},y={destinations:{kind:"destinations"},enabled:c,head_sampling_rate:h,persist:c},S={...y,invocation_logs:{hint:'set "invocation_logs": true to keep per-invocation summaries',kind:"boolean"}},L={enabled:c,head_sampling_rate:h,issues:{kind:"level",level:{enabled:c}},logs:{kind:"level",level:S},redact_query_string:c,traces:{kind:"level",level:y}},E=(s,t,e,i)=>{switch(s.kind){case"boolean":{b(t,e,i,s.hint);break}case"destinations":{t!==void 0&&(!Array.isArray(t)||t.some(n=>!f(n)))&&i.push(`${e} must be an array of destination names configured in the Cloudflare dashboard`);break}case"samplingRate":{O(t,e,i);break}}},g=(s,t,e,i,n)=>{for(const[o,a]of Object.entries(s)){const r=Object.hasOwn(t,o)?t[o]:void 0,l=`${e}.${o}`;r===void 0?n.push(`${l} is not a documented wrangler key (expected one of ${Object.keys(t).join(", ")}) — a typo is silently ignored by wrangler`):r.kind!=="level"?E(r,a,l,i):u(a)?g(a,r.level,l,i,n):a!==void 0&&i.push(`${l} must be an object`)}},x=(s,t,e)=>{const{observability:i}=s;if(i!==void 0){if(!u(i)){t.push('observability must be an object (e.g. { "enabled": true, "head_sampling_rate": 1 })');return}g(i,L,"observability",t,e)}},D=(s,t)=>{const{cache:e}=s;if(e!==void 0){if(!u(e)){t.push('cache must be an object (e.g. { "enabled": true })');return}b(e.enabled,"cache.enabled",t)}},T=(s,t)=>{const{exports:e}=s;if(e!==void 0){if(typeof e!="object"||e===null||Array.isArray(e)){t.push("exports must be an object keyed by entrypoint name");return}for(const[i,n]of Object.entries(e)){if(typeof n!="object"||n===null){t.push(`exports["${i}"] must be an object`);continue}n.type!==void 0&&typeof n.type!="string"&&t.push(`exports["${i}"].type must be a string`),n.cache!==void 0&&(typeof n.cache!="object"||n.cache===null||Array.isArray(n.cache)?t.push(`exports["${i}"].cache must be an object`):n.cache.enabled!==void 0&&typeof n.cache.enabled!="boolean"&&t.push(`exports["${i}"].cache.enabled must be a boolean`))}}},B=(s,t)=>{const{assets:e}=s;if(e!==void 0){if(typeof e!="object"||Array.isArray(e)){t.push('assets must be an object (e.g. { "directory": "./dist/client", "binding": "ASSETS" })');return}(typeof e.directory!="string"||e.directory.length===0)&&t.push('assets must declare a non-empty "directory" pointing at the built client output (e.g. "./dist/client")'),e.binding!==void 0&&(typeof e.binding!="string"||e.binding.length===0)&&t.push('assets.binding must be a non-empty string (e.g. "ASSETS")'),e.html_handling!==void 0&&typeof e.html_handling!="string"&&t.push("assets.html_handling must be a string"),e.not_found_handling!==void 0&&typeof e.not_found_handling!="string"&&t.push("assets.not_found_handling must be a string")}},U=(s,t)=>{const e=s.tail_consumers;if(e===void 0)return;if(!Array.isArray(e)){t.push("tail_consumers must be an array of { service, environment? } entries");return}const i=e;for(const[n,o]of i.entries())(!o||typeof o!="object"||typeof o.service!="string"||o.service.length===0)&&t.push(`tail_consumers[${String(n)}] must have a non-empty "service" naming the consumer Worker`)},G=(s,t)=>{const e=s.tail_consumers??[];return e.some(n=>!!n&&n?.service===t.service&&n?.environment===t.environment)?s:{...s,tail_consumers:[...e,t]}},P=(s,t)=>{const{vars:e}=s;if(!e||typeof e!="object")return;const i=e.LUNORA_ALLOWED_ORIGINS,n=e.LUNORA_CORS_ALLOW_CREDENTIALS,o=typeof i=="string"&&i.split(",").some(r=>r.trim()==="*"),a=A(n);o&&a&&t.push('vars.LUNORA_ALLOWED_ORIGINS includes a "*" wildcard while vars.LUNORA_CORS_ALLOW_CREDENTIALS is on — browsers reject this combination and it defeats the allowlist; name explicit origins or drop credentials')},j=s=>v(s.durable_objects?.bindings).some(t=>t.class_name==="SchedulerDO"&&t.script_name===void 0),d="LUNORA_ORIGIN_URL",W=(s,t,e,i=j(s)?"durable_objects.bindings declares the SchedulerDO":void 0)=>{if(i===void 0||f(s.vars?.[d]))return;const n=t===void 0?"vars":`env.${t}.vars`,o=t===void 0?"":` --env ${t}`;e.push(`${i} but ${n}.${d} is unset — the DO reads its dispatch origin from its own env and refuses to schedule without it, so every ctx.scheduler.runAfter/runAt fails with ORIGIN_NOT_CONFIGURED. Set ${n}.${d} to the worker's public URL, or \`wrangler secret put ${d}${o}\` (ignore this if it is already set as a secret or in the dashboard).`)};export{B as validateAssets,D as validateCache,P as validateCorsVariables,T as validateExports,C as validateLimits,k as validateLogpush,x as validateObservability,w as validatePlacement,W as validateSchedulerOrigin,I as validateSecretsRequired,N as validateSendEmail,U as validateTailConsumers,G as withTailConsumer};
@@ -1 +0,0 @@
1
- import{relative as t}from"node:path";import{i as o}from"./guards-Buu_E7mP.mjs";import{findWranglerFile as u,readWranglerJsonc as d}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{scanWranglerVariablesForSecrets as l}from"./scanWranglerVariablesForSecrets-CkonQUdG.mjs";const n=(s,e)=>{const r=s?.producers;return(Array.isArray(r)?r:[]).flatMap(i=>o(i)&&typeof i.binding=="string"&&typeof i.queue=="string"?[{binding:i.binding,queue:i.queue,...e===void 0?{}:{env:e}}]:[])},v=s=>{const e=u(s),r=e===void 0?void 0:d(e).parsed;return e===void 0||r===void 0?{wranglerQueueProducers:[],wranglerVariables:[]}:{wranglerQueueProducers:[...n(r.queues),...Object.entries(r.env??{}).flatMap(([a,i])=>n(i?.queues,a))],wranglerVariables:l(o(r.vars)?r.vars:void 0,t(s,e))}};export{v as wranglerCodegenInputs};