@lunora/codegen 1.0.0-alpha.329 → 1.0.0-alpha.330
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 +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{MUTATORS_FILENAME-Jkk8Zgkb.mjs → MUTATORS_FILENAME-B_I0kkvJ.mjs} +1 -1
- package/dist/packem_shared/{NOTIFY_FILENAME-DiYZjYts.mjs → NOTIFY_FILENAME-DOIxn0Qb.mjs} +1 -1
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-DdPW4JCi.mjs +31 -0
- package/dist/packem_shared/{SHAPES_FILENAME-DkBUN9dK.mjs → SHAPES_FILENAME-D7Ifi5Ce.mjs} +1 -1
- package/dist/packem_shared/chain-ZlTHdRo2.mjs +1 -0
- package/dist/packem_shared/classify-procedure-call-Bw5sia-K.mjs +1 -0
- package/dist/packem_shared/{context-property-calls-eO5eiVZG.mjs → context-property-calls-Co_G3ENU.mjs} +1 -1
- package/dist/packem_shared/{context-root-D-pTjHtx.mjs → context-root-BTW5XwVq.mjs} +1 -1
- package/dist/packem_shared/{database-calls-DJgmh0Kv.mjs → database-calls-D-GwIhWO.mjs} +1 -1
- package/dist/packem_shared/{discoverCrons-DBnCama4.mjs → discoverCrons-B2SdRjRO.mjs} +1 -1
- package/dist/packem_shared/{discoverFunctions-CIJja4zp.mjs → discoverFunctions-C9Ra5XXH.mjs} +1 -1
- package/dist/packem_shared/discoverHyperdriveCalls-DfCAjBgd.mjs +1 -0
- package/dist/packem_shared/{discoverInserts-CednbRCq.mjs → discoverInserts-T5ojinqL.mjs} +1 -1
- package/dist/packem_shared/discoverMaskProcedures-DKd9fVDa.mjs +1 -0
- package/dist/packem_shared/{discoverMigrations-C9mLIhGZ.mjs → discoverMigrations-ClgjUkaG.mjs} +1 -1
- package/dist/packem_shared/{discoverNondeterministicCalls-B6FUSWes.mjs → discoverNondeterministicCalls-UCUCyCox.mjs} +1 -1
- package/dist/packem_shared/{discoverQueries-BezURxvr.mjs → discoverQueries-u2XNpxsn.mjs} +1 -1
- package/dist/packem_shared/discoverR2sqlCalls-jz5KouxF.mjs +1 -0
- package/dist/packem_shared/{discoverRlsMetadata-DCgP2H39.mjs → discoverRlsMetadata-D2G3YAoe.mjs} +1 -1
- package/dist/packem_shared/{discoverRlsProcedures-Os1lrVX_.mjs → discoverRlsProcedures-BD8aG1BU.mjs} +1 -1
- package/dist/packem_shared/{discoverStorageRulesMetadata-BTD9Vs5X.mjs → discoverStorageRulesMetadata-C2ceH0ZO.mjs} +1 -1
- package/dist/packem_shared/{emitShard-Ba8hJ_G8.mjs → emitShard-DtfjUgjj.mjs} +1 -1
- package/dist/packem_shared/{exported-procedure-chains-DOFtzPZn.mjs → exported-procedure-chains-CVzkVdq4.mjs} +1 -1
- package/dist/packem_shared/{index-iWQbulvu.mjs → index-BPUxZYM5.mjs} +1 -1
- package/dist/packem_shared/{module-specifiers-WF8iAydP.mjs → module-specifiers-BctA0m_p.mjs} +1 -1
- package/dist/packem_shared/{shard-BtImwCVL.mjs → shard-CsfiXxV0.mjs} +130 -105
- package/package.json +9 -9
- package/dist/packem_shared/SCHEMA_SNAPSHOT_FILENAME-GV-_yNKe.mjs +0 -11
- package/dist/packem_shared/chain-DYBhMcDK.mjs +0 -1
- package/dist/packem_shared/classify-procedure-call-DUBO9bqm.mjs +0 -1
- package/dist/packem_shared/discoverHyperdriveCalls-DVIQ0i_e.mjs +0 -1
- package/dist/packem_shared/discoverMaskProcedures-B4k9BS0s.mjs +0 -1
- package/dist/packem_shared/discoverR2sqlCalls-B9Q6xfi6.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -2452,6 +2452,26 @@ interface ProjectIR {
|
|
|
2452
2452
|
migrations: ReadonlyArray<MigrationIR>;
|
|
2453
2453
|
schema: SchemaIR;
|
|
2454
2454
|
}
|
|
2455
|
+
/**
|
|
2456
|
+
* A `defineLiveStream` export, read from its literals. Codegen needs only the names: the
|
|
2457
|
+
* payload and key TYPES come from inference over the declaration, so no validator is lowered.
|
|
2458
|
+
*/
|
|
2459
|
+
interface LiveStreamIR {
|
|
2460
|
+
/** The export name, which is also the key under `live` in `_generated/live.ts`. */
|
|
2461
|
+
exportName: string;
|
|
2462
|
+
/** The declaring file, lunora-relative without `.ts`. */
|
|
2463
|
+
filePath: string;
|
|
2464
|
+
/** The literal `id`, which names the stream's routes and scopes its subscriptions. */
|
|
2465
|
+
id: string;
|
|
2466
|
+
/** The declared topics in declaration order. */
|
|
2467
|
+
topics: ReadonlyArray<LiveTopicIR>;
|
|
2468
|
+
}
|
|
2469
|
+
/** One topic of a {@link LiveStreamIR}. */
|
|
2470
|
+
interface LiveTopicIR {
|
|
2471
|
+
/** The key fields in DECLARED order: the generated encoder lays segments out in this order, never the caller's. Empty for a keyless topic. */
|
|
2472
|
+
fields: ReadonlyArray<string>;
|
|
2473
|
+
name: string;
|
|
2474
|
+
}
|
|
2455
2475
|
/**
|
|
2456
2476
|
* Per-procedure RLS usage snapshot, produced by `discoverRlsProcedures` for the
|
|
2457
2477
|
* `rls_uncovered_table` advisor lint. Structurally identical to
|
|
@@ -3367,6 +3387,8 @@ interface CodegenResult {
|
|
|
3367
3387
|
functions: string;
|
|
3368
3388
|
/** `internal.*` references to the internal functions (`_generated/internal.ts`), kept out of `api.ts` so a client bundle never carries them. */
|
|
3369
3389
|
internal: string;
|
|
3390
|
+
/** Typed live-topic references (`_generated/live.ts`); `""` (and not written) when no live stream is declared. */
|
|
3391
|
+
live: string;
|
|
3370
3392
|
/** OpenAPI 3.1.0 document (`_generated/openapi.json`), pretty-printed JSON. */
|
|
3371
3393
|
openApi: string;
|
|
3372
3394
|
/**
|
|
@@ -4080,6 +4102,12 @@ interface EmitShardOptions {
|
|
|
4080
4102
|
* gate) — wires `ctx.live.publish` onto the action ctx, so an action running on
|
|
4081
4103
|
* this shard (a scheduled job) publishes to its own stream subscribers.
|
|
4082
4104
|
*/
|
|
4105
|
+
/**
|
|
4106
|
+
* The exported `defineLiveStream` declarations, read from their literals. The shard imports each stream and
|
|
4107
|
+
* checks every publish against it (`liveStreams()`), so a payload its topic's validator rejects is refused at
|
|
4108
|
+
* the one place all three publishers (HTTP, queue, action) arrive. Used only when `liveStreams` is set.
|
|
4109
|
+
*/
|
|
4110
|
+
liveStreamDeclarations?: ReadonlyArray<LiveStreamIR>;
|
|
4083
4111
|
liveStreams?: boolean;
|
|
4084
4112
|
maskMetadata?: MaskMetadataIR;
|
|
4085
4113
|
/** Custom mutators declared via `defineMutator` in `lunora/mutators.ts` — wires the `isCustomMutator` push-protocol override. */
|
|
@@ -4108,7 +4136,7 @@ interface EmitShardOptions {
|
|
|
4108
4136
|
useUmbrella?: boolean;
|
|
4109
4137
|
workflows?: ReadonlyArray<WorkflowIR>;
|
|
4110
4138
|
}
|
|
4111
|
-
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, hasSockets, lazyFunctions, hasVectors, liveStreams, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4139
|
+
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, hasSockets, lazyFunctions, hasVectors, liveStreamDeclarations, liveStreams, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4112
4140
|
/**
|
|
4113
4141
|
* Emit `_generated/containers.ts` — one container-enabled Durable Object class
|
|
4114
4142
|
* per `defineContainer` export, each a thin subclass of `LunoraContainer`
|
package/dist/index.d.ts
CHANGED
|
@@ -2452,6 +2452,26 @@ interface ProjectIR {
|
|
|
2452
2452
|
migrations: ReadonlyArray<MigrationIR>;
|
|
2453
2453
|
schema: SchemaIR;
|
|
2454
2454
|
}
|
|
2455
|
+
/**
|
|
2456
|
+
* A `defineLiveStream` export, read from its literals. Codegen needs only the names: the
|
|
2457
|
+
* payload and key TYPES come from inference over the declaration, so no validator is lowered.
|
|
2458
|
+
*/
|
|
2459
|
+
interface LiveStreamIR {
|
|
2460
|
+
/** The export name, which is also the key under `live` in `_generated/live.ts`. */
|
|
2461
|
+
exportName: string;
|
|
2462
|
+
/** The declaring file, lunora-relative without `.ts`. */
|
|
2463
|
+
filePath: string;
|
|
2464
|
+
/** The literal `id`, which names the stream's routes and scopes its subscriptions. */
|
|
2465
|
+
id: string;
|
|
2466
|
+
/** The declared topics in declaration order. */
|
|
2467
|
+
topics: ReadonlyArray<LiveTopicIR>;
|
|
2468
|
+
}
|
|
2469
|
+
/** One topic of a {@link LiveStreamIR}. */
|
|
2470
|
+
interface LiveTopicIR {
|
|
2471
|
+
/** The key fields in DECLARED order: the generated encoder lays segments out in this order, never the caller's. Empty for a keyless topic. */
|
|
2472
|
+
fields: ReadonlyArray<string>;
|
|
2473
|
+
name: string;
|
|
2474
|
+
}
|
|
2455
2475
|
/**
|
|
2456
2476
|
* Per-procedure RLS usage snapshot, produced by `discoverRlsProcedures` for the
|
|
2457
2477
|
* `rls_uncovered_table` advisor lint. Structurally identical to
|
|
@@ -3367,6 +3387,8 @@ interface CodegenResult {
|
|
|
3367
3387
|
functions: string;
|
|
3368
3388
|
/** `internal.*` references to the internal functions (`_generated/internal.ts`), kept out of `api.ts` so a client bundle never carries them. */
|
|
3369
3389
|
internal: string;
|
|
3390
|
+
/** Typed live-topic references (`_generated/live.ts`); `""` (and not written) when no live stream is declared. */
|
|
3391
|
+
live: string;
|
|
3370
3392
|
/** OpenAPI 3.1.0 document (`_generated/openapi.json`), pretty-printed JSON. */
|
|
3371
3393
|
openApi: string;
|
|
3372
3394
|
/**
|
|
@@ -4080,6 +4102,12 @@ interface EmitShardOptions {
|
|
|
4080
4102
|
* gate) — wires `ctx.live.publish` onto the action ctx, so an action running on
|
|
4081
4103
|
* this shard (a scheduled job) publishes to its own stream subscribers.
|
|
4082
4104
|
*/
|
|
4105
|
+
/**
|
|
4106
|
+
* The exported `defineLiveStream` declarations, read from their literals. The shard imports each stream and
|
|
4107
|
+
* checks every publish against it (`liveStreams()`), so a payload its topic's validator rejects is refused at
|
|
4108
|
+
* the one place all three publishers (HTTP, queue, action) arrive. Used only when `liveStreams` is set.
|
|
4109
|
+
*/
|
|
4110
|
+
liveStreamDeclarations?: ReadonlyArray<LiveStreamIR>;
|
|
4083
4111
|
liveStreams?: boolean;
|
|
4084
4112
|
maskMetadata?: MaskMetadataIR;
|
|
4085
4113
|
/** Custom mutators declared via `defineMutator` in `lunora/mutators.ts` — wires the `isCustomMutator` push-protocol override. */
|
|
@@ -4108,7 +4136,7 @@ interface EmitShardOptions {
|
|
|
4108
4136
|
useUmbrella?: boolean;
|
|
4109
4137
|
workflows?: ReadonlyArray<WorkflowIR>;
|
|
4110
4138
|
}
|
|
4111
|
-
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, hasSockets, lazyFunctions, hasVectors, liveStreams, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4139
|
+
declare const emitShard: ({ advisories, advisorProcedures, agents, capabilities, containers, env, flagKeys, hasFlags, hasNotify, hasRooms, hasSockets, lazyFunctions, hasVectors, liveStreamDeclarations, liveStreams, maskMetadata, mutators, queues, rlsMetadata, schema, schemaSnapshot, shapes, storageRules, studioFeatures, services, topics, useUmbrella, workflows }: EmitShardOptions) => string;
|
|
4112
4140
|
/**
|
|
4113
4141
|
* Emit `_generated/containers.ts` — one container-enabled Durable Object class
|
|
4114
4142
|
* 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 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-
|
|
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-B2SdRjRO.mjs";import{capabilitiesUsedBy as b,foldCapabilitySignals as y,mayReadCapabilityContext as U,sourceCapabilitySignals as G}from"./packem_shared/capabilitiesUsedBy-CF7sUwa8.mjs";import{FLAGS_FILENAME as j,discoverFlags as B}from"./packem_shared/FLAGS_FILENAME-Bf0MSlHH.mjs";import{default as W}from"./packem_shared/discoverFunctions-C9Ra5XXH.mjs";import{default as V}from"./packem_shared/discoverHttpRoutes-WBAqBcfK.mjs";import{default as Q}from"./packem_shared/discoverHyperdriveCalls-DfCAjBgd.mjs";import{default as w}from"./packem_shared/discoverInserts-T5ojinqL.mjs";import{d as Y}from"./packem_shared/index-BPUxZYM5.mjs";import{default as Z}from"./packem_shared/discoverMigrations-ClgjUkaG.mjs";import{MUTATORS_FILENAME as ee,discoverMutators as re}from"./packem_shared/MUTATORS_FILENAME-B_I0kkvJ.mjs";import{default as te}from"./packem_shared/discoverNondeterministicCalls-UCUCyCox.mjs";import{NOTIFY_FILENAME as ae,discoverNotifyCalls as ie,discoverNotifyChannels as me,discoverNotifyConfig as fe}from"./packem_shared/NOTIFY_FILENAME-DOIxn0Qb.mjs";import{default as de}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-u2XNpxsn.mjs";import{QUEUES_FILENAME as xe,discoverQueues as Se}from"./packem_shared/QUEUES_FILENAME-CsRy4VTF.mjs";import{default as ue}from"./packem_shared/discoverR2sqlCalls-jz5KouxF.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-BD8aG1BU.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-D2G3YAoe.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-D7Ifi5Ce.mjs";import{default as De}from"./packem_shared/discoverStorageRulesMetadata-C2ceH0ZO.mjs";import{WORKFLOWS_FILENAME as ye,discoverWorkflows as Ue}from"./packem_shared/WORKFLOWS_FILENAME-CdeS224T.mjs";import{emitApp as He}from"./packem_shared/emitApp-DuJW6LKD.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-BbWiB-rs.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-DdPW4JCi.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-CsfiXxV0.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-Cd0Tuw73.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};
|
package/dist/packem_shared/{MUTATORS_FILENAME-Jkk8Zgkb.mjs → MUTATORS_FILENAME-B_I0kkvJ.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as E}from"node:fs";import{join as y}from"node:path";import{Node as o,SyntaxKind as l}from"ts-morph";import{diagnosticAt as I}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{
|
|
1
|
+
import{existsSync as E}from"node:fs";import{join as y}from"node:path";import{Node as o,SyntaxKind as l}from"ts-morph";import{diagnosticAt as I}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{b as M}from"./module-specifiers-BctA0m_p.mjs";import{p as A}from"./parse-validator-IDBKIT7M.mjs";import{findObjectProperty as c,unwrapExpression as d,isConstDeclaration as P}from"./isTestPath-B81lOULB.mjs";import{j as b,i as D,f as g,d as O}from"./attribution-hVBriwzy.mjs";import{u as w}from"./unwrap-handler-return-CeaOifqX.mjs";const z="mutators.ts",x=M,h=r=>{const e=r.getSymbol();if(!e)return r.getText()==="defineMutator";for(const t of e.getDeclarations())if(o.isImportSpecifier(t))return x(t.getImportDeclaration().getModuleSpecifierValue())?t.getNameNode().getText()==="defineMutator":!1;return!1},C=r=>{const e=r.getSymbol();if(!e)return!1;for(const t of e.getDeclarations()){if(!o.isNamespaceImport(t))continue;const i=t.getFirstAncestorByKind(l.ImportDeclaration);return i!==void 0&&x(i.getModuleSpecifierValue())}return!1},N=r=>{if(o.isIdentifier(r))return h(r);if(o.isPropertyAccessExpression(r)){const e=r.getExpression();return r.getName()==="defineMutator"&&o.isIdentifier(e)&&C(e)}return!1},S=r=>{const e=r.getArguments()[0];return e&&o.isObjectLiteralExpression(e)?e:void 0},m=new WeakMap,p=r=>{let e=m.get(r.compilerNode);if(e===void 0){const t=r.getNameNode(),i=t?.getText();e=r.getSourceFile().getDescendantsOfKind(l.Identifier).filter(s=>s!==t&&s.getText()===i&&g(s)?.compilerNode===r.compilerNode).length===1&&O(r)===void 0,m.set(r.compilerNode,e)}return e},f=r=>{const e=o.isIdentifier(r)?g(r):void 0,t=o.isSourceFile(e?.getParent())||o.isSourceFile(e?.getParent()?.getParent()?.getParent());if(e===void 0||e.getSourceFile()!==r?.getSourceFile()||!t)return;if(o.isFunctionDeclaration(e))return e.hasBody()&&p(e)?e:void 0;const i=P(e)?d(e.getInitializer()):void 0;return(o.isArrowFunction(i)||o.isFunctionExpression(i))&&o.isVariableDeclaration(e)&&p(e)?i:void 0},G=r=>{const e=r.getInitializer();if(!o.isCallExpression(e)||!N(e.getExpression()))return;const t=c(S(e),"server");if(o.isMethodDeclaration(t))return t;if(o.isShorthandPropertyAssignment(t))return f(t.getNameNode());const i=o.isPropertyAssignment(t)?d(t.getInitializer()):void 0;return o.isArrowFunction(i)||o.isFunctionExpression(i)?i:f(i)},T=r=>{const e=c(r,"args");if(!e||!o.isPropertyAssignment(e))return{};const t=e.getInitializer();return t&&o.isObjectLiteralExpression(t)?A(t):{}},L=r=>{const e=c(r,"server");if(!e||!o.isPropertyAssignment(e))return"unknown";const t=e.getInitializer();return!t||!(o.isArrowFunction(t)||o.isFunctionExpression(t))?"unknown":w(t)},j=r=>{const e=c(r,"owner");if(!e||!o.isPropertyAssignment(e))return;const t=e.getInitializer();return t&&o.isStringLiteral(t)?t.getLiteralValue():void 0},R=r=>{const e=[];for(const t of r.getVariableDeclarations()){if(!t.isExported())continue;const i=t.getInitializer();if(i?.getKind()!==l.CallExpression)continue;const n=i,s=n.getExpression();if(!N(s))continue;const a=t.getNameNode();if(!o.isIdentifier(a))throw I(a,"defineMutator exports must be plain named exports (no destructuring)");const u=S(n);for(const v of b(t).filter(F=>D(F)))e.push({args:T(u),exportName:v,filePath:"mutators",line:n.getStartLineNumber(),owner:j(u),returnType:L(u)})}return e},J=(r,e)=>{const t=y(e,z);if(!E(t))return[];const i=r.getSourceFile(t)??r.addSourceFileAtPath(t),n=R(i);return n.sort((s,a)=>s.exportName.localeCompare(a.exportName)),n};export{z as MUTATORS_FILENAME,J as discoverMutators,N as isDefineMutatorCallee,S as mutatorLiteral,G as mutatorServerImplOf};
|
|
@@ -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-BTW5XwVq.mjs";import{c as C}from"./classify-procedure-call-Bw5sia-K.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};
|