@lunora/codegen 1.0.0-alpha.190 → 1.0.0-alpha.191
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.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{GENERATED_HEADER-DycP5oCG.mjs → GENERATED_HEADER-VOvxb_1e.mjs} +1 -1
- package/dist/packem_shared/{NOTIFY_FILENAME-CZh4jN4q.mjs → NOTIFY_FILENAME-Bgq52CnU.mjs} +1 -1
- package/dist/packem_shared/{OPENRPC_VERSION-BNobmd0k.mjs → OPENRPC_VERSION-COQLvoDY.mjs} +1 -1
- package/dist/packem_shared/{SCHEMA_SNAPSHOT_FILENAME-DLqvtzGf.mjs → SCHEMA_SNAPSHOT_FILENAME-CuWCb603.mjs} +4 -4
- package/dist/packem_shared/{buildOpenApiDocument-BomWVHVV.mjs → buildOpenApiDocument-D_-3ZGH1.mjs} +1 -1
- package/dist/packem_shared/chain-BWtZ1NER.mjs +1 -0
- package/dist/packem_shared/classify-procedure-call-BIlyTUBD.mjs +1 -0
- package/dist/packem_shared/{context-property-calls-Ce9xGl_o.mjs → context-property-calls-H37QsE0Q.mjs} +1 -1
- package/dist/packem_shared/{discoverFunctions-DB9G_XrW.mjs → discoverFunctions-C9O2RBTz.mjs} +1 -1
- package/dist/packem_shared/discoverHyperdriveCalls-DP3Vb0HC.mjs +1 -0
- package/dist/packem_shared/{discoverMaskProcedures-BLAzNB90.mjs → discoverMaskProcedures-CNkhbP5z.mjs} +1 -1
- package/dist/packem_shared/{discoverNondeterministicCalls-DkVVHe3U.mjs → discoverNondeterministicCalls-Dy6k2aPS.mjs} +1 -1
- package/dist/packem_shared/discoverR2sqlCalls-FaK1-wbV.mjs +1 -0
- package/dist/packem_shared/{discoverRlsMetadata-CwWRPb8N.mjs → discoverRlsMetadata-DwULXx5T.mjs} +1 -1
- package/dist/packem_shared/{discoverRlsProcedures-vJZq3yhb.mjs → discoverRlsProcedures-D_J8cH-m.mjs} +1 -1
- package/dist/packem_shared/{discoverStorageRulesMetadata-xhxu-mkS.mjs → discoverStorageRulesMetadata-C3ywuLJd.mjs} +1 -1
- package/dist/packem_shared/{emit-B_n-PvH3.mjs → emit-CTDEkEXh.mjs} +59 -50
- package/dist/packem_shared/{emitApp-DvDGeMCt.mjs → emitApp-DLEEN6Yy.mjs} +1 -1
- package/dist/packem_shared/{exported-procedure-chains-C9FHwphy.mjs → exported-procedure-chains-Bqdp4ywr.mjs} +1 -1
- package/dist/packem_shared/{index-D_Z8rX-f.mjs → index-C4eKBBMk.mjs} +1 -1
- package/package.json +3 -3
- package/dist/packem_shared/chain-Dp_6wzI9.mjs +0 -1
- package/dist/packem_shared/classify-procedure-call-C8jbo0IJ.mjs +0 -1
- package/dist/packem_shared/discoverHyperdriveCalls-DgAYcZRD.mjs +0 -1
- package/dist/packem_shared/discoverR2sqlCalls-6u0OKy2N.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -512,13 +512,14 @@ interface FunctionIR {
|
|
|
512
512
|
filePath: string;
|
|
513
513
|
kind: "action" | "mutation" | "query" | "stream";
|
|
514
514
|
/**
|
|
515
|
-
* Set on
|
|
516
|
-
*
|
|
517
|
-
* lands in `LUNORA_FUNCTIONS` for path
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
|
|
521
|
-
|
|
515
|
+
* Set on lifecycle hooks (`onConnect`/`onDisconnect`/`onShardInit`/
|
|
516
|
+
* `onQueryChange`/`onWhisper`): the moment the hook fires on. Such a function
|
|
517
|
+
* is also an internal registration (so it lands in `LUNORA_FUNCTIONS` for path
|
|
518
|
+
* dispatch) — a mutation for every moment except `whisper`, which is a query;
|
|
519
|
+
* emit additionally collects it into the `LUNORA_LIFECYCLE_HOOKS` manifest
|
|
520
|
+
* keyed by this moment. Absent on ordinary functions.
|
|
521
|
+
*/
|
|
522
|
+
lifecycle?: "connect" | "disconnect" | "init" | "reactor" | "whisper";
|
|
522
523
|
/**
|
|
523
524
|
* The `.output(validator)` declaration, when the chain has one.
|
|
524
525
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -512,13 +512,14 @@ interface FunctionIR {
|
|
|
512
512
|
filePath: string;
|
|
513
513
|
kind: "action" | "mutation" | "query" | "stream";
|
|
514
514
|
/**
|
|
515
|
-
* Set on
|
|
516
|
-
*
|
|
517
|
-
* lands in `LUNORA_FUNCTIONS` for path
|
|
518
|
-
*
|
|
519
|
-
*
|
|
520
|
-
|
|
521
|
-
|
|
515
|
+
* Set on lifecycle hooks (`onConnect`/`onDisconnect`/`onShardInit`/
|
|
516
|
+
* `onQueryChange`/`onWhisper`): the moment the hook fires on. Such a function
|
|
517
|
+
* is also an internal registration (so it lands in `LUNORA_FUNCTIONS` for path
|
|
518
|
+
* dispatch) — a mutation for every moment except `whisper`, which is a query;
|
|
519
|
+
* emit additionally collects it into the `LUNORA_LIFECYCLE_HOOKS` manifest
|
|
520
|
+
* keyed by this moment. Absent on ordinary functions.
|
|
521
|
+
*/
|
|
522
|
+
lifecycle?: "connect" | "disconnect" | "init" | "reactor" | "whisper";
|
|
522
523
|
/**
|
|
523
524
|
* The `.output(validator)` declaration, when the chain has one.
|
|
524
525
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as s,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{formatAdvisories as m,lintSchema as d,toAdvisorContext as f}from"./packem_shared/formatAdvisories-CkEu1eye.mjs";import{describeErrorLevelFindings as c,errorAdvisoryNames as n,errorPlatformDiagnosticNames as l}from"./packem_shared/describeErrorLevelFindings-D23VSkFP.mjs";import{CodegenDiagnosticError as x,diagnosticAt as E}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as u,discoverAgents as v}from"./packem_shared/AGENTS_FILENAME-B78F7DuQ.mjs";import{listLunoraSourceFiles as g}from"./packem_shared/listLunoraSourceFiles-D4xthUf-.mjs";import{default as O}from"./packem_shared/discoverAuthApiCalls-DoblmzUW.mjs";import{CONTAINERS_FILENAME as M,discoverContainers as T}from"./packem_shared/CONTAINERS_FILENAME-CQoUu7n7.mjs";import{default as h}from"./packem_shared/discoverCrons-CMu0sA8k.mjs";import{FLAGS_FILENAME as F,discoverFlags as I}from"./packem_shared/FLAGS_FILENAME-CoTJH0-7.mjs";import{default as D}from"./packem_shared/discoverFunctions-
|
|
1
|
+
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots as s,serializeSchemaSnapshot as a}from"./packem_shared/SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{formatAdvisories as m,lintSchema as d,toAdvisorContext as f}from"./packem_shared/formatAdvisories-CkEu1eye.mjs";import{describeErrorLevelFindings as c,errorAdvisoryNames as n,errorPlatformDiagnosticNames as l}from"./packem_shared/describeErrorLevelFindings-D23VSkFP.mjs";import{CodegenDiagnosticError as x,diagnosticAt as E}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as u,discoverAgents as v}from"./packem_shared/AGENTS_FILENAME-B78F7DuQ.mjs";import{listLunoraSourceFiles as g}from"./packem_shared/listLunoraSourceFiles-D4xthUf-.mjs";import{default as O}from"./packem_shared/discoverAuthApiCalls-DoblmzUW.mjs";import{CONTAINERS_FILENAME as M,discoverContainers as T}from"./packem_shared/CONTAINERS_FILENAME-CQoUu7n7.mjs";import{default as h}from"./packem_shared/discoverCrons-CMu0sA8k.mjs";import{FLAGS_FILENAME as F,discoverFlags as I}from"./packem_shared/FLAGS_FILENAME-CoTJH0-7.mjs";import{default as D}from"./packem_shared/discoverFunctions-C9O2RBTz.mjs";import{default as U}from"./packem_shared/discoverHttpRoutes-S81Iv_iB.mjs";import{default as H}from"./packem_shared/discoverHyperdriveCalls-DP3Vb0HC.mjs";import{default as y}from"./packem_shared/discoverInserts-COk-Sm_n.mjs";import{d as W}from"./packem_shared/index-C4eKBBMk.mjs";import{default as V}from"./packem_shared/discoverMigrations-B_sYrTyE.mjs";import{MUTATORS_FILENAME as Q,discoverMutators as w}from"./packem_shared/MUTATORS_FILENAME-CTHlZ1j6.mjs";import{default as q}from"./packem_shared/discoverNondeterministicCalls-Dy6k2aPS.mjs";import{NOTIFY_FILENAME as Y,discoverNotifyCalls as X,discoverNotifyConfig as Z}from"./packem_shared/NOTIFY_FILENAME-Bgq52CnU.mjs";import{default as ee}from"./packem_shared/readPackageDependencies-C6h6FZuP.mjs";import{d as oe}from"./packem_shared/queries-CPlxXagL.mjs";import{QUEUES_FILENAME as se,discoverQueues as ae}from"./packem_shared/QUEUES_FILENAME-Q3CF3uYr.mjs";import{default as me}from"./packem_shared/discoverR2sqlCalls-FaK1-wbV.mjs";import{default as fe}from"./packem_shared/discoverRlsProcedures-D_J8cH-m.mjs";import{default as ce}from"./packem_shared/discoverRlsMetadata-DwULXx5T.mjs";import{discoverSandboxUsage as le}from"./packem_shared/discoverSandboxUsage-DskdDbkM.mjs";import{default as xe}from"./packem_shared/discoverSchema-DoZtXwLg.mjs";import{SHAPES_FILENAME as Ae,discoverShapes as ue}from"./packem_shared/SHAPES_FILENAME-Bvd5kgsF.mjs";import{default as Ne}from"./packem_shared/discoverStorageRulesMetadata-C3ywuLJd.mjs";import{WORKFLOWS_FILENAME as Ce,discoverWorkflows as Oe}from"./packem_shared/WORKFLOWS_FILENAME-BaSbufF2.mjs";import{G as Me,e as Te,a as _e,b as he,c as Le,d as Fe,f as Ie,g as Pe,h as De,i as Ge,j as Ue,k as be,l as He,m as je,n as ye}from"./packem_shared/emit-CTDEkEXh.mjs";import{emitApp as We}from"./packem_shared/emitApp-DLEEN6Yy.mjs";import{isD1GlobalTable as Ve,isHyperdriveGlobalTable as ze}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as we,emitOpenApi as Je,emitOpenApiModule as qe}from"./packem_shared/buildOpenApiDocument-D_-3ZGH1.mjs";import{OPENRPC_VERSION as Ye,buildOpenRpcDocument as Xe,emitOpenRpc as Ze,emitOpenRpcModule as $e}from"./packem_shared/OPENRPC_VERSION-COQLvoDY.mjs";import{DEFAULT_TARGET as rr,platformMatrixIds as or,readProjectTarget as tr,resolveCodegenTarget as sr}from"./packem_shared/DEFAULT_TARGET-DtzlGawL.mjs";import{PROJECT_CONFIG_FILENAMES as ir,findProjectConfigFile as mr,loadProjectConfig as dr,readProjectConfigLiterals as fr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-D29yBg5X.mjs";import{SCHEMA_SNAPSHOT_FILENAME as cr,createCodegenProject as nr,findTsconfig as lr,refreshCodegenProject as Sr,runCodegen as xr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-CuWCb603.mjs";import{SchemaSnapshotParseError as Ar,buildSchemaSnapshot as ur,evaluateSchemaDrift as vr,parseSchemaSnapshot as Nr}from"./packem_shared/SchemaSnapshotParseError-lUWe6lPo.mjs";import{schemaFromIr as Cr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Rr,validatorIrToJsonSchema as Mr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as _r,SDK_TARGETS as hr,generateSdk as Lr}from"./packem_shared/SDK_LANGUAGES-CFyux-74.mjs";import{redact as Ir,secretKindOf as Pr}from"./packem_shared/redact-Cy14LEnc.mjs";import{MESSAGE_SOLUTIONS as Gr,findSolutionByMessage as Ur}from"@lunora/errors";import{isTypedSchema as Hr}from"./packem_shared/isTypedSchema-B_qlBbE-.mjs";const e="0.0.0";export{u as AGENTS_FILENAME,M as CONTAINERS_FILENAME,x as CodegenDiagnosticError,rr as DEFAULT_TARGET,F as FLAGS_FILENAME,Me as GENERATED_HEADER,Rr as LUNORA_ERROR_CODES,Gr as LUNORA_SOLUTION_RULES,Q as MUTATORS_FILENAME,Y as NOTIFY_FILENAME,Ye as OPENRPC_VERSION,ir as PROJECT_CONFIG_FILENAMES,se as QUEUES_FILENAME,cr as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,_r as SDK_LANGUAGES,hr as SDK_TARGETS,Ae as SHAPES_FILENAME,Ar as SchemaSnapshotParseError,e as VERSION,Ce as WORKFLOWS_FILENAME,we as buildOpenApiDocument,Xe as buildOpenRpcDocument,ur as buildSchemaSnapshot,nr as createCodegenProject,c as describeErrorLevelFindings,E as diagnosticAt,s as diffSchemaSnapshots,v as discoverAgents,O as discoverAuthApiCalls,T as discoverContainers,h as discoverCrons,I as discoverFlags,D as discoverFunctions,U as discoverHttpRoutes,H as discoverHyperdriveCalls,y as discoverInserts,W as discoverMaskProcedures,V as discoverMigrations,w as discoverMutators,q as discoverNondeterministicCalls,X as discoverNotifyCalls,Z as discoverNotifyConfig,oe as discoverQueries,ae as discoverQueues,me as discoverR2sqlCalls,ce as discoverRlsMetadata,fe as discoverRlsProcedures,le as discoverSandboxUsage,xe as discoverSchema,ue as discoverShapes,Ne as discoverStorageRulesMetadata,Oe as discoverWorkflows,Te as emitAgents,_e as emitApi,We as emitApp,he as emitCollections,Le as emitContainers,Fe as emitCrons,Ie as emitDataModel,Pe as emitDrizzleSchema,De as emitFunctions,Je as emitOpenApi,qe as emitOpenApiModule,Ze as emitOpenRpc,$e as emitOpenRpcModule,Ge as emitScheduler,Ue as emitServer,be as emitShard,He as emitVectors,je as emitWorkflows,ye as emitWranglerCronTriggers,n as errorAdvisoryNames,l as errorPlatformDiagnosticNames,vr as evaluateSchemaDrift,Ur as findLunoraSolution,mr as findProjectConfigFile,lr as findTsconfig,m as formatAdvisories,Lr as generateSdk,Ve as isD1GlobalTable,ze as isHyperdriveGlobalTable,Hr as isTypedSchema,d as lintSchema,g as listLunoraSourceFiles,dr as loadProjectConfig,Nr as parseSchemaSnapshot,or as platformMatrixIds,ee as readPackageDependencies,fr as readProjectConfigLiterals,tr as readProjectTarget,Ir as redact,Sr as refreshCodegenProject,sr as resolveCodegenTarget,xr as runCodegen,Cr as schemaFromIr,Pr as secretKindOf,a as serializeSchemaSnapshot,f as toAdvisorContext,Mr as validatorIrToJsonSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{G as r,U as o,o as n,e as l,a as A,b as E,c as S,d as p,f as c,g as d,h as g,p as u,i as C,q as h,j as D,k as f,l as G,m as R,n as _}from"./emit-
|
|
1
|
+
import"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{G as r,U as o,o as n,e as l,a as A,b as E,c as S,d as p,f as c,g as d,h as g,p as u,i as C,q as h,j as D,k as f,l as G,m as R,n as _}from"./emit-CTDEkEXh.mjs";import"./isD1GlobalTable-udvHAAzD.mjs";import"./paths-C-9fwEgQ.mjs";import"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";export{r as GENERATED_HEADER,o as UMBRELLA_BASE_PACKAGES,n as buildStorageColumns,l as emitAgents,A as emitApi,E as emitCollections,S as emitContainers,p as emitCrons,c as emitDataModel,d as emitDrizzleSchema,g as emitFunctions,u as emitQueues,C as emitScheduler,h as emitSeed,D as emitServer,f as emitShard,G as emitVectors,R as emitWorkflows,_ as emitWranglerCronTriggers};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as m}from"node:fs";import{join as x}from"node:path";import{SyntaxKind as d,Node as c}from"ts-morph";import{listLunoraSourceFiles as l,lunoraRelativePath as g,defaultExportExpression as P,handlerOf as E}from"./listLunoraSourceFiles-D4xthUf-.mjs";import{c as S}from"./classify-procedure-call-
|
|
1
|
+
import{existsSync as m}from"node:fs";import{join as x}from"node:path";import{SyntaxKind as d,Node as c}from"ts-morph";import{listLunoraSourceFiles as l,lunoraRelativePath as g,defaultExportExpression as P,handlerOf as E}from"./listLunoraSourceFiles-D4xthUf-.mjs";import{c as S}from"./classify-procedure-call-BIlyTUBD.mjs";const y="notify.ts",v=new Set(["chat","inApp","send","webhook"]),p=new Set(["broadcast","send"]),N=e=>{const t=e.getInitializer();if(!t||!c.isCallExpression(t))return;const o=S(t);if(!o)return;const r=E(t,o.receiver);return r?{exportName:e.getName(),handler:r,kind:o.kind}:void 0},h=e=>{const t=[];for(const o of e.getVariableStatements())if(o.isExported())for(const r of o.getDeclarations()){const s=N(r);s&&t.push(s)}return t},a=e=>{if(!c.isPropertyAccessExpression(e))return;const t=e.getName(),o=e.getExpression();if((t==="notify"||t==="push")&&c.isIdentifier(o)&&o.getText()==="ctx")return t;if(t==="push"&&a(o)==="notify")return"push"},F=e=>{if(!c.isPropertyAccessExpression(e))return;const t=e.getName(),o=a(e.getExpression());if(o==="notify"&&v.has(t))return`ctx.notify.${t}`;if(o==="push"&&p.has(t))return`ctx.push.${t}`},A=e=>c.isPropertyAccessExpression(e)?a(e.getExpression())==="push"&&p.has(e.getName()):!1,T=(e,t)=>{const o=[];for(const r of l(t)){const s=e.getSourceFile(r)??e.addSourceFileAtPath(r),f=g(t,r);for(const n of h(s))if(!(n.kind!=="query"&&n.kind!=="mutation"))for(const i of n.handler.getDescendantsOfKind(d.PropertyAccessExpression)){const u=F(i);u!==void 0&&o.push({callee:u,exportName:n.exportName,file:f,kind:n.kind,line:i.getStartLineNumber()})}}return o},O=(e,t)=>{for(const o of l(t)){const r=e.getSourceFile(o)??e.addSourceFileAtPath(o);for(const s of h(r))for(const f of s.handler.getDescendantsOfKind(d.PropertyAccessExpression))if(A(f))return!0}return!1},_=(e,t)=>{const o=x(t,y);if(!m(o))return;const r=e.getSourceFile(o)??e.addSourceFileAtPath(o),s=P(r);let f=!1,n=!1;if(s&&c.isCallExpression(s)){const i=s.getArguments()[0];i&&c.isObjectLiteralExpression(i)&&(f=i.getProperty("webPush")!==void 0,n=i.getProperty("fcm")!==void 0)}return{hasFcm:n,hasWebPush:f,usesPush:O(e,t)}};export{y as NOTIFY_FILENAME,T as discoverNotifyCalls,_ as discoverNotifyConfig};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{G as c}from"./emit-
|
|
1
|
+
import{G as c}from"./emit-CTDEkEXh.mjs";import{s as u}from"./paths-C-9fwEgQ.mjs";import{validatorIrToJsonSchema as m,objectSchema as p,LUNORA_ERROR_CODES as i}from"./LUNORA_ERROR_CODES-C2s0xWQD.mjs";const l="1.3.2",d={description:"Result is TS-inferred from the function's return type (no `.output()` declared); best-effort — any JSON."},R=e=>{const n=u(e.filePath),o=`${n}:${e.exportName}`;return{description:`Invoke the \`${e.kind}\` \`${o}\` over the Lunora RPC envelope (POST /_lunora/rpc, body \`{ "functionPath": "${o}", "args": { … } }\`).`,errors:i.map((r,s)=>({code:-32e3-s,data:{code:r},message:r})),name:o,params:[{description:"The function's argument object (the RPC envelope's `args`).",name:"args",required:Object.keys(e.args).length>0,schema:p(e.args)}],result:{name:"result",schema:e.output?m(e.output):d},summary:`${e.kind}: ${o}`,"x-lunora-function-kind":e.kind,"x-tags":[{name:n}]}},g=e=>{const n=e.version??"0.0.0",r=e.functions.filter(t=>t.visibility!=="internal"&&t.kind!=="stream").map(t=>R(t)).toSorted((t,a)=>t.name.localeCompare(a.name));return{info:{description:"Auto-generated from @lunora/values-typed functions by @lunora/codegen. Do not edit — run `lunora codegen` to regenerate.",title:"Lunora RPC",version:n},methods:r,openrpc:l}},S=e=>`${JSON.stringify(g(e),void 0,2)}
|
|
2
2
|
`,v=e=>`${c}export const openRpcSpec: Record<string, unknown> = ${JSON.stringify(e,void 0,4)};
|
|
3
3
|
`;export{l as OPENRPC_VERSION,g as buildOpenRpcDocument,S as emitOpenRpc,v as emitOpenRpcModule};
|