@lunora/codegen 1.0.0-alpha.278 → 1.0.0-alpha.279
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 +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/QUEUES_FILENAME-CG1CuK-T.mjs +1 -0
- package/dist/packem_shared/{SCHEMA_SNAPSHOT_FILENAME-Ckd4suI-.mjs → SCHEMA_SNAPSHOT_FILENAME-BNGM7Peq.mjs} +6 -6
- package/dist/packem_shared/emitAgents-BPxcXbC6.mjs +1 -0
- package/dist/packem_shared/{emitShard-CSLqD-Hr.mjs → emitShard-HJfeP8nZ.mjs} +1 -1
- package/dist/packem_shared/{shard-Dr5gMNyz.mjs → shard-D39UvC5v.mjs} +1 -1
- package/dist/packem_shared/{shard-runtime-BI2SZ54Z.mjs → shard-runtime-B7YKtoEK.mjs} +67 -67
- package/package.json +6 -6
- package/dist/packem_shared/QUEUES_FILENAME-Dj5yK34Z.mjs +0 -1
- package/dist/packem_shared/emitAgents-CG2R-Zz6.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1008,6 +1008,7 @@ interface QueueIR {
|
|
|
1008
1008
|
deadLetterQueue?: string;
|
|
1009
1009
|
maxBatchSize?: number;
|
|
1010
1010
|
maxBatchTimeout?: number;
|
|
1011
|
+
maxConcurrency?: number;
|
|
1011
1012
|
maxRetries?: number;
|
|
1012
1013
|
retryDelay?: number;
|
|
1013
1014
|
};
|
|
@@ -2385,6 +2386,20 @@ interface WranglerVariableIR {
|
|
|
2385
2386
|
/** Redacted preview of the value (first few chars + length) for the finding detail — never the full secret. */
|
|
2386
2387
|
preview: string;
|
|
2387
2388
|
}
|
|
2389
|
+
/**
|
|
2390
|
+
* One `queues.producers[]` entry of `wrangler.jsonc`, from the top level or an
|
|
2391
|
+
* `env.<name>` block — how codegen learns a queue's per-environment name. Produced
|
|
2392
|
+
* by `@lunora/config` (which reads `wrangler.jsonc`); codegen only matches it to a
|
|
2393
|
+
* declared queue by `binding`.
|
|
2394
|
+
*/
|
|
2395
|
+
interface WranglerQueueProducerIR {
|
|
2396
|
+
/** The `Queue` producer binding, e.g. `QUEUE_JOBS`. */
|
|
2397
|
+
binding: string;
|
|
2398
|
+
/** The `env.<name>` block the entry sits in; absent for the top level. */
|
|
2399
|
+
env?: string;
|
|
2400
|
+
/** The queue name that binding sends to in that scope, e.g. `jobs-preview`. */
|
|
2401
|
+
queue: string;
|
|
2402
|
+
}
|
|
2388
2403
|
interface ProjectIR {
|
|
2389
2404
|
crons: ReadonlyArray<CronJobIR>;
|
|
2390
2405
|
functions: ReadonlyArray<FunctionIR>;
|
|
@@ -3093,6 +3108,16 @@ interface CodegenOptions {
|
|
|
3093
3108
|
* a breaking change. Ignored when `dryRun` is true.
|
|
3094
3109
|
*/
|
|
3095
3110
|
updateSchemaBaseline?: boolean;
|
|
3111
|
+
/**
|
|
3112
|
+
* Every `queues.producers[]` entry of `wrangler.jsonc`, top level and each
|
|
3113
|
+
* `env.<name>` block. A producer naming a push queue's binding with another
|
|
3114
|
+
* queue name becomes an extra route in `_generated/queues.ts`, so a batch from
|
|
3115
|
+
* a per-environment rename (`jobs-preview`) reaches the `jobs` handler.
|
|
3116
|
+
* Produced by `@lunora/config`'s `wranglerCodegenInputs`; `[]` when there is
|
|
3117
|
+
* no wrangler config. Required so a caller that writes `_generated/` cannot
|
|
3118
|
+
* forget it and emit a registry without the renames.
|
|
3119
|
+
*/
|
|
3120
|
+
wranglerQueueProducers: ReadonlyArray<WranglerQueueProducerIR>;
|
|
3096
3121
|
/**
|
|
3097
3122
|
* Committed `wrangler.jsonc` `vars` entries that hold plaintext secrets — the
|
|
3098
3123
|
* `plaintext_secret_in_wrangler_vars` lint input. Produced by `@lunora/config`
|
|
@@ -4658,4 +4683,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
4658
4683
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
4659
4684
|
declare const redact: (value: string) => string;
|
|
4660
4685
|
declare const VERSION = "0.0.0";
|
|
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 };
|
|
4686
|
+
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 WranglerQueueProducerIR, 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
|
@@ -1008,6 +1008,7 @@ interface QueueIR {
|
|
|
1008
1008
|
deadLetterQueue?: string;
|
|
1009
1009
|
maxBatchSize?: number;
|
|
1010
1010
|
maxBatchTimeout?: number;
|
|
1011
|
+
maxConcurrency?: number;
|
|
1011
1012
|
maxRetries?: number;
|
|
1012
1013
|
retryDelay?: number;
|
|
1013
1014
|
};
|
|
@@ -2385,6 +2386,20 @@ interface WranglerVariableIR {
|
|
|
2385
2386
|
/** Redacted preview of the value (first few chars + length) for the finding detail — never the full secret. */
|
|
2386
2387
|
preview: string;
|
|
2387
2388
|
}
|
|
2389
|
+
/**
|
|
2390
|
+
* One `queues.producers[]` entry of `wrangler.jsonc`, from the top level or an
|
|
2391
|
+
* `env.<name>` block — how codegen learns a queue's per-environment name. Produced
|
|
2392
|
+
* by `@lunora/config` (which reads `wrangler.jsonc`); codegen only matches it to a
|
|
2393
|
+
* declared queue by `binding`.
|
|
2394
|
+
*/
|
|
2395
|
+
interface WranglerQueueProducerIR {
|
|
2396
|
+
/** The `Queue` producer binding, e.g. `QUEUE_JOBS`. */
|
|
2397
|
+
binding: string;
|
|
2398
|
+
/** The `env.<name>` block the entry sits in; absent for the top level. */
|
|
2399
|
+
env?: string;
|
|
2400
|
+
/** The queue name that binding sends to in that scope, e.g. `jobs-preview`. */
|
|
2401
|
+
queue: string;
|
|
2402
|
+
}
|
|
2388
2403
|
interface ProjectIR {
|
|
2389
2404
|
crons: ReadonlyArray<CronJobIR>;
|
|
2390
2405
|
functions: ReadonlyArray<FunctionIR>;
|
|
@@ -3093,6 +3108,16 @@ interface CodegenOptions {
|
|
|
3093
3108
|
* a breaking change. Ignored when `dryRun` is true.
|
|
3094
3109
|
*/
|
|
3095
3110
|
updateSchemaBaseline?: boolean;
|
|
3111
|
+
/**
|
|
3112
|
+
* Every `queues.producers[]` entry of `wrangler.jsonc`, top level and each
|
|
3113
|
+
* `env.<name>` block. A producer naming a push queue's binding with another
|
|
3114
|
+
* queue name becomes an extra route in `_generated/queues.ts`, so a batch from
|
|
3115
|
+
* a per-environment rename (`jobs-preview`) reaches the `jobs` handler.
|
|
3116
|
+
* Produced by `@lunora/config`'s `wranglerCodegenInputs`; `[]` when there is
|
|
3117
|
+
* no wrangler config. Required so a caller that writes `_generated/` cannot
|
|
3118
|
+
* forget it and emit a registry without the renames.
|
|
3119
|
+
*/
|
|
3120
|
+
wranglerQueueProducers: ReadonlyArray<WranglerQueueProducerIR>;
|
|
3096
3121
|
/**
|
|
3097
3122
|
* Committed `wrangler.jsonc` `vars` entries that hold plaintext secrets — the
|
|
3098
3123
|
* `plaintext_secret_in_wrangler_vars` lint input. Produced by `@lunora/config`
|
|
@@ -4658,4 +4683,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
4658
4683
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
4659
4684
|
declare const redact: (value: string) => string;
|
|
4660
4685
|
declare const VERSION = "0.0.0";
|
|
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 };
|
|
4686
|
+
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 WranglerQueueProducerIR, 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 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-
|
|
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-CG1CuK-T.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-BNGM7Peq.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-D39UvC5v.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-B7YKtoEK.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 x}from"node:fs";import{join as f}from"node:path";import{LunoraError as b}from"@lunora/errors";import{queueDefaultName as q,queueBindingName as y}from"@lunora/queue";import{SyntaxKind as S,Node as u}from"ts-morph";import{diagnosticAt as c}from"./CodegenDiagnosticError-BUXlG3P-.mjs";import{lunoraRelativePath as g,findObjectProperty as l,stringPropertyFor as w}from"./isTestPath-CgyyLk8U.mjs";import{a as v}from"./attribution-Dw35rOaJ.mjs";import{r as $}from"./handler-reference-2Hs4WKnz.mjs";import{d as F}from"./modules-BIpFLz3Z.mjs";const h="queues.ts",P=o=>{const e=t=>t==="defineQueue"||t==="defineSubscription"||t==="defineTopic",i=o.getSymbol();if(!i){const t=o.getText();return e(t)?t:void 0}for(const t of i.getDeclarations()){if(!u.isImportSpecifier(t))continue;if(t.getImportDeclaration().getModuleSpecifierValue()!=="@lunora/queue")return;const n=t.getNameNode().getText();return e(n)?n:void 0}},d=w("queue"),E=(o,e,i)=>{if(u.isNumericLiteral(o))return o.getLiteralValue();throw c(o,`queue "${e}": \`${i}\` must be a static numeric literal — it is deploy configuration codegen writes into wrangler.jsonc`)},I={maxBatchSize:{integer:!0,max:100,min:1},maxBatchTimeout:{integer:!1,max:60,min:0},maxConcurrency:{integer:!0,max:250,min:1},maxRetries:{integer:!0,max:100,min:0},retryDelay:{integer:!0,max:86400,min:0}},A=(o,e)=>{const i={};for(const[t,n]of Object.entries(I)){const r=l(o,t);if(r&&u.isPropertyAssignment(r)){const a=E(r.getInitializerOrThrow(),e,t);if(a<n.min||a>n.max||n.integer&&!Number.isInteger(a))throw c(r,`queue "${e}": \`${t}\` must be ${n.integer?"an integer":"a number"} from ${n.min.toString()} to ${n.max.toString()} (got ${a.toString()})`);i[t]=a}}return i},T=(o,e)=>{const i=l(o,"name");if(!i||!u.isPropertyAssignment(i))return;const t=d(i.getInitializerOrThrow(),e,"name");if(t.length===0)throw c(i,`queue "${e}": \`name\` must be a non-empty string when provided`);return t},N=(o,e,i,t)=>{const n=$(l(o,"handler"),t)?.site,r={bindingName:y(e),exportName:e,filePath:g(t,o.getSourceFile().getFilePath()),mode:"push",name:T(o,e)??q(e),...i===void 0?{}:{topic:i},...n===void 0?{}:{handlerSite:n},tuning:{}},a=l(o,"mode");if(a&&u.isPropertyAssignment(a)){if(i!==void 0)throw c(a,`subscription "${e}": \`mode\` is not allowed — a subscription is always a push consumer`);const m=d(a.getInitializerOrThrow(),e,"mode");if(m!=="push"&&m!=="pull")throw c(a,`queue "${e}": \`mode\` must be "push" or "pull" (got ${JSON.stringify(m)})`);r.mode=m}const s=l(o,"deadLetterQueue");return s&&u.isPropertyAssignment(s)&&(r.tuning.deadLetterQueue=d(s.getInitializerOrThrow(),e,"deadLetterQueue")),Object.assign(r.tuning,A(o,e)),r},O=(o,e,i)=>{const t=o.getArguments()[0];if(!t||!u.isObjectLiteralExpression(t))throw c(o,`queue "${e}": defineQueue must be passed an inline object literal`);return N(t,e,void 0,i)},p=(o,e)=>`${o}:${e}`,Q=o=>{const e=o.getSymbol(),i=(e?.isAlias()===!0?e.getAliasedSymbol():e)?.getDeclarations()[0];return i!==void 0&&u.isVariableDeclaration(i)?p(i.getSourceFile().getFilePath(),i.getName()):p(o.getSourceFile().getFilePath(),o.getText())},L=(o,e,i,t)=>{const[n,r]=o.getArguments(),a=n!==void 0&&u.isIdentifier(n)?i.get(Q(n)):void 0;if(a===void 0)throw c(n??o,`subscription "${e}": the first argument must name a \`defineTopic()\` export of lunora/queues.ts or a module's queues.ts`);if(!r||!u.isObjectLiteralExpression(r))throw c(o,`subscription "${e}": defineSubscription must be passed an inline object literal`);return N(r,e,a,t)},U=o=>{const e=[];for(const i of o.getVariableDeclarations()){const t=i.getInitializer();if(t?.getKind()!==S.CallExpression)continue;const n=t,r=n.getExpression(),a=u.isIdentifier(r)?P(r):void 0;if(a===void 0)continue;const s=i.getNameNode();if(!u.isIdentifier(s)){if(i.getVariableStatement()?.hasExportKeyword()!==!0)continue;throw c(s,`${a} exports must be plain named exports (no destructuring)`)}const m=v(i,"binding");m!==void 0&&e.push({call:n,exportName:m,factory:a,localName:s.getText()})}return e},C=(o,e)=>{const i=new Map;for(const t of o){const n=g(e,t.call.getSourceFile().getFilePath()),r=i.get(t.exportName);if(r!==void 0)throw c(t.call,`"${t.exportName}" is exported by both lunora/${r}.ts and lunora/${n}.ts — queue and topic export names must be unique across the app`);i.set(t.exportName,n)}},M=(o,e)=>{const i=o.flatMap(s=>U(s));C(i,e);const t=i.filter(s=>s.factory==="defineTopic"),n=new Map(t.map(s=>[p(s.call.getSourceFile().getFilePath(),s.localName),s.exportName])),r=[];for(const s of i)s.factory==="defineQueue"?r.push(O(s.call,s.exportName,e)):s.factory==="defineSubscription"&&r.push(L(s.call,s.exportName,n,e));const a=t.map(s=>({exportName:s.exportName,filePath:g(e,s.call.getSourceFile().getFilePath())}));return{queues:r,topics:a}},j=(o,e)=>[f(e,h),...F(o,e).map(i=>f(e,i.name,h))].filter(i=>x(i)),z=o=>{const e=new Map,i=new Map;for(const t of o){const n=e.get(t.name);if(n!==void 0)throw new b("DUPLICATE_QUEUE_NAME",`Duplicate queue name "${t.name}": produced by both "${n}" and "${t.exportName}". Deployed queue names must be unique across the project.`,{status:500});e.set(t.name,t.exportName);const r=i.get(t.bindingName);if(r!==void 0)throw new b("DUPLICATE_QUEUE_BINDING",`Duplicate queue binding "${t.bindingName}": produced by both "${r}" and "${t.exportName}". Queue export names must yield unique binding names.`,{status:500});i.set(t.bindingName,t.exportName)}},D=(o,e)=>{const i=j(o,e).map(a=>o.getSourceFile(a)??o.addSourceFileAtPath(a)),{queues:t,topics:n}=M(i,e),r=t.toSorted((a,s)=>a.exportName.localeCompare(s.exportName));return z(r),{queues:r,topics:n.toSorted((a,s)=>a.exportName.localeCompare(s.exportName))}},X=(o,e)=>D(o,e).queues;export{h as QUEUES_FILENAME,D as discoverQueueDeclarations,X as discoverQueues};
|