@lunora/codegen 1.0.0-alpha.319 → 1.0.0-alpha.320
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 +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{NOTIFY_FILENAME-CjbDYC2a.mjs → NOTIFY_FILENAME-bAt7J3cs.mjs} +1 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-Bo67h-3B.mjs +11 -0
- package/dist/packem_shared/chain-Cm6BMT8g.mjs +1 -0
- package/dist/packem_shared/classify-procedure-call-DVxdUhZt.mjs +1 -0
- package/dist/packem_shared/{context-property-calls-Bw8u2Pz4.mjs → context-property-calls-Cn3upNgZ.mjs} +1 -1
- package/dist/packem_shared/{context-root-YkWLB6M2.mjs → context-root-BdxINX-T.mjs} +1 -1
- package/dist/packem_shared/{database-calls-BnVUlTx_.mjs → database-calls-BKozZUEW.mjs} +1 -1
- package/dist/packem_shared/discoverFunctions-CZgLhsMn.mjs +1 -0
- package/dist/packem_shared/discoverHyperdriveCalls-DV4IglLE.mjs +1 -0
- package/dist/packem_shared/{discoverInserts-DUbjhNzk.mjs → discoverInserts-BjxXCACZ.mjs} +1 -1
- package/dist/packem_shared/discoverMaskProcedures-DE-8CDen.mjs +1 -0
- package/dist/packem_shared/{discoverNondeterministicCalls-D7Ovq8ae.mjs → discoverNondeterministicCalls-DvhyKM-f.mjs} +1 -1
- package/dist/packem_shared/{discoverQueries-BNqjOBY_.mjs → discoverQueries-C8E7TeRT.mjs} +1 -1
- package/dist/packem_shared/discoverR2sqlCalls-DVcfMO6-.mjs +1 -0
- package/dist/packem_shared/{discoverRlsMetadata-CbdfaVep.mjs → discoverRlsMetadata-QRsWRQbM.mjs} +1 -1
- package/dist/packem_shared/{discoverRlsProcedures-BeLdV5RT.mjs → discoverRlsProcedures-Du7ITNTQ.mjs} +1 -1
- package/dist/packem_shared/{discoverStorageRulesMetadata-BBMy9JVZ.mjs → discoverStorageRulesMetadata-ClzKLdCV.mjs} +1 -1
- package/dist/packem_shared/{emitAgents-DuSp0uSJ.mjs → emitAgents-CR2_X_ov.mjs} +1 -1
- package/dist/packem_shared/emitFunctions-rjyb7h7k.mjs +422 -0
- package/dist/packem_shared/{emitShard-Ddgmq6De.mjs → emitShard-D3Po46nf.mjs} +1 -1
- package/dist/packem_shared/{exported-procedure-chains-DAl7xBBx.mjs → exported-procedure-chains-BNBUkXui.mjs} +1 -1
- package/dist/packem_shared/{index-DvmKcoFV.mjs → index-JnqBWRYO.mjs} +1 -1
- package/dist/packem_shared/{shard-DYYhXxEG.mjs → shard-CsOnD3Na.mjs} +226 -117
- package/dist/packem_shared/{shard-runtime-BQ6ZNigW.mjs → shard-runtime-BpoCV-aM.mjs} +13 -8
- package/package.json +1 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-DwqkR6hn.mjs +0 -11
- package/dist/packem_shared/chain-CubC5VoS.mjs +0 -1
- package/dist/packem_shared/classify-procedure-call-CcgP-9I0.mjs +0 -1
- package/dist/packem_shared/discoverFunctions-5Zy6K4uA.mjs +0 -1
- package/dist/packem_shared/discoverHyperdriveCalls-DFbp-ILH.mjs +0 -1
- package/dist/packem_shared/discoverMaskProcedures-BfVFPpAJ.mjs +0 -1
- package/dist/packem_shared/discoverR2sqlCalls-TNwsmYje.mjs +0 -1
- package/dist/packem_shared/emitFunctions-amc10WSc.mjs +0 -291
package/dist/index.d.mts
CHANGED
|
@@ -1387,6 +1387,7 @@ interface SchemaIR {
|
|
|
1387
1387
|
* `.expose({ cache: … })` object.
|
|
1388
1388
|
*/
|
|
1389
1389
|
interface ExposeCacheIR {
|
|
1390
|
+
credentialHeaders?: ReadonlyArray<string>;
|
|
1390
1391
|
maxAge?: number;
|
|
1391
1392
|
scope?: "private" | "public";
|
|
1392
1393
|
staleWhileRevalidate?: number;
|
|
@@ -1538,6 +1539,14 @@ interface FunctionIR {
|
|
|
1538
1539
|
* `internal` object and is rejected by the DO's external RPC path.
|
|
1539
1540
|
*/
|
|
1540
1541
|
visibility?: "internal" | "public";
|
|
1542
|
+
/**
|
|
1543
|
+
* Literal price from `.x402({ price })`. Lazy registry output needs this
|
|
1544
|
+
* before importing the procedure module so the origin can paywall every
|
|
1545
|
+
* transport synchronously; a missing price means the source was dynamic.
|
|
1546
|
+
*/
|
|
1547
|
+
x402?: {
|
|
1548
|
+
price?: number | string;
|
|
1549
|
+
};
|
|
1541
1550
|
}
|
|
1542
1551
|
/**
|
|
1543
1552
|
* A `defineShape({...})` declaration discovered in `lunora/shapes.ts`
|
|
@@ -3218,6 +3227,11 @@ interface CodegenOptions {
|
|
|
3218
3227
|
* `outputDirectory` is still the path that *would* have been written.
|
|
3219
3228
|
*/
|
|
3220
3229
|
dryRun?: boolean;
|
|
3230
|
+
/**
|
|
3231
|
+
* Emit a per-module lazy function registry when explicitly set to `true`.
|
|
3232
|
+
* Omitted or `false` keeps the eager registry.
|
|
3233
|
+
*/
|
|
3234
|
+
lazyFunctions?: boolean;
|
|
3221
3235
|
/**
|
|
3222
3236
|
* Run the static schema advisor (unindexed FKs, …) during codegen.
|
|
3223
3237
|
* Defaults to `true`. When `false`, `CodegenResult.advisories` is empty.
|
|
@@ -3335,6 +3349,8 @@ interface CodegenResult {
|
|
|
3335
3349
|
dataModel: string;
|
|
3336
3350
|
drizzleGlobal: string;
|
|
3337
3351
|
drizzleShard: string;
|
|
3352
|
+
/** Per-module `_generated/fn/*.ts` lazy import shims; empty when the eager registry is selected. */
|
|
3353
|
+
functionModules: Record<string, string>;
|
|
3338
3354
|
functions: string;
|
|
3339
3355
|
/** `internal.*` references to the internal functions (`_generated/internal.ts`), kept out of `api.ts` so a client bundle never carries them. */
|
|
3340
3356
|
internal: string;
|
|
@@ -3602,7 +3618,9 @@ declare const discoverFlags: (project: Project, lunoraDirectory: string) => Flag
|
|
|
3602
3618
|
* Scan all .ts files under `lunoraDir` (skipping `_generated/` and `schema.ts`)
|
|
3603
3619
|
* for top-level `export const x = query/mutation/action({...})` registrations.
|
|
3604
3620
|
*/
|
|
3605
|
-
declare const discoverFunctions: (project: Project, lunoraDirectory: string
|
|
3621
|
+
declare const discoverFunctions: (project: Project, lunoraDirectory: string, options?: {
|
|
3622
|
+
lazyFunctions?: boolean;
|
|
3623
|
+
}) => FunctionIR[];
|
|
3606
3624
|
/**
|
|
3607
3625
|
* Scan all `.ts` files under `lunoraDir` (skipping `_generated/` and `schema.ts`)
|
|
3608
3626
|
* for `export const x = httpRoute.<verb>(...)…handler(...)` typed REST routes.
|
|
@@ -3890,6 +3908,7 @@ declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
|
|
|
3890
3908
|
interface EmitFunctionsOptions {
|
|
3891
3909
|
agents?: ReadonlyArray<AgentIR>;
|
|
3892
3910
|
functions: ReadonlyArray<FunctionIR>;
|
|
3911
|
+
lazyFunctions?: boolean;
|
|
3893
3912
|
migrations?: ReadonlyArray<MigrationIR>;
|
|
3894
3913
|
mutators?: ReadonlyArray<MutatorIR>;
|
|
3895
3914
|
shapes?: ReadonlyArray<ShapeIR>;
|
|
@@ -4039,6 +4058,8 @@ interface EmitShardOptions {
|
|
|
4039
4058
|
* `emitApp` withhold from the type surface for the same verdict.
|
|
4040
4059
|
*/
|
|
4041
4060
|
hasVectors?: boolean;
|
|
4061
|
+
/** User function handlers are imported through generated per-module loaders. */
|
|
4062
|
+
lazyFunctions?: boolean;
|
|
4042
4063
|
maskMetadata?: MaskMetadataIR;
|
|
4043
4064
|
/** Custom mutators declared via `defineMutator` in `lunora/mutators.ts` — wires the `isCustomMutator` push-protocol override. */
|
|
4044
4065
|
mutators?: ReadonlyArray<MutatorIR>;
|
|
@@ -4066,7 +4087,7 @@ interface EmitShardOptions {
|
|
|
4066
4087
|
useUmbrella?: boolean;
|
|
4067
4088
|
workflows?: ReadonlyArray<WorkflowIR>;
|
|
4068
4089
|
}
|
|
4069
|
-
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, hasVectors, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4090
|
+
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, lazyFunctions, hasVectors, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4070
4091
|
/**
|
|
4071
4092
|
* Emit `_generated/containers.ts` — one container-enabled Durable Object class
|
|
4072
4093
|
* per `defineContainer` export, each a thin subclass of `LunoraContainer`
|
package/dist/index.d.ts
CHANGED
|
@@ -1387,6 +1387,7 @@ interface SchemaIR {
|
|
|
1387
1387
|
* `.expose({ cache: … })` object.
|
|
1388
1388
|
*/
|
|
1389
1389
|
interface ExposeCacheIR {
|
|
1390
|
+
credentialHeaders?: ReadonlyArray<string>;
|
|
1390
1391
|
maxAge?: number;
|
|
1391
1392
|
scope?: "private" | "public";
|
|
1392
1393
|
staleWhileRevalidate?: number;
|
|
@@ -1538,6 +1539,14 @@ interface FunctionIR {
|
|
|
1538
1539
|
* `internal` object and is rejected by the DO's external RPC path.
|
|
1539
1540
|
*/
|
|
1540
1541
|
visibility?: "internal" | "public";
|
|
1542
|
+
/**
|
|
1543
|
+
* Literal price from `.x402({ price })`. Lazy registry output needs this
|
|
1544
|
+
* before importing the procedure module so the origin can paywall every
|
|
1545
|
+
* transport synchronously; a missing price means the source was dynamic.
|
|
1546
|
+
*/
|
|
1547
|
+
x402?: {
|
|
1548
|
+
price?: number | string;
|
|
1549
|
+
};
|
|
1541
1550
|
}
|
|
1542
1551
|
/**
|
|
1543
1552
|
* A `defineShape({...})` declaration discovered in `lunora/shapes.ts`
|
|
@@ -3218,6 +3227,11 @@ interface CodegenOptions {
|
|
|
3218
3227
|
* `outputDirectory` is still the path that *would* have been written.
|
|
3219
3228
|
*/
|
|
3220
3229
|
dryRun?: boolean;
|
|
3230
|
+
/**
|
|
3231
|
+
* Emit a per-module lazy function registry when explicitly set to `true`.
|
|
3232
|
+
* Omitted or `false` keeps the eager registry.
|
|
3233
|
+
*/
|
|
3234
|
+
lazyFunctions?: boolean;
|
|
3221
3235
|
/**
|
|
3222
3236
|
* Run the static schema advisor (unindexed FKs, …) during codegen.
|
|
3223
3237
|
* Defaults to `true`. When `false`, `CodegenResult.advisories` is empty.
|
|
@@ -3335,6 +3349,8 @@ interface CodegenResult {
|
|
|
3335
3349
|
dataModel: string;
|
|
3336
3350
|
drizzleGlobal: string;
|
|
3337
3351
|
drizzleShard: string;
|
|
3352
|
+
/** Per-module `_generated/fn/*.ts` lazy import shims; empty when the eager registry is selected. */
|
|
3353
|
+
functionModules: Record<string, string>;
|
|
3338
3354
|
functions: string;
|
|
3339
3355
|
/** `internal.*` references to the internal functions (`_generated/internal.ts`), kept out of `api.ts` so a client bundle never carries them. */
|
|
3340
3356
|
internal: string;
|
|
@@ -3602,7 +3618,9 @@ declare const discoverFlags: (project: Project, lunoraDirectory: string) => Flag
|
|
|
3602
3618
|
* Scan all .ts files under `lunoraDir` (skipping `_generated/` and `schema.ts`)
|
|
3603
3619
|
* for top-level `export const x = query/mutation/action({...})` registrations.
|
|
3604
3620
|
*/
|
|
3605
|
-
declare const discoverFunctions: (project: Project, lunoraDirectory: string
|
|
3621
|
+
declare const discoverFunctions: (project: Project, lunoraDirectory: string, options?: {
|
|
3622
|
+
lazyFunctions?: boolean;
|
|
3623
|
+
}) => FunctionIR[];
|
|
3606
3624
|
/**
|
|
3607
3625
|
* Scan all `.ts` files under `lunoraDir` (skipping `_generated/` and `schema.ts`)
|
|
3608
3626
|
* for `export const x = httpRoute.<verb>(...)…handler(...)` typed REST routes.
|
|
@@ -3890,6 +3908,7 @@ declare const emitDrizzleSchema: (schema: SchemaIR, useUmbrella?: boolean) => {
|
|
|
3890
3908
|
interface EmitFunctionsOptions {
|
|
3891
3909
|
agents?: ReadonlyArray<AgentIR>;
|
|
3892
3910
|
functions: ReadonlyArray<FunctionIR>;
|
|
3911
|
+
lazyFunctions?: boolean;
|
|
3893
3912
|
migrations?: ReadonlyArray<MigrationIR>;
|
|
3894
3913
|
mutators?: ReadonlyArray<MutatorIR>;
|
|
3895
3914
|
shapes?: ReadonlyArray<ShapeIR>;
|
|
@@ -4039,6 +4058,8 @@ interface EmitShardOptions {
|
|
|
4039
4058
|
* `emitApp` withhold from the type surface for the same verdict.
|
|
4040
4059
|
*/
|
|
4041
4060
|
hasVectors?: boolean;
|
|
4061
|
+
/** User function handlers are imported through generated per-module loaders. */
|
|
4062
|
+
lazyFunctions?: boolean;
|
|
4042
4063
|
maskMetadata?: MaskMetadataIR;
|
|
4043
4064
|
/** Custom mutators declared via `defineMutator` in `lunora/mutators.ts` — wires the `isCustomMutator` push-protocol override. */
|
|
4044
4065
|
mutators?: ReadonlyArray<MutatorIR>;
|
|
@@ -4066,7 +4087,7 @@ interface EmitShardOptions {
|
|
|
4066
4087
|
useUmbrella?: boolean;
|
|
4067
4088
|
workflows?: ReadonlyArray<WorkflowIR>;
|
|
4068
4089
|
}
|
|
4069
|
-
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, hasVectors, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4090
|
+
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, lazyFunctions, hasVectors, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4070
4091
|
/**
|
|
4071
4092
|
* Emit `_generated/containers.ts` — one container-enabled Durable Object class
|
|
4072
4093
|
* per `defineContainer` export, each a thin subclass of `LunoraContainer`
|
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 f,toAdvisorContext as
|
|
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 f,toAdvisorContext as p}from"./packem_shared/formatAdvisories-BCVASH7N.mjs";import{describeErrorLevelFindings as n,errorAdvisoryNames as l,errorPlatformDiagnosticNames as c,sortedUniqueNames as x}from"./packem_shared/describeErrorLevelFindings-vzaGS9KL.mjs";import{CAPABILITY_PROBES as E}from"./packem_shared/CAPABILITY_PROBES-brcmKenl.mjs";import{CodegenDiagnosticError as A,diagnosticAt as v}from"./packem_shared/CodegenDiagnosticError-BUXlG3P-.mjs";import{AGENTS_FILENAME as N,discoverAgents as g}from"./packem_shared/AGENTS_FILENAME-B6-kjzM3.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-B81lOULB.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-xs0ONfI-.mjs";import{CONTAINERS_FILENAME as L,discoverContainers as M}from"./packem_shared/CONTAINERS_FILENAME-dFRtAyIe.mjs";import{default as P}from"./packem_shared/discoverCrons-DBnCama4.mjs";import{capabilitiesUsedBy as b,foldCapabilitySignals as y,mayReadCapabilityContext as U,sourceCapabilitySignals as G}from"./packem_shared/capabilitiesUsedBy-QgSZyE0T.mjs";import{FLAGS_FILENAME as j,discoverFlags as B}from"./packem_shared/FLAGS_FILENAME-Bf0MSlHH.mjs";import{default as W}from"./packem_shared/discoverFunctions-CZgLhsMn.mjs";import{default as V}from"./packem_shared/discoverHttpRoutes-WBAqBcfK.mjs";import{default as Q}from"./packem_shared/discoverHyperdriveCalls-DV4IglLE.mjs";import{default as w}from"./packem_shared/discoverInserts-BjxXCACZ.mjs";import{d as Y}from"./packem_shared/index-JnqBWRYO.mjs";import{default as Z}from"./packem_shared/discoverMigrations-C9mLIhGZ.mjs";import{MUTATORS_FILENAME as ee,discoverMutators as re}from"./packem_shared/MUTATORS_FILENAME-Jkk8Zgkb.mjs";import{default as te}from"./packem_shared/discoverNondeterministicCalls-DvhyKM-f.mjs";import{NOTIFY_FILENAME as ae,discoverNotifyCalls as ie,discoverNotifyChannels as me,discoverNotifyConfig as fe}from"./packem_shared/NOTIFY_FILENAME-bAt7J3cs.mjs";import{default as de}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-C8E7TeRT.mjs";import{QUEUES_FILENAME as xe,discoverQueues as Se}from"./packem_shared/QUEUES_FILENAME-CsRy4VTF.mjs";import{default as ue}from"./packem_shared/discoverR2sqlCalls-DVcfMO6-.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-Du7ITNTQ.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-QRsWRQbM.mjs";import{discoverSandboxUsage as Oe}from"./packem_shared/discoverSandboxUsage-w6Q3RvxZ.mjs";import{default as Te}from"./packem_shared/discoverSchema-BtsX-CN9.mjs";import{readServiceBindings as Ie,resolveServiceBindings as _e}from"./packem_shared/readServiceBindings-DvqIThzd.mjs";import{SHAPES_FILENAME as Me,discoverShapes as Fe}from"./packem_shared/SHAPES_FILENAME-DkBUN9dK.mjs";import{default as De}from"./packem_shared/discoverStorageRulesMetadata-ClzKLdCV.mjs";import{WORKFLOWS_FILENAME as ye,discoverWorkflows as Ue}from"./packem_shared/WORKFLOWS_FILENAME-CdeS224T.mjs";import{emitApp as He}from"./packem_shared/emitApp-BEe4wd3R.mjs";import{isD1GlobalTable as Be,isHyperdriveGlobalTable as ke}from"./packem_shared/isD1GlobalTable-udvHAAzD.mjs";import{buildOpenApiDocument as Ke,emitOpenApi as Ve,emitOpenApiModule as ze}from"./packem_shared/buildOpenApiDocument-DFv-RYZU.mjs";import{OPENRPC_VERSION as qe,buildOpenRpcDocument as we,emitOpenRpc as Je,emitOpenRpcModule as Ye}from"./packem_shared/OPENRPC_VERSION-CCY7xqSL.mjs";import{DEFAULT_TARGET as Ze,platformMatrixIds as $e,readProjectTarget as er,resolveCodegenTarget as rr}from"./packem_shared/DEFAULT_TARGET-B0FkdiZq.mjs";import{l as tr,r as sr}from"./packem_shared/project-config-file-BV7RR-l6.mjs";import{SCHEMA_SNAPSHOT_FILENAME as ir,runCodegen as mr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-Bo67h-3B.mjs";import{SchemaSnapshotParseError as pr,buildSchemaSnapshot as dr,evaluateSchemaDrift as nr,parseSchemaSnapshot as lr}from"./packem_shared/SchemaSnapshotParseError-BRJT7c2k.mjs";import{default as xr}from"./packem_shared/fingerprintSchemaSources-eVG9aVt0.mjs";import{schemaFromIr as Er}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Ar,validatorIrToJsonSchema as vr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as Nr,SDK_TARGETS as gr,generateSdk as Or}from"./sdk/index.mjs";import{redact as Tr,secretKindOf as hr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as _r}from"./packem_shared/emitDrizzleSchema-DitcRZ1a.mjs";import{e as Mr}from"./packem_shared/server-DAvi_bv_.mjs";import{e as Pr}from"./packem_shared/shard-CsOnD3Na.mjs";import{G as br}from"./packem_shared/shared-DnCokNcE.mjs";import{MESSAGE_SOLUTIONS as Ur,findSolutionByMessage as Gr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as jr,findProjectConfigFile as Br}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{createCodegenProject as Wr,findTsconfig as Kr,refreshCodegenProject as Vr}from"./packem_shared/createCodegenProject-V51_yBw3.mjs";import{s as Qr,t as qr,u as wr}from"./packem_shared/shard-runtime-BpoCV-aM.mjs";import{emitApi as Yr,emitCollections as Xr,emitInternalApi as Zr}from"./packem_shared/emitApi-CDgIPAG2.mjs";import{emitCrons as eo,emitScheduler as ro,emitVectors as oo,emitWranglerCronTriggers as to}from"./packem_shared/emitCrons-BQW2lviZ.mjs";import{emitDataModel as ao}from"./packem_shared/emitDataModel-BskFt9Wv.mjs";import{emitFunctions as mo}from"./packem_shared/emitFunctions-rjyb7h7k.mjs";import{isTypedSchema as po}from"./packem_shared/isTypedSchema-CKzc3ioR.mjs";const e="0.0.0";export{N as AGENTS_FILENAME,E as CAPABILITY_PROBES,L as CONTAINERS_FILENAME,A as CodegenDiagnosticError,Ze as DEFAULT_TARGET,j as FLAGS_FILENAME,br as GENERATED_HEADER,Ar as LUNORA_ERROR_CODES,Ur as LUNORA_SOLUTION_RULES,ee as MUTATORS_FILENAME,ae as NOTIFY_FILENAME,qe as OPENRPC_VERSION,jr as PROJECT_CONFIG_FILENAMES,xe as QUEUES_FILENAME,ir as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Nr as SDK_LANGUAGES,gr as SDK_TARGETS,Me as SHAPES_FILENAME,pr as SchemaSnapshotParseError,e as VERSION,ye as WORKFLOWS_FILENAME,Ke as buildOpenApiDocument,we as buildOpenRpcDocument,dr as buildSchemaSnapshot,b as capabilitiesUsedBy,Wr as createCodegenProject,n as describeErrorLevelFindings,v as diagnosticAt,s as diffSchemaSnapshots,g as discoverAgents,I as discoverAuthApiCalls,M as discoverContainers,P as discoverCrons,B as discoverFlags,W as discoverFunctions,V as discoverHttpRoutes,Q as discoverHyperdriveCalls,w as discoverInserts,Y as discoverMaskProcedures,Z as discoverMigrations,re as discoverMutators,te as discoverNondeterministicCalls,ie as discoverNotifyCalls,me as discoverNotifyChannels,fe as discoverNotifyConfig,le as discoverQueries,Se as discoverQueues,ue as discoverR2sqlCalls,Ne as discoverRlsMetadata,ve as discoverRlsProcedures,Oe as discoverSandboxUsage,Te as discoverSchema,Fe as discoverShapes,De as discoverStorageRulesMetadata,Ue as discoverWorkflows,Qr as emitAgents,Yr as emitApi,He as emitApp,Xr as emitCollections,qr as emitContainers,eo as emitCrons,ao as emitDataModel,_r as emitDrizzleSchema,mo as emitFunctions,Zr as emitInternalApi,Ve as emitOpenApi,ze as emitOpenApiModule,Je as emitOpenRpc,Ye as emitOpenRpcModule,ro as emitScheduler,Mr as emitServer,Pr as emitShard,oo as emitVectors,wr as emitWorkflows,to as emitWranglerCronTriggers,l as errorAdvisoryNames,c as errorPlatformDiagnosticNames,nr as evaluateSchemaDrift,Gr as findLunoraSolution,Br as findProjectConfigFile,Kr as findTsconfig,xr as fingerprintSchemaSources,y as foldCapabilitySignals,m as formatAdvisories,Or as generateSdk,Be as isD1GlobalTable,ke as isHyperdriveGlobalTable,R as isTestPath,po as isTypedSchema,f as lintSchema,T as listLunoraSourceFiles,tr as loadProjectConfig,U as mayReadCapabilityContext,lr as parseSchemaSnapshot,$e as platformMatrixIds,de as readPackageDependencies,sr as readProjectConfigLiterals,er as readProjectTarget,Ie as readServiceBindings,Tr as redact,Vr as refreshCodegenProject,rr as resolveCodegenTarget,_e as resolveServiceBindings,mr as runCodegen,Er as schemaFromIr,hr as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,G as sourceCapabilitySignals,p as toAdvisorContext,vr as validatorIrToJsonSchema};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as v}from"node:fs";import{join as N}from"node:path";import{SyntaxKind as u,Node as r,VariableDeclarationKind as F}from"ts-morph";import{listLunoraSourceFiles as m,lunoraRelativePath as O,findObjectProperty as g,defaultExportExpression as D,handlerOf as A}from"./isTestPath-B81lOULB.mjs";import{b as I,d as T}from"./attribution-hVBriwzy.mjs";import{i as l}from"./context-root-
|
|
1
|
+
import{existsSync as v}from"node:fs";import{join as N}from"node:path";import{SyntaxKind as u,Node as r,VariableDeclarationKind as F}from"ts-morph";import{listLunoraSourceFiles as m,lunoraRelativePath as O,findObjectProperty as g,defaultExportExpression as D,handlerOf as A}from"./isTestPath-B81lOULB.mjs";import{b as I,d as T}from"./attribution-hVBriwzy.mjs";import{i as l}from"./context-root-BdxINX-T.mjs";import{c as C}from"./classify-procedure-call-DVxdUhZt.mjs";const k="notify.ts",L=new Set(["chat","inApp","send","webhook"]),h=new Set(["broadcast","send"]),M=e=>{const s=e.getInitializer();if(!s||!r.isCallExpression(s))return;const t=C(s);if(!t)return;const i=A(s,t.receiver);return i?{exportName:T(e)??e.getName(),handler:i,kind:t.kind}:void 0},x=e=>{const s=[];for(const t of I(e)){const i=M(t);i&&s.push(i)}return s},y=e=>l(e,["notify"])?"notify":l(e,["push"])||l(e,["notify","push"])?"push":void 0,w=e=>{if(!r.isPropertyAccessExpression(e))return;const s=e.getName(),t=y(e.getExpression());if(t==="notify"&&L.has(s))return`ctx.notify.${s}`;if(t==="push"&&h.has(s))return`ctx.push.${s}`},_=e=>r.isPropertyAccessExpression(e)?y(e.getExpression())==="push"&&h.has(e.getName()):!1,Z=(e,s)=>{const t=[];for(const i of m(s)){const n=e.getSourceFile(i)??e.addSourceFileAtPath(i),o=O(s,i);for(const c of x(n))if(!(c.kind!=="query"&&c.kind!=="mutation"))for(const a of c.handler.getDescendantsOfKind(u.PropertyAccessExpression)){const f=w(a);f!==void 0&&t.push({callee:f,exportName:c.exportName,file:o,kind:c.kind,line:a.getStartLineNumber()})}}return t},K=(e,s)=>{for(const t of m(s)){const i=e.getSourceFile(t)??e.addSourceFileAtPath(t);for(const n of x(i))for(const o of n.handler.getDescendantsOfKind(u.PropertyAccessExpression))if(_(o))return!0}return!1},R=new Set(["@lunora/notify"]),U=e=>{const s=e.getSymbol();if(!s)return e.getText()==="defineNotify";for(const t of s.getDeclarations())if(r.isImportSpecifier(t))return R.has(t.getImportDeclaration().getModuleSpecifierValue())?t.getNameNode().getText()==="defineNotify":!1;return!1},E=(e,s=new Set)=>{const t=D(e);if(!t)return;if(!r.isIdentifier(t))return t;const i=t.getSymbol();if(!i?.isAlias())return t;const n=i.getAliasedSymbol();if(!n)return t;const o=n.getDeclarations().find(a=>r.isExportAssignment(a));if(!o)return t;const c=o.getSourceFile();if(!s.has(c.getFilePath()))return E(c,s.add(c.getFilePath()))},V=new Set(["%=","&&=","&=","**=","+=","-=","/=","<<=","=",">>=",">>>=","??=","^=","|=","||="]),p=e=>{const s=e.getSymbol();return s?.getAliasedSymbol()?.getDeclarations()[0]??s?.getDeclarations()[0]},P=e=>{if(r.isIdentifier(e))return e;if(r.isPropertyAccessExpression(e)||r.isElementAccessExpression(e))return P(e.getExpression())},d=(e,s)=>{const t=P(e);return t!==void 0&&p(t)===s},j=(e,s)=>{const t=e.getExpression();if(!r.isPropertyAccessExpression(t))return!1;const i=t.getName(),n=t.getExpression(),o=r.isIdentifier(n)?n.getText():"";if(!((i==="assign"||i==="defineProperty"||i==="defineProperties")&&o==="Object"||i==="set"&&o==="Reflect"))return!1;const a=e.getArguments()[0];return a!==void 0&&r.isIdentifier(a)&&p(a)===s},z=(e,s)=>{if(r.isBinaryExpression(e))return V.has(e.getOperatorToken().getText())&&d(e.getLeft(),s);if(r.isDeleteExpression(e))return d(e.getExpression(),s);if(r.isPrefixUnaryExpression(e)||r.isPostfixUnaryExpression(e)){const t=e.getOperatorToken();return(t===u.PlusPlusToken||t===u.MinusMinusToken)&&d(e.getOperand(),s)}return r.isCallExpression(e)?j(e,s):!1},H=(e,s)=>{const t=p(e);return t===void 0?!0:s.some(i=>i.getDescendants().some(n=>z(n,t)))},W=e=>{if(r.isObjectLiteralExpression(e))return e;if(!r.isIdentifier(e))return;const s=e.getSymbol(),t=s?.getAliasedSymbol()?.getDeclarations()??s?.getDeclarations()??[];for(const i of t){if(!r.isVariableDeclaration(i))continue;const n=i.getInitializer();if(!n||!r.isObjectLiteralExpression(n))continue;const o=i.getParent();if(!r.isVariableDeclarationList(o)||o.getDeclarationKind()!==F.Const)continue;const c=[i.getSourceFile(),e.getSourceFile()].filter((a,f,S)=>S.findIndex(b=>b.getFilePath()===a.getFilePath())===f);if(!H(e,c))return n}},Y=(e,s)=>{const t=N(s,k);if(!v(t))return;const i=e.getSourceFile(t)??e.addSourceFileAtPath(t),n=E(i);if(!n||!r.isCallExpression(n))return{hasFcm:!0,hasWebPush:!0};const o=n.getExpression(),c=r.isIdentifier(o)&&U(o)?n.getArguments()[0]:void 0,a=c===void 0?void 0:W(c);return!a||a.getProperties().some(f=>r.isSpreadAssignment(f))?{hasFcm:!0,hasWebPush:!0}:{hasFcm:g(a,"fcm")!==void 0,hasWebPush:g(a,"webPush")!==void 0}},ee=(e,s)=>{const t=Y(e,s);return t===void 0?void 0:{...t,usesPush:K(e,s)}};export{k as NOTIFY_FILENAME,Z as discoverNotifyCalls,Y as discoverNotifyChannels,ee as discoverNotifyConfig};
|