@lunora/codegen 1.0.0-alpha.276 → 1.0.0-alpha.278
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 +28 -9
- package/dist/index.d.ts +28 -9
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/NOTIFY_FILENAME-D7DAtpNJ.mjs +1 -0
- package/dist/packem_shared/{SCHEMA_SNAPSHOT_FILENAME-CaONLqHU.mjs → SCHEMA_SNAPSHOT_FILENAME-Ckd4suI-.mjs} +1 -1
- package/package.json +9 -9
- package/dist/packem_shared/NOTIFY_FILENAME-B42rW2NJ.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -3446,14 +3446,33 @@ declare const NOTIFY_FILENAME = "notify.ts";
|
|
|
3446
3446
|
* produced per send site.
|
|
3447
3447
|
*/
|
|
3448
3448
|
declare const discoverNotifyCalls: (project: Project, lunoraDirectory: string) => AdvisorNotifyCall[];
|
|
3449
|
-
/**
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
*
|
|
3456
|
-
*
|
|
3449
|
+
/** Which push channels `lunora/notify.ts` wires. */
|
|
3450
|
+
interface NotifyChannels {
|
|
3451
|
+
hasFcm: boolean;
|
|
3452
|
+
hasWebPush: boolean;
|
|
3453
|
+
}
|
|
3454
|
+
/**
|
|
3455
|
+
* Read which push channels the project's `lunora/notify.ts` default export
|
|
3456
|
+
* (`defineNotify({...})`) wires, or `undefined` when the file is absent (the app
|
|
3457
|
+
* declares no notify config). The read is metadata-only (like `discoverFlags`):
|
|
3458
|
+
* a `webPush`/`fcm` property's mere presence counts as the channel being wired.
|
|
3459
|
+
* The argument is read as the complete config only when the callee resolves to
|
|
3460
|
+
* `defineNotify` itself (`isDefineNotify`) — a wrapper factory could add a
|
|
3461
|
+
* channel before returning a valid definition, so its literal argument is not
|
|
3462
|
+
* trustworthy. A same-file `const` alias, a cross-file default re-export, and a
|
|
3463
|
+
* variable or imported config that resolves to an object literal
|
|
3464
|
+
* (`configLiteralOf`) are followed and read the same way; anything unreadable —
|
|
3465
|
+
* no `defineNotify(...)` default export, a non-`defineNotify` callee, a
|
|
3466
|
+
* computed/non-literal config, or a spread — reports BOTH channels, so their
|
|
3467
|
+
* secrets are scaffolded and preflighted rather than silently dropped (a
|
|
3468
|
+
* wrapper factory may add a channel its argument doesn't show). `@lunora/config`
|
|
3469
|
+
* reads this alone to scaffold only the configured channels' secrets.
|
|
3470
|
+
*/
|
|
3471
|
+
declare const discoverNotifyChannels: (project: Project, lunoraDirectory: string) => NotifyChannels | undefined;
|
|
3472
|
+
/**
|
|
3473
|
+
* The channels {@link discoverNotifyChannels} reads, plus whether any handler sends a push — the
|
|
3474
|
+
* `notify_missing_push_config` lint input. `undefined` when `lunora/notify.ts`
|
|
3475
|
+
* is absent.
|
|
3457
3476
|
*/
|
|
3458
3477
|
declare const discoverNotifyConfig: (project: Project, lunoraDirectory: string) => AdvisorNotifyConfig | undefined;
|
|
3459
3478
|
/**
|
|
@@ -4639,4 +4658,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
4639
4658
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
4640
4659
|
declare const redact: (value: string) => string;
|
|
4641
4660
|
declare const VERSION = "0.0.0";
|
|
4642
|
-
export { AGENTS_FILENAME, type AgentIR, type ArchitectureManifest, type AuthApiCallIR, CAPABILITY_PROBES, CONTAINERS_FILENAME, type CapabilityKey, type CapabilityProbe, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ServiceBindingIR, type ServiceLiteral, type ShapeIR, type SourceCapabilitySignals, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, type TopicIR, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, capabilitiesUsedBy, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitInternalApi, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, foldCapabilitySignals, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTestPath, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, mayReadCapabilityContext, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, readServiceBindings, redact, refreshCodegenProject, resolveCodegenTarget, resolveServiceBindings, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, sourceCapabilitySignals, toAdvisorContext, validatorIrToJsonSchema };
|
|
4661
|
+
export { AGENTS_FILENAME, type AgentIR, type ArchitectureManifest, type AuthApiCallIR, CAPABILITY_PROBES, CONTAINERS_FILENAME, type CapabilityKey, type CapabilityProbe, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, type NotifyChannels, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ServiceBindingIR, type ServiceLiteral, type ShapeIR, type SourceCapabilitySignals, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, type TopicIR, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, capabilitiesUsedBy, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyChannels, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitInternalApi, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, foldCapabilitySignals, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTestPath, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, mayReadCapabilityContext, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, readServiceBindings, redact, refreshCodegenProject, resolveCodegenTarget, resolveServiceBindings, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, sourceCapabilitySignals, toAdvisorContext, validatorIrToJsonSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -3446,14 +3446,33 @@ declare const NOTIFY_FILENAME = "notify.ts";
|
|
|
3446
3446
|
* produced per send site.
|
|
3447
3447
|
*/
|
|
3448
3448
|
declare const discoverNotifyCalls: (project: Project, lunoraDirectory: string) => AdvisorNotifyCall[];
|
|
3449
|
-
/**
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
*
|
|
3456
|
-
*
|
|
3449
|
+
/** Which push channels `lunora/notify.ts` wires. */
|
|
3450
|
+
interface NotifyChannels {
|
|
3451
|
+
hasFcm: boolean;
|
|
3452
|
+
hasWebPush: boolean;
|
|
3453
|
+
}
|
|
3454
|
+
/**
|
|
3455
|
+
* Read which push channels the project's `lunora/notify.ts` default export
|
|
3456
|
+
* (`defineNotify({...})`) wires, or `undefined` when the file is absent (the app
|
|
3457
|
+
* declares no notify config). The read is metadata-only (like `discoverFlags`):
|
|
3458
|
+
* a `webPush`/`fcm` property's mere presence counts as the channel being wired.
|
|
3459
|
+
* The argument is read as the complete config only when the callee resolves to
|
|
3460
|
+
* `defineNotify` itself (`isDefineNotify`) — a wrapper factory could add a
|
|
3461
|
+
* channel before returning a valid definition, so its literal argument is not
|
|
3462
|
+
* trustworthy. A same-file `const` alias, a cross-file default re-export, and a
|
|
3463
|
+
* variable or imported config that resolves to an object literal
|
|
3464
|
+
* (`configLiteralOf`) are followed and read the same way; anything unreadable —
|
|
3465
|
+
* no `defineNotify(...)` default export, a non-`defineNotify` callee, a
|
|
3466
|
+
* computed/non-literal config, or a spread — reports BOTH channels, so their
|
|
3467
|
+
* secrets are scaffolded and preflighted rather than silently dropped (a
|
|
3468
|
+
* wrapper factory may add a channel its argument doesn't show). `@lunora/config`
|
|
3469
|
+
* reads this alone to scaffold only the configured channels' secrets.
|
|
3470
|
+
*/
|
|
3471
|
+
declare const discoverNotifyChannels: (project: Project, lunoraDirectory: string) => NotifyChannels | undefined;
|
|
3472
|
+
/**
|
|
3473
|
+
* The channels {@link discoverNotifyChannels} reads, plus whether any handler sends a push — the
|
|
3474
|
+
* `notify_missing_push_config` lint input. `undefined` when `lunora/notify.ts`
|
|
3475
|
+
* is absent.
|
|
3457
3476
|
*/
|
|
3458
3477
|
declare const discoverNotifyConfig: (project: Project, lunoraDirectory: string) => AdvisorNotifyConfig | undefined;
|
|
3459
3478
|
/**
|
|
@@ -4639,4 +4658,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
4639
4658
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
4640
4659
|
declare const redact: (value: string) => string;
|
|
4641
4660
|
declare const VERSION = "0.0.0";
|
|
4642
|
-
export { AGENTS_FILENAME, type AgentIR, type ArchitectureManifest, type AuthApiCallIR, CAPABILITY_PROBES, CONTAINERS_FILENAME, type CapabilityKey, type CapabilityProbe, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ServiceBindingIR, type ServiceLiteral, type ShapeIR, type SourceCapabilitySignals, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, type TopicIR, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, capabilitiesUsedBy, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitInternalApi, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, foldCapabilitySignals, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTestPath, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, mayReadCapabilityContext, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, readServiceBindings, redact, refreshCodegenProject, resolveCodegenTarget, resolveServiceBindings, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, sourceCapabilitySignals, toAdvisorContext, validatorIrToJsonSchema };
|
|
4661
|
+
export { AGENTS_FILENAME, type AgentIR, type ArchitectureManifest, type AuthApiCallIR, CAPABILITY_PROBES, CONTAINERS_FILENAME, type CapabilityKey, type CapabilityProbe, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type ContainerImageIR, type ContainerNamedImageIR, type ContextPropertyCallIR, type CronJobIR, DEFAULT_TARGET, type DefaultScheduledContainerIR, type DriftChange, type DriftRemediation, type DriftScope, type DurableObjectScheduledContainerIR, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, type LoadedProjectConfig, type LunoraProjectConfig, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, NOTIFY_FILENAME, type NotifyChannels, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcDocument, type OpenRpcEmitInput, type OpenRpcMethod, PROJECT_CONFIG_FILENAMES, type PlatformDiagnostic, type ProjectConfigLiterals, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, type RuntimeVerb, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SDK_LANGUAGES, SDK_TARGETS, SHAPES_FILENAME, type SandboxUsage, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type SdkFiles, type SdkMethod, type SdkNamespace, type SdkRenderInput, type SdkResult, type SdkTarget, type ServiceBindingIR, type ServiceLiteral, type ShapeIR, type SourceCapabilitySignals, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, type TopicIR, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, capabilitiesUsedBy, createCodegenProject, describeErrorLevelFindings, diagnosticAt, diffSchemaSnapshots, discoverAgents, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverHyperdriveCalls, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverNotifyCalls, discoverNotifyChannels, discoverNotifyConfig, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSandboxUsage, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitAgents, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitInternalApi, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitScheduler, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, errorAdvisoryNames, errorPlatformDiagnosticNames, evaluateSchemaDrift, findProjectConfigFile, findTsconfig, fingerprintSchemaSources, foldCapabilitySignals, formatAdvisories, generateSdk, isD1GlobalTable, isHyperdriveGlobalTable, isTestPath, isTypedSchema, lintSchema, listLunoraSourceFiles, loadProjectConfig, mayReadCapabilityContext, parseSchemaSnapshot, platformMatrixIds, readPackageDependencies, readProjectConfigLiterals, readProjectTarget, readServiceBindings, redact, refreshCodegenProject, resolveCodegenTarget, resolveServiceBindings, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, sortedUniqueNames, sourceCapabilitySignals, toAdvisorContext, validatorIrToJsonSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SCHEMA_SNAPSHOT_VERSION as t,diffSchemaSnapshots 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 d}from"./packem_shared/formatAdvisories-DwmUKYuc.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-NQIB6wh3.mjs";import{isTestPath as R,listLunoraSourceFiles as T}from"./packem_shared/isTestPath-CgyyLk8U.mjs";import{default as I}from"./packem_shared/discoverAuthApiCalls-XK_WCMDG.mjs";import{CONTAINERS_FILENAME as L,discoverContainers as M}from"./packem_shared/CONTAINERS_FILENAME-CK3xJGwm.mjs";import{default as P}from"./packem_shared/discoverCrons-B5bVCaNF.mjs";import{capabilitiesUsedBy as b,foldCapabilitySignals as y,mayReadCapabilityContext as U,sourceCapabilitySignals as G}from"./packem_shared/capabilitiesUsedBy-FnnYmnSl.mjs";import{FLAGS_FILENAME as j,discoverFlags as B}from"./packem_shared/FLAGS_FILENAME-DYMd1xqw.mjs";import{default as W}from"./packem_shared/discoverFunctions-Be-XuuSW.mjs";import{default as V}from"./packem_shared/discoverHttpRoutes-CMOxt2Y9.mjs";import{default as Q}from"./packem_shared/discoverHyperdriveCalls-mrho5AnY.mjs";import{default as w}from"./packem_shared/discoverInserts-BhIpUWXN.mjs";import{d as Y}from"./packem_shared/index-CefI-Sba.mjs";import{default as Z}from"./packem_shared/discoverMigrations-dVVZtuJa.mjs";import{MUTATORS_FILENAME as ee,discoverMutators as re}from"./packem_shared/MUTATORS_FILENAME-BrEGrcPU.mjs";import{default as te}from"./packem_shared/discoverNondeterministicCalls-Dtb1aoGV.mjs";import{NOTIFY_FILENAME as ae,discoverNotifyCalls as ie,discoverNotifyChannels as me,discoverNotifyConfig as fe}from"./packem_shared/NOTIFY_FILENAME-D7DAtpNJ.mjs";import{default as pe}from"./packem_shared/readPackageDependencies-RHhGiz0k.mjs";import{default as le}from"./packem_shared/discoverQueries-BSOjEsk3.mjs";import{QUEUES_FILENAME as xe,discoverQueues as Se}from"./packem_shared/QUEUES_FILENAME-Dj5yK34Z.mjs";import{default as ue}from"./packem_shared/discoverR2sqlCalls-KONCqZr2.mjs";import{default as ve}from"./packem_shared/discoverRlsProcedures-c0DnIR4z.mjs";import{default as Ne}from"./packem_shared/discoverRlsMetadata-9YDlDDoh.mjs";import{discoverSandboxUsage as Oe}from"./packem_shared/discoverSandboxUsage-CfEU2hM-.mjs";import{default as Te}from"./packem_shared/discoverSchema-BTFFWy3i.mjs";import{readServiceBindings as Ie,resolveServiceBindings as _e}from"./packem_shared/readServiceBindings-DuE9xlvV.mjs";import{SHAPES_FILENAME as Me,discoverShapes as Fe}from"./packem_shared/SHAPES_FILENAME-CVc2VCnS.mjs";import{default as De}from"./packem_shared/discoverStorageRulesMetadata-f89BWody.mjs";import{WORKFLOWS_FILENAME as ye,discoverWorkflows as Ue}from"./packem_shared/WORKFLOWS_FILENAME-Ze98LsB3.mjs";import{emitApp as He}from"./packem_shared/emitApp-DUGS6Ve2.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-BjHdW7b2.mjs";import{OPENRPC_VERSION as qe,buildOpenRpcDocument as we,emitOpenRpc as Je,emitOpenRpcModule as Ye}from"./packem_shared/OPENRPC_VERSION-BaD2A2YR.mjs";import{DEFAULT_TARGET as Ze,platformMatrixIds as $e,readProjectTarget as er,resolveCodegenTarget as rr}from"./packem_shared/DEFAULT_TARGET-GPPgJNTn.mjs";import{l as tr,r as sr}from"./packem_shared/project-config-file-Bv2l-Kmm.mjs";import{SCHEMA_SNAPSHOT_FILENAME as ir,createCodegenProject as mr,findTsconfig as fr,refreshCodegenProject as dr,runCodegen as pr}from"./packem_shared/SCHEMA_SNAPSHOT_FILENAME-Ckd4suI-.mjs";import{SchemaSnapshotParseError as lr,buildSchemaSnapshot as cr,evaluateSchemaDrift as xr,parseSchemaSnapshot as Sr}from"./packem_shared/SchemaSnapshotParseError-CPOXlFhI.mjs";import{default as ur}from"./packem_shared/fingerprintSchemaSources-BJSIxwhY.mjs";import{schemaFromIr as vr}from"./packem_shared/schemaFromIr-BWFnvCVg.mjs";import{LUNORA_ERROR_CODES as Nr,validatorIrToJsonSchema as gr}from"./packem_shared/LUNORA_ERROR_CODES-C2s0xWQD.mjs";import{SDK_LANGUAGES as Rr,SDK_TARGETS as Tr,generateSdk as hr}from"./packem_shared/SDK_LANGUAGES-Df_CnJx5.mjs";import{redact as _r,secretKindOf as Lr}from"./packem_shared/redact-Cy14LEnc.mjs";import{default as Fr}from"./packem_shared/emitDrizzleSchema-DLtfKTI4.mjs";import{default as Dr}from"./packem_shared/emitFunctions-DkkcTDqh.mjs";import{e as yr}from"./packem_shared/server-BmY5wwKY.mjs";import{e as Gr}from"./packem_shared/shard-Dr5gMNyz.mjs";import{G as jr}from"./packem_shared/shared-Be3TGzxM.mjs";import{MESSAGE_SOLUTIONS as kr,findSolutionByMessage as Wr}from"@lunora/errors";import{PROJECT_CONFIG_FILENAMES as Vr,findProjectConfigFile as zr}from"./packem_shared/PROJECT_CONFIG_FILENAMES-DzOu-lSc.mjs";import{s as qr,t as wr,u as Jr}from"./packem_shared/shard-runtime-BI2SZ54Z.mjs";import{emitApi as Xr,emitCollections as Zr,emitInternalApi as $r}from"./packem_shared/emitApi-zY6egN77.mjs";import{emitCrons as ro,emitScheduler as oo,emitVectors as to,emitWranglerCronTriggers as so}from"./packem_shared/emitCrons-B8TBAOZ4.mjs";import{emitDataModel as io}from"./packem_shared/emitDataModel-B68T_eX6.mjs";import{isTypedSchema as fo}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,jr as GENERATED_HEADER,Nr as LUNORA_ERROR_CODES,kr as LUNORA_SOLUTION_RULES,ee as MUTATORS_FILENAME,ae as NOTIFY_FILENAME,qe as OPENRPC_VERSION,Vr as PROJECT_CONFIG_FILENAMES,xe as QUEUES_FILENAME,ir as SCHEMA_SNAPSHOT_FILENAME,t as SCHEMA_SNAPSHOT_VERSION,Rr as SDK_LANGUAGES,Tr as SDK_TARGETS,Me as SHAPES_FILENAME,lr as SchemaSnapshotParseError,e as VERSION,ye as WORKFLOWS_FILENAME,Ke as buildOpenApiDocument,we as buildOpenRpcDocument,cr as buildSchemaSnapshot,b as capabilitiesUsedBy,mr 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,Xr as emitApi,He as emitApp,Zr as emitCollections,wr as emitContainers,ro as emitCrons,io as emitDataModel,Fr as emitDrizzleSchema,Dr as emitFunctions,$r as emitInternalApi,Ve as emitOpenApi,ze as emitOpenApiModule,Je as emitOpenRpc,Ye as emitOpenRpcModule,oo as emitScheduler,yr as emitServer,Gr as emitShard,to as emitVectors,Jr as emitWorkflows,so as emitWranglerCronTriggers,l as errorAdvisoryNames,c as errorPlatformDiagnosticNames,xr as evaluateSchemaDrift,Wr as findLunoraSolution,zr as findProjectConfigFile,fr as findTsconfig,ur as fingerprintSchemaSources,y as foldCapabilitySignals,m as formatAdvisories,hr as generateSdk,Be as isD1GlobalTable,ke as isHyperdriveGlobalTable,R as isTestPath,fo as isTypedSchema,f as lintSchema,T as listLunoraSourceFiles,tr as loadProjectConfig,U as mayReadCapabilityContext,Sr as parseSchemaSnapshot,$e as platformMatrixIds,pe as readPackageDependencies,sr as readProjectConfigLiterals,er as readProjectTarget,Ie as readServiceBindings,_r as redact,dr as refreshCodegenProject,rr as resolveCodegenTarget,_e as resolveServiceBindings,pr as runCodegen,vr as schemaFromIr,Lr as secretKindOf,a as serializeSchemaSnapshot,x as sortedUniqueNames,G as sourceCapabilitySignals,d as toAdvisorContext,gr as validatorIrToJsonSchema};
|
|
@@ -0,0 +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-CgyyLk8U.mjs";import{b as I,d as T}from"./attribution-Dw35rOaJ.mjs";import{i as l}from"./context-root-B04bYCE-.mjs";import{c as C}from"./classify-procedure-call-DxuPQkJA.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as R,mkdirSync as Us,rmSync as lt,readdirSync as er,readFileSync as tr,writeFileSync as sr}from"node:fs";import{join as h,dirname as fe,relative as nr}from"node:path";import{performance as et}from"node:perf_hooks";import{runAdvisor as rr}from"@lunora/advisor";import{LunoraError as Y}from"@lunora/errors";import{readJsonSync as ir}from"@visulima/fs";import{SyntaxKind as d,Node as i,Project as ts}from"ts-morph";import{serializeSchemaSnapshot as or}from"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{toAdvisorContext as ar}from"./formatAdvisories-DwmUKYuc.mjs";import{r as cr,a as S,s as lr,b as dr}from"./project-config-file-Bv2l-Kmm.mjs";import{a as Ce,d as ur,r as fr}from"./modules-BIpFLz3Z.mjs";import{WORKFLOWS_FILENAME as pr,discoverWorkflows as gr}from"./WORKFLOWS_FILENAME-Ze98LsB3.mjs";import{r as mr}from"./json-data-Chfs2Cz5.mjs";import{n as hr,s as js}from"./paths-DwTjD7BU.mjs";import{G as vr}from"./shared-Be3TGzxM.mjs";import{CAPABILITIES as Er,usedCapabilities as xr}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{isD1GlobalTable as Vs,isHyperdriveGlobalTable as qs}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as Sr}from"./AGENTS_FILENAME-NQIB6wh3.mjs";import{discoverContainers as yr}from"./CONTAINERS_FILENAME-CK3xJGwm.mjs";import Ar from"./discoverCrons-B5bVCaNF.mjs";import{diagnosticAt as Ee}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{b as Be}from"./module-specifiers-WF8iAydP.mjs";import{a as Ws,b as q,d as $,f as F,g as At,c as v,w as bt,k as br,l as Nr,h as Pr,j as dt,i as wr}from"./attribution-Dw35rOaJ.mjs";import{contextPropertiesRead as Ir,discoverFeatureUsage as Cr}from"./capabilitiesUsedBy-FnnYmnSl.mjs";import Tr from"./readPackageDependencies-RHhGiz0k.mjs";import{listLunoraSourceFiles as x,unwrapExpression as E,listSecurityScanFiles as $e,objectLiteralFromCallbackBody as Hs,propertyInitializer as I,lunoraRelativePath as C,bindingKeyName as xe,collectCallRows as T,findObjectProperty as L,collectSecurityCallRows as Or,collectNodeRows as ut,RUN_METHODS as Gs,functionKeyOf as Ys,limitNameOf as Qs,optionsObjectLiteral as Xs,handlerOf as Rr,chainRootOf as Nt,outermostValueWrapper as P,isWriteTarget as Ue,isSameNode as me,isConstDeclaration as Z,returningFunctionOf as ft,walkChain as kr,memberAccessOf as Fr,functionReferenceSegments as Dr,isTestPath as Lr}from"./isTestPath-CgyyLk8U.mjs";import{discoverQueueDeclarations as Mr}from"./QUEUES_FILENAME-Dj5yK34Z.mjs";import{discoverSandboxUsage as _r}from"./discoverSandboxUsage-CfEU2hM-.mjs";import{resolveServiceBindings as Kr}from"./readServiceBindings-DuE9xlvV.mjs";import zr from"./discoverStorageRulesMetadata-f89BWody.mjs";import{a as y,c as W,d as Js,e as Br}from"./classify-procedure-call-DxuPQkJA.mjs";import{i as $r}from"./ir-DBSvhNa-.mjs";import{gatePlatformFeatures as Ur,resolveCodegenTarget as Zs,readTargetDiagnostics as jr,studioPlatformFor as Vr}from"./DEFAULT_TARGET-GPPgJNTn.mjs";import{b as en,e as qr}from"./shard-Dr5gMNyz.mjs";import{e as Wr,a as Hr}from"./server-BmY5wwKY.mjs";import{emitDataModel as Gr}from"./emitDataModel-B68T_eX6.mjs";import{a as ss,r as tt,i as j,b as Yr,m as tn,c as je,e as sn,E as nn,C as rn,d as Qr,f as Xr,g as Jr}from"./context-root-B04bYCE-.mjs";import{r as Ve,s as Zr}from"./parse-validator-DYdT7Hyf.mjs";import ei from"./discoverAuthApiCalls-XK_WCMDG.mjs";import{i as ti,a as si,e as ni,b as ri,d as ii,c as oi}from"./unwrap-handler-return-T5sJhEss.mjs";import ai from"./discoverFunctions-Be-XuuSW.mjs";import ci from"./discoverHttpRoutes-CMOxt2Y9.mjs";import li from"./discoverHyperdriveCalls-mrho5AnY.mjs";import di from"./discoverInserts-BhIpUWXN.mjs";import{m as Pt,a as Fe,s as on,d as ui}from"./index-CefI-Sba.mjs";import{e as an}from"./exported-procedure-chains-C5VKkd9T.mjs";import fi from"./discoverMigrations-dVVZtuJa.mjs";import{i as B,r as cn}from"./database-calls-DWDtdDbS.mjs";import{MUTATORS_FILENAME as pi,isDefineMutatorCallee as gi,mutatorServerImplOf as mi,discoverMutators as hi}from"./MUTATORS_FILENAME-BrEGrcPU.mjs";import vi from"./discoverNondeterministicCalls-Dtb1aoGV.mjs";import{discoverNotifyConfig as Ei,discoverNotifyCalls as xi}from"./NOTIFY_FILENAME-B42rW2NJ.mjs";import Si from"./discoverQueries-BSOjEsk3.mjs";import yi from"./discoverR2sqlCalls-KONCqZr2.mjs";import Ai from"./discoverRlsProcedures-c0DnIR4z.mjs";import bi from"./discoverRlsMetadata-9YDlDDoh.mjs";import Ni from"./discoverSchema-BTFFWy3i.mjs";import{secretKindOf as Pi,redact as wi,isHeuristicSecretKind as Ii,isSecretishName as Ci}from"./redact-Cy14LEnc.mjs";import{discoverShapes as Ti}from"./SHAPES_FILENAME-CVc2VCnS.mjs";import{i as Oi}from"./reserved-words-CW1QFbTd.mjs";import{emitApp as Ri}from"./emitApp-DUGS6Ve2.mjs";import{buildOpenApiDocument as ki,emitOpenApiModule as Fi}from"./buildOpenApiDocument-BjHdW7b2.mjs";import{buildOpenRpcDocument as Di,emitOpenRpcModule as Li}from"./OPENRPC_VERSION-BaD2A2YR.mjs";import{buildSchemaSnapshot as Mi}from"./SchemaSnapshotParseError-CPOXlFhI.mjs";import{emitCollections as _i,emitSeed as Ki,emitApi as zi,emitInternalApi as Bi}from"./emitApi-zY6egN77.mjs";import{t as $i,u as Ui,s as ji,v as Vi}from"./shard-runtime-BI2SZ54Z.mjs";import{emitCrons as qi,emitScheduler as Wi,emitShardRegistry as Hi,emitDurableObjects as Gi,emitVectors as Yi,emitWranglerCronTriggers as Qi}from"./emitCrons-B8TBAOZ4.mjs";import Xi from"./emitDrizzleSchema-DLtfKTI4.mjs";import Ji from"./emitFunctions-DkkcTDqh.mjs";const ns={error:"ERROR",info:"INFO",warn:"WARN"},rs={ERROR:2,INFO:0,WARN:1},Zi=e=>({cacheKey:"advisor_min_severity_invalid",categories:["SCHEMA"],description:"`advisor.minSeverity` in `lunora.config.*` sets the lowest advisory level codegen reports and writes into `_generated/shard.ts`. Codegen reads it by parsing the file, so it has to be a string literal.",detail:e,facing:"INTERNAL",level:"WARN",metadata:{},name:"advisor_min_severity_invalid",remediation:'Set `advisor: { minSeverity: "info" | "warn" | "error" }` as a literal on the config\'s default export.',title:"`advisor.minSeverity` is not a level codegen can read, so every advisory was reported"}),eo=(e,t)=>{const{advisor:s}=cr(e);if(s===void 0||s.minSeverity===void 0&&s.unreadable!==!0)return[...t];const{minSeverity:n}=s,r=n!==void 0&&Object.hasOwn(ns,n)?ns[n]:void 0;return r===void 0?[...t,Zi(n===void 0?"`advisor.minSeverity` is not a string literal codegen can read without evaluating the config: a computed value or key, or a spread that could set or override it.":`\`advisor.minSeverity\` is "${n}", which is not one of "info", "warn" or "error".`)]:t.filter(o=>rs[o.level]>=rs[r])},to={call:"function",enqueue:"queue",invoke:"service",publish:"topic",schedule:"function"},so="crons",no=pr.replace(/\.ts$/u,""),oe=(e,t)=>`${js(e)}:${t}`,st=(e,t,s)=>t===""?{reason:`the ${s} is not a string literal`}:{to:`${e}:${t}`},ro=e=>[...e.callEdges.map(t=>{const s=t.target===void 0?{reason:t.reason??"unreadable target"}:{to:`${to[t.kind]}:${t.target}`};return{file:t.file,kind:t.kind,line:t.line,scope:t.scope,...s}}),...e.queries.map(t=>({file:t.file,kind:"read",line:t.line,scope:t.scope,...st("table",t.table,"table name")})),...[...e.inserts,...e.tableWrites].map(t=>({file:t.file,kind:"write",line:t.line,scope:t.scope,...st("table",t.table,"written table")})),...e.workflowCalls.map(t=>({file:t.file,kind:"start",line:t.line,scope:t.scope,...st("workflow",t.workflow,"workflow name")}))],io=e=>e.untracked===!0?"inside a helper only code outside any export calls":"inside a non-exported helper",oo=e=>{const{scope:t}=e;switch(t.kind){case"export":return[{...e,exportName:t.name}];case"helper":return t.callers.length===0?[{...e,unattributed:io(t)}]:t.callers.map(s=>({...e,exportName:s}));default:return[{...e,unattributed:"at module scope"}]}},ao=e=>ro(e).flatMap(t=>oo(t)),co=e=>[...e.queues.flatMap(t=>t.topic===void 0?[]:[{file:t.filePath,from:`topic:${t.topic}`,kind:"subscribe",line:0,to:`queue:${t.exportName}`}]),...e.crons.map(t=>{const s=t.workflow===void 0?void 0:`workflow:${t.workflow.exportName}`,n=t.functionPath===void 0?void 0:`function:${t.functionPath}`,r=s??n;return{file:so,from:`cron:${t.name}`,kind:"trigger",line:0,...r===void 0?{reason:"the cron has no target"}:{to:r}}})],lo=e=>new Map(e.flatMap(t=>t.tables.map(s=>[s,t.name]))),ue=(e,t)=>t===void 0?e:{...e,module:t},uo=e=>{const t=new Map,s=new Map,n=lo(e.modules),r=(c,l)=>{s.set(c,[...s.get(c)??[],l])},o=(c,l)=>{t.set(c.id,c),l!==void 0&&r(l,c.id)},a=(c,l)=>{c!==void 0&&r(oe(c.file,c.exportName),l)};for(const c of e.functions){const l=oe(c.filePath,c.exportName),u=[...hr(c.filePath),c.exportName].join(".");o(ue({detail:c.kind,id:`function:${l}`,kind:"function",name:u},Ce(e.modules,c.filePath)),l)}for(const c of e.httpRoutes){const l=oe(c.filePath,c.exportName);o(ue({id:`http:${l}`,kind:"http",name:`${c.method} ${c.path}`},Ce(e.modules,c.filePath)),l)}for(const c of e.schema.tables)o(ue({id:`table:${c.name}`,kind:"table",name:c.name},n.get(c.name)));for(const c of e.queues){const l=c.topic===void 0?{}:{detail:"subscription"};o(ue({...l,id:`queue:${c.exportName}`,kind:"queue",name:c.exportName},Ce(e.modules,c.filePath)),oe(c.filePath,c.exportName)),a(c.handlerSite,`queue:${c.exportName}`)}for(const c of e.topics)o(ue({id:`topic:${c.exportName}`,kind:"topic",name:c.exportName},Ce(e.modules,c.filePath)));for(const c of e.workflows)o({id:`workflow:${c.exportName}`,kind:"workflow",name:c.exportName},oe(no,c.exportName)),a(c.handlerSite,`workflow:${c.exportName}`);for(const c of e.crons)o({detail:c.cron,id:`cron:${c.name}`,kind:"cron",name:c.name});for(const c of e.services){const l=c.rpcEntrypoint===void 0?"fetch":"rpc";o({detail:c.entrypoint===void 0?l:`${l} · ${c.entrypoint}`,id:`service:${c.name}`,kind:"service",name:c.worker})}return{nodes:t,sites:s}},fo=e=>e==="default"?"the default export is not a registered function":`"${e}" is not a registered function`,po=(e,t)=>"from"in e?[e.from]:"unattributed"in e?{reason:e.unattributed}:t.get(oe(e.file,e.exportName))??{reason:fo(e.exportName)},go=(e,t,s)=>{if("reason"in e)return{reason:e.reason};const n=po(e,t);if("reason"in n)return n;const{to:r}=e;return s.has(r)?{drawn:n.map(o=>({from:o,kind:e.kind,to:r}))}:{reason:`${r} is not declared`}},nt=e=>`${e.from}|${e.kind}|${e.to}`,mo=e=>`${e.file}|${String(e.line)}|${e.kind}|${e.reason}`,ho=e=>{const{nodes:t,sites:s}=uo(e),n=new Map,r=new Map;for(const o of[...co(e),...ao(e)]){const a=go(o,s,t);if("drawn"in a)for(const c of a.drawn)n.set(nt(c),c);else{const c={file:o.file,kind:o.kind,line:o.line,reason:a.reason};r.set(mo(c),c)}}return{edges:[...n.values()].toSorted((o,a)=>nt(o).localeCompare(nt(a))),nodes:[...t.values()].toSorted((o,a)=>o.id.localeCompare(a.id)),modules:e.modules.map(o=>({...o.description===void 0?{}:{description:o.description},...o.installed===!0?{installed:!0}:{},...o.ownsFolder===!1?{ownsFolder:!1}:{},name:o.name,tables:[...o.tables]})),unresolved:[...r.values()].toSorted((o,a)=>o.file.localeCompare(a.file)||o.line-a.line),version:1}},vo=e=>`${vr}export const architecture = ${mr(e,"Record<string, unknown>")};
|
|
1
|
+
import{existsSync as R,mkdirSync as Us,rmSync as lt,readdirSync as er,readFileSync as tr,writeFileSync as sr}from"node:fs";import{join as h,dirname as fe,relative as nr}from"node:path";import{performance as et}from"node:perf_hooks";import{runAdvisor as rr}from"@lunora/advisor";import{LunoraError as Y}from"@lunora/errors";import{readJsonSync as ir}from"@visulima/fs";import{SyntaxKind as d,Node as i,Project as ts}from"ts-morph";import{serializeSchemaSnapshot as or}from"./SCHEMA_SNAPSHOT_VERSION-C0oHwiJZ.mjs";import{toAdvisorContext as ar}from"./formatAdvisories-DwmUKYuc.mjs";import{r as cr,a as S,s as lr,b as dr}from"./project-config-file-Bv2l-Kmm.mjs";import{a as Ce,d as ur,r as fr}from"./modules-BIpFLz3Z.mjs";import{WORKFLOWS_FILENAME as pr,discoverWorkflows as gr}from"./WORKFLOWS_FILENAME-Ze98LsB3.mjs";import{r as mr}from"./json-data-Chfs2Cz5.mjs";import{n as hr,s as js}from"./paths-DwTjD7BU.mjs";import{G as vr}from"./shared-Be3TGzxM.mjs";import{CAPABILITIES as Er,usedCapabilities as xr}from"./CAPABILITY_PROBES-brcmKenl.mjs";import{isD1GlobalTable as Vs,isHyperdriveGlobalTable as qs}from"./isD1GlobalTable-udvHAAzD.mjs";import{discoverAgents as Sr}from"./AGENTS_FILENAME-NQIB6wh3.mjs";import{discoverContainers as yr}from"./CONTAINERS_FILENAME-CK3xJGwm.mjs";import Ar from"./discoverCrons-B5bVCaNF.mjs";import{diagnosticAt as Ee}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{b as Be}from"./module-specifiers-WF8iAydP.mjs";import{a as Ws,b as q,d as $,f as F,g as At,c as v,w as bt,k as br,l as Nr,h as Pr,j as dt,i as wr}from"./attribution-Dw35rOaJ.mjs";import{contextPropertiesRead as Ir,discoverFeatureUsage as Cr}from"./capabilitiesUsedBy-FnnYmnSl.mjs";import Tr from"./readPackageDependencies-RHhGiz0k.mjs";import{listLunoraSourceFiles as x,unwrapExpression as E,listSecurityScanFiles as $e,objectLiteralFromCallbackBody as Hs,propertyInitializer as I,lunoraRelativePath as C,bindingKeyName as xe,collectCallRows as T,findObjectProperty as L,collectSecurityCallRows as Or,collectNodeRows as ut,RUN_METHODS as Gs,functionKeyOf as Ys,limitNameOf as Qs,optionsObjectLiteral as Xs,handlerOf as Rr,chainRootOf as Nt,outermostValueWrapper as P,isWriteTarget as Ue,isSameNode as me,isConstDeclaration as Z,returningFunctionOf as ft,walkChain as kr,memberAccessOf as Fr,functionReferenceSegments as Dr,isTestPath as Lr}from"./isTestPath-CgyyLk8U.mjs";import{discoverQueueDeclarations as Mr}from"./QUEUES_FILENAME-Dj5yK34Z.mjs";import{discoverSandboxUsage as _r}from"./discoverSandboxUsage-CfEU2hM-.mjs";import{resolveServiceBindings as Kr}from"./readServiceBindings-DuE9xlvV.mjs";import zr from"./discoverStorageRulesMetadata-f89BWody.mjs";import{a as y,c as W,d as Js,e as Br}from"./classify-procedure-call-DxuPQkJA.mjs";import{i as $r}from"./ir-DBSvhNa-.mjs";import{gatePlatformFeatures as Ur,resolveCodegenTarget as Zs,readTargetDiagnostics as jr,studioPlatformFor as Vr}from"./DEFAULT_TARGET-GPPgJNTn.mjs";import{b as en,e as qr}from"./shard-Dr5gMNyz.mjs";import{e as Wr,a as Hr}from"./server-BmY5wwKY.mjs";import{emitDataModel as Gr}from"./emitDataModel-B68T_eX6.mjs";import{a as ss,r as tt,i as j,b as Yr,m as tn,c as je,e as sn,E as nn,C as rn,d as Qr,f as Xr,g as Jr}from"./context-root-B04bYCE-.mjs";import{r as Ve,s as Zr}from"./parse-validator-DYdT7Hyf.mjs";import ei from"./discoverAuthApiCalls-XK_WCMDG.mjs";import{i as ti,a as si,e as ni,b as ri,d as ii,c as oi}from"./unwrap-handler-return-T5sJhEss.mjs";import ai from"./discoverFunctions-Be-XuuSW.mjs";import ci from"./discoverHttpRoutes-CMOxt2Y9.mjs";import li from"./discoverHyperdriveCalls-mrho5AnY.mjs";import di from"./discoverInserts-BhIpUWXN.mjs";import{m as Pt,a as Fe,s as on,d as ui}from"./index-CefI-Sba.mjs";import{e as an}from"./exported-procedure-chains-C5VKkd9T.mjs";import fi from"./discoverMigrations-dVVZtuJa.mjs";import{i as B,r as cn}from"./database-calls-DWDtdDbS.mjs";import{MUTATORS_FILENAME as pi,isDefineMutatorCallee as gi,mutatorServerImplOf as mi,discoverMutators as hi}from"./MUTATORS_FILENAME-BrEGrcPU.mjs";import vi from"./discoverNondeterministicCalls-Dtb1aoGV.mjs";import{discoverNotifyConfig as Ei,discoverNotifyCalls as xi}from"./NOTIFY_FILENAME-D7DAtpNJ.mjs";import Si from"./discoverQueries-BSOjEsk3.mjs";import yi from"./discoverR2sqlCalls-KONCqZr2.mjs";import Ai from"./discoverRlsProcedures-c0DnIR4z.mjs";import bi from"./discoverRlsMetadata-9YDlDDoh.mjs";import Ni from"./discoverSchema-BTFFWy3i.mjs";import{secretKindOf as Pi,redact as wi,isHeuristicSecretKind as Ii,isSecretishName as Ci}from"./redact-Cy14LEnc.mjs";import{discoverShapes as Ti}from"./SHAPES_FILENAME-CVc2VCnS.mjs";import{i as Oi}from"./reserved-words-CW1QFbTd.mjs";import{emitApp as Ri}from"./emitApp-DUGS6Ve2.mjs";import{buildOpenApiDocument as ki,emitOpenApiModule as Fi}from"./buildOpenApiDocument-BjHdW7b2.mjs";import{buildOpenRpcDocument as Di,emitOpenRpcModule as Li}from"./OPENRPC_VERSION-BaD2A2YR.mjs";import{buildSchemaSnapshot as Mi}from"./SchemaSnapshotParseError-CPOXlFhI.mjs";import{emitCollections as _i,emitSeed as Ki,emitApi as zi,emitInternalApi as Bi}from"./emitApi-zY6egN77.mjs";import{t as $i,u as Ui,s as ji,v as Vi}from"./shard-runtime-BI2SZ54Z.mjs";import{emitCrons as qi,emitScheduler as Wi,emitShardRegistry as Hi,emitDurableObjects as Gi,emitVectors as Yi,emitWranglerCronTriggers as Qi}from"./emitCrons-B8TBAOZ4.mjs";import Xi from"./emitDrizzleSchema-DLtfKTI4.mjs";import Ji from"./emitFunctions-DkkcTDqh.mjs";const ns={error:"ERROR",info:"INFO",warn:"WARN"},rs={ERROR:2,INFO:0,WARN:1},Zi=e=>({cacheKey:"advisor_min_severity_invalid",categories:["SCHEMA"],description:"`advisor.minSeverity` in `lunora.config.*` sets the lowest advisory level codegen reports and writes into `_generated/shard.ts`. Codegen reads it by parsing the file, so it has to be a string literal.",detail:e,facing:"INTERNAL",level:"WARN",metadata:{},name:"advisor_min_severity_invalid",remediation:'Set `advisor: { minSeverity: "info" | "warn" | "error" }` as a literal on the config\'s default export.',title:"`advisor.minSeverity` is not a level codegen can read, so every advisory was reported"}),eo=(e,t)=>{const{advisor:s}=cr(e);if(s===void 0||s.minSeverity===void 0&&s.unreadable!==!0)return[...t];const{minSeverity:n}=s,r=n!==void 0&&Object.hasOwn(ns,n)?ns[n]:void 0;return r===void 0?[...t,Zi(n===void 0?"`advisor.minSeverity` is not a string literal codegen can read without evaluating the config: a computed value or key, or a spread that could set or override it.":`\`advisor.minSeverity\` is "${n}", which is not one of "info", "warn" or "error".`)]:t.filter(o=>rs[o.level]>=rs[r])},to={call:"function",enqueue:"queue",invoke:"service",publish:"topic",schedule:"function"},so="crons",no=pr.replace(/\.ts$/u,""),oe=(e,t)=>`${js(e)}:${t}`,st=(e,t,s)=>t===""?{reason:`the ${s} is not a string literal`}:{to:`${e}:${t}`},ro=e=>[...e.callEdges.map(t=>{const s=t.target===void 0?{reason:t.reason??"unreadable target"}:{to:`${to[t.kind]}:${t.target}`};return{file:t.file,kind:t.kind,line:t.line,scope:t.scope,...s}}),...e.queries.map(t=>({file:t.file,kind:"read",line:t.line,scope:t.scope,...st("table",t.table,"table name")})),...[...e.inserts,...e.tableWrites].map(t=>({file:t.file,kind:"write",line:t.line,scope:t.scope,...st("table",t.table,"written table")})),...e.workflowCalls.map(t=>({file:t.file,kind:"start",line:t.line,scope:t.scope,...st("workflow",t.workflow,"workflow name")}))],io=e=>e.untracked===!0?"inside a helper only code outside any export calls":"inside a non-exported helper",oo=e=>{const{scope:t}=e;switch(t.kind){case"export":return[{...e,exportName:t.name}];case"helper":return t.callers.length===0?[{...e,unattributed:io(t)}]:t.callers.map(s=>({...e,exportName:s}));default:return[{...e,unattributed:"at module scope"}]}},ao=e=>ro(e).flatMap(t=>oo(t)),co=e=>[...e.queues.flatMap(t=>t.topic===void 0?[]:[{file:t.filePath,from:`topic:${t.topic}`,kind:"subscribe",line:0,to:`queue:${t.exportName}`}]),...e.crons.map(t=>{const s=t.workflow===void 0?void 0:`workflow:${t.workflow.exportName}`,n=t.functionPath===void 0?void 0:`function:${t.functionPath}`,r=s??n;return{file:so,from:`cron:${t.name}`,kind:"trigger",line:0,...r===void 0?{reason:"the cron has no target"}:{to:r}}})],lo=e=>new Map(e.flatMap(t=>t.tables.map(s=>[s,t.name]))),ue=(e,t)=>t===void 0?e:{...e,module:t},uo=e=>{const t=new Map,s=new Map,n=lo(e.modules),r=(c,l)=>{s.set(c,[...s.get(c)??[],l])},o=(c,l)=>{t.set(c.id,c),l!==void 0&&r(l,c.id)},a=(c,l)=>{c!==void 0&&r(oe(c.file,c.exportName),l)};for(const c of e.functions){const l=oe(c.filePath,c.exportName),u=[...hr(c.filePath),c.exportName].join(".");o(ue({detail:c.kind,id:`function:${l}`,kind:"function",name:u},Ce(e.modules,c.filePath)),l)}for(const c of e.httpRoutes){const l=oe(c.filePath,c.exportName);o(ue({id:`http:${l}`,kind:"http",name:`${c.method} ${c.path}`},Ce(e.modules,c.filePath)),l)}for(const c of e.schema.tables)o(ue({id:`table:${c.name}`,kind:"table",name:c.name},n.get(c.name)));for(const c of e.queues){const l=c.topic===void 0?{}:{detail:"subscription"};o(ue({...l,id:`queue:${c.exportName}`,kind:"queue",name:c.exportName},Ce(e.modules,c.filePath)),oe(c.filePath,c.exportName)),a(c.handlerSite,`queue:${c.exportName}`)}for(const c of e.topics)o(ue({id:`topic:${c.exportName}`,kind:"topic",name:c.exportName},Ce(e.modules,c.filePath)));for(const c of e.workflows)o({id:`workflow:${c.exportName}`,kind:"workflow",name:c.exportName},oe(no,c.exportName)),a(c.handlerSite,`workflow:${c.exportName}`);for(const c of e.crons)o({detail:c.cron,id:`cron:${c.name}`,kind:"cron",name:c.name});for(const c of e.services){const l=c.rpcEntrypoint===void 0?"fetch":"rpc";o({detail:c.entrypoint===void 0?l:`${l} · ${c.entrypoint}`,id:`service:${c.name}`,kind:"service",name:c.worker})}return{nodes:t,sites:s}},fo=e=>e==="default"?"the default export is not a registered function":`"${e}" is not a registered function`,po=(e,t)=>"from"in e?[e.from]:"unattributed"in e?{reason:e.unattributed}:t.get(oe(e.file,e.exportName))??{reason:fo(e.exportName)},go=(e,t,s)=>{if("reason"in e)return{reason:e.reason};const n=po(e,t);if("reason"in n)return n;const{to:r}=e;return s.has(r)?{drawn:n.map(o=>({from:o,kind:e.kind,to:r}))}:{reason:`${r} is not declared`}},nt=e=>`${e.from}|${e.kind}|${e.to}`,mo=e=>`${e.file}|${String(e.line)}|${e.kind}|${e.reason}`,ho=e=>{const{nodes:t,sites:s}=uo(e),n=new Map,r=new Map;for(const o of[...co(e),...ao(e)]){const a=go(o,s,t);if("drawn"in a)for(const c of a.drawn)n.set(nt(c),c);else{const c={file:o.file,kind:o.kind,line:o.line,reason:a.reason};r.set(mo(c),c)}}return{edges:[...n.values()].toSorted((o,a)=>nt(o).localeCompare(nt(a))),nodes:[...t.values()].toSorted((o,a)=>o.id.localeCompare(a.id)),modules:e.modules.map(o=>({...o.description===void 0?{}:{description:o.description},...o.installed===!0?{installed:!0}:{},...o.ownsFolder===!1?{ownsFolder:!1}:{},name:o.name,tables:[...o.tables]})),unresolved:[...r.values()].toSorted((o,a)=>o.file.localeCompare(a.file)||o.line-a.line),version:1}},vo=e=>`${vr}export const architecture = ${mr(e,"Record<string, unknown>")};
|
|
2
2
|
`,is=(e,t="api")=>{const s=new Map;for(const n of e){const r=js(n),o=s.get(r);if(o===void 0){s.set(r,n);continue}if(o!==n){const a=t==="api"?`the generated api.ts would declare "${r}" twice and the dispatch key "${r}:<fn>" would be ambiguous`:`the generated api.ts would declare "${r}" twice in HttpStreamsRef and again in the httpStreams object literal`;throw new Y("INTERNAL",`@lunora/codegen: "${o}" and "${n}" both map to the ${t} namespace "${r}" — ${a}. Rename one file so the two differ by more than a non-identifier character (\`-\`, \`.\`, \`/\` and \`_\` all sanitize to \`_\`).`,{status:500})}}},Eo=(e,t={})=>{const{hasVectors:s=!0,scheduler:n=!1,storage:r=!1,usage:o}=t,a=[];e.tables.some(c=>Vs(c))&&a.push({name:"@lunora/d1",reason:"`.global()` tables are D1-backed, so `_generated/app.ts` imports the D1 `ctx.db` adapter"}),e.tables.some(c=>qs(c))&&a.push({name:"@lunora/hyperdrive",reason:'`.global({ backend: "hyperdrive" })` tables route through `@lunora/hyperdrive/global`'},{name:"@lunora/sql-store",reason:'`.global({ backend: "hyperdrive" })` makes `_generated/app.ts` import the `SqlCtxDbOptions` / `SqlExec` types'}),n&&a.push({name:"@lunora/scheduler",reason:"a declared cron (or `ctx.scheduler` use) makes `_generated/app.ts` import `createScheduler`"}),r&&a.push({name:"@lunora/storage",reason:"a `v.storage()` column, a storage access rule (or `ctx.storage` use) makes `_generated/app.ts` import `createStorage`"}),e.vectorIndexes.length>0&&s&&a.push({name:"@lunora/bindings",reason:"`.vectorize()` indexes make `_generated/shard.ts` import `@lunora/bindings/vectors`"});for(const c of o===void 0?[]:Er)c.requiredPackage!==void 0&&o?.[c.key]===!0&&a.push({name:c.requiredPackage,reason:`\`ctx.${c.contextProperty??c.key}\` usage makes \`_generated/\` import \`${c.moduleSpecifier}\``});return a.filter((c,l)=>a.findIndex(u=>u.name===c.name)===l)},xo=(e,t,s={})=>{if(t===void 0)return;const n=Eo(e,s).filter(o=>!t.has(o.name));if(n.length===0)return;const r=n.map(o=>` - ${o.name} — ${o.reason}`).join(`
|
|
3
3
|
`);throw new Y("INTERNAL",`@lunora/codegen: this schema's generated code imports packages the project does not declare:
|
|
4
4
|
${r}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/codegen",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.278",
|
|
4
4
|
"description": "Code generator for Lunora: emits _generated/{api,server,dataModel}.ts from your schema",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@lunora/advisor": "1.0.0-alpha.
|
|
50
|
-
"@lunora/agent": "1.0.0-alpha.
|
|
51
|
-
"@lunora/container": "1.0.0-alpha.
|
|
52
|
-
"@lunora/errors": "1.0.0-alpha.51",
|
|
49
|
+
"@lunora/advisor": "1.0.0-alpha.200",
|
|
50
|
+
"@lunora/agent": "1.0.0-alpha.188",
|
|
51
|
+
"@lunora/container": "1.0.0-alpha.71",
|
|
52
|
+
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
53
53
|
"@lunora/platform": "1.0.0-alpha.57",
|
|
54
|
-
"@lunora/queue": "1.0.0-alpha.
|
|
55
|
-
"@lunora/scheduler": "1.0.0-alpha.
|
|
56
|
-
"@lunora/values": "1.0.0-alpha.
|
|
57
|
-
"@lunora/workflow": "1.0.0-alpha.
|
|
54
|
+
"@lunora/queue": "1.0.0-alpha.96",
|
|
55
|
+
"@lunora/scheduler": "1.0.0-alpha.115",
|
|
56
|
+
"@lunora/values": "1.0.0-alpha.61",
|
|
57
|
+
"@lunora/workflow": "1.0.0-alpha.72",
|
|
58
58
|
"@visulima/fs": "6.0.28",
|
|
59
59
|
"jiti": "^2.7.0",
|
|
60
60
|
"quicktype-core": "^26.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as P}from"node:fs";import{join as S}from"node:path";import{SyntaxKind as l,Node as f}from"ts-morph";import{listLunoraSourceFiles as p,lunoraRelativePath as y,defaultExportExpression as E,findObjectProperty as d,handlerOf as g}from"./isTestPath-CgyyLk8U.mjs";import{b as N,d as v}from"./attribution-Dw35rOaJ.mjs";import{i as a}from"./context-root-B04bYCE-.mjs";import{c as F}from"./classify-procedure-call-DxuPQkJA.mjs";const O="notify.ts",A=new Set(["chat","inApp","send","webhook"]),h=new Set(["broadcast","send"]),b=e=>{const t=e.getInitializer();if(!t||!f.isCallExpression(t))return;const o=F(t);if(!o)return;const r=g(t,o.receiver);return r?{exportName:v(e)??e.getName(),handler:r,kind:o.kind}:void 0},m=e=>{const t=[];for(const o of N(e)){const r=b(o);r&&t.push(r)}return t},x=e=>a(e,["notify"])?"notify":a(e,["push"])||a(e,["notify","push"])?"push":void 0,k=e=>{if(!f.isPropertyAccessExpression(e))return;const t=e.getName(),o=x(e.getExpression());if(o==="notify"&&A.has(t))return`ctx.notify.${t}`;if(o==="push"&&h.has(t))return`ctx.push.${t}`},C=e=>f.isPropertyAccessExpression(e)?x(e.getExpression())==="push"&&h.has(e.getName()):!1,M=(e,t)=>{const o=[];for(const r of p(t)){const n=e.getSourceFile(r)??e.addSourceFileAtPath(r),c=y(t,r);for(const s of m(n))if(!(s.kind!=="query"&&s.kind!=="mutation"))for(const i of s.handler.getDescendantsOfKind(l.PropertyAccessExpression)){const u=k(i);u!==void 0&&o.push({callee:u,exportName:s.exportName,file:c,kind:s.kind,line:i.getStartLineNumber()})}}return o},D=(e,t)=>{for(const o of p(t)){const r=e.getSourceFile(o)??e.addSourceFileAtPath(o);for(const n of m(r))for(const c of n.handler.getDescendantsOfKind(l.PropertyAccessExpression))if(C(c))return!0}return!1},z=(e,t)=>{const o=S(t,O);if(!P(o))return;const r=e.getSourceFile(o)??e.addSourceFileAtPath(o),n=E(r);let c=!1,s=!1;if(n&&f.isCallExpression(n)){const i=n.getArguments()[0];i&&f.isObjectLiteralExpression(i)&&(c=d(i,"webPush")!==void 0,s=d(i,"fcm")!==void 0)}return{hasFcm:s,hasWebPush:c,usesPush:D(e,t)}};export{O as NOTIFY_FILENAME,M as discoverNotifyCalls,z as discoverNotifyConfig};
|