@lunora/server 1.0.0-alpha.164 → 1.0.0-alpha.165

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 CHANGED
@@ -3008,6 +3008,45 @@ interface RegisteredMigration extends MigrationDefinition {
3008
3008
  }
3009
3009
  /** Declare an online data migration. See the module docs for runtime semantics. */
3010
3010
  declare const defineMigration: (definition: MigrationDefinition) => RegisteredMigration;
3011
+ /**
3012
+ * Module authoring API — `defineModule` marks a folder under `lunora/` as a
3013
+ * module, the unit the Studio's module catalog and architecture diagram group
3014
+ * by. A folder is a module when it holds a `module.ts` whose default export is
3015
+ * a `defineModule(...)` call; every source file beneath it belongs to that
3016
+ * module. The module name is the folder name.
3017
+ *
3018
+ * Metadata only: modules change no `api.*` path, no dispatch path and nothing
3019
+ * at runtime — the whole app still deploys as one Worker. `@lunora/codegen`
3020
+ * reads the literals statically, so `description` and `tables` must be written
3021
+ * inline.
3022
+ */
3023
+ /** The config passed to {@link defineModule}. */
3024
+ interface ModuleConfig {
3025
+ /** One line shown in the Studio module catalog. */
3026
+ description?: string;
3027
+ /**
3028
+ * Tables this module owns. A function in another module writing one of
3029
+ * them is reported by the `cross_module_table_write` advisor lint. Omit to
3030
+ * declare no ownership (the lint then stays silent for this module).
3031
+ */
3032
+ tables?: ReadonlyArray<string>;
3033
+ }
3034
+ /** The branded result of {@link defineModule}, discovered by codegen. */
3035
+ interface ModuleDefinition extends ModuleConfig {
3036
+ /** Runtime brand identifying a `defineModule` result. */
3037
+ readonly isLunoraModule: true;
3038
+ }
3039
+ /**
3040
+ * Declare the module a `lunora/<folder>/module.ts` file stands for:
3041
+ *
3042
+ * ```ts
3043
+ * // lunora/billing/module.ts
3044
+ * import { defineModule } from "@lunora/server";
3045
+ *
3046
+ * export default defineModule({ description: "Invoices and payments", tables: ["invoices", "payments"] });
3047
+ * ```
3048
+ */
3049
+ declare const defineModule: (config?: ModuleConfig) => ModuleDefinition;
3011
3050
  /**
3012
3051
  * A mutator declaration. `server` is authoritative; `client` is the optimistic
3013
3052
  * twin (optional — omit it to let the optimistic write fall through to the
@@ -3706,4 +3745,4 @@ type RegisteredWhisperAuthorizer = RegisteredFunction<Record<string, never>, boo
3706
3745
  */
3707
3746
  declare const onWhisper: (handler: WhisperAuthorizeHandler) => RegisteredWhisperAuthorizer;
3708
3747
  declare const VERSION = "0.0.0";
3709
- export { DEFAULT_ACTION_CACHE_TTL_MS as ACTION_CACHE_DEFAULT_TTL_MS, ACTION_CACHE_TABLE, type ActionBuilder, type ActionCacheComponent, type ActionCacheContext, type ActionCacheDatabase, type ActionCacheFunctions, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_REDACTED_FIELDS as DOCUMENT_HISTORY_REDACTED_FIELDS, DOCUMENT_HISTORY_TABLE, type DataModelInit, type DeferredDeleteFlushResult, type DefineActionCacheOptions, type DefineComponentOptions, type DefineDocumentHistoryOptions, type DefineIdentityOptions, type DefineListArgsConfig, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type DocumentHistoryComponent, type DocumentHistoryEntry, type DocumentHistoryFunctions, type DurableObjectJurisdiction, type DurableStreamOptions, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExposeConfig, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpRunners, type HttpStreamHandlerOptions, type IdentityContract, type IdentityRejectMode, type IdentityValidation, type IndexFieldsByTable, type InferArgs, type InferEnv, type InferIdentity, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type ListArgsSpec, type ListArgsValidators, type ListArgsValue, type ListFilterOperators, type ListOrderByEntry, type ListWhere, type LunoraBuilders, LunoraEnvError, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskRegistry, type MaskStrategy, type Middleware, type MiddlewareContext, type MiddlewareNext, type MigrationCtx, type MigrationDefinition, type MigrationDocument, type MigrationReader, type MigrationTransform, type MutationBuilder, type MutationCtx, type MutatorDefinition, type OnDeleteAction, type OneRelation, type OrmLike, DEFAULT_TTL_MS as PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, type Permission, type Plugin, type Policy, type PrefixedTables, type PresenceComponent, type PresenceFunctions, type PresenceMember, type ProtectPublicOptions, type QueryBuilder, type QueryCtx, type RankIndexDefinition, type RankIndexOptions, type ReactorHandler, type ReactorOutcome, type ReactorSelect, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredMutator, type RegisteredQuery, type RegisteredReactor, type RegisteredShape, type RegisteredStream, type RegisteredWhisperAuthorizer, type RelationBuilder, type RelationDefinition, type RlsOptions, type RlsReadRegistry, type Role, type Schema, type SchemaExtension, type ShapeDefinition, type ShapeGuardDeclaration, type ShapeReadWhereRequest, type ShardInitEvent, type ShardInitHandler, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, type StorageServeAuthorizer, type StorageServeAuthzContext, type TableBuilder, type TableDefinition, type TerminalKind, type TriggerBuilder, type TriggerDefinition, type TypedDefinePolicyInput, VERSION, type VectorEmbedder, type VectorIndexDefinition, type VectorIndexOptions, type VectorMetric, type VectorizeOptions, type WhereInput, type WhisperAuthorizeHandler, type WhisperEvent, actionCacheExtension, allowAll, asBucketStorage, assertShapesDeclareReadPolicies, beginDeferredDeletes, beginDeferredSchedules, bindOrm, bindTableFacade, buildMaskRegistry, buildRlsReadRegistry, cacheKeyFor, clampLimit, composePluginMiddleware, composeShapeReadWhere, createPolicyDsl, createSecrets, defineActionCache, defineAggregateIndex, defineComponent, defineDocumentHistory, defineEnv, defineIdentity, defineListArgs, defineMigration, defineMutator, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineShape, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, deny, documentHistoryExtension, flushDeferredDeletes, httpAction, httpRoute, httpRouter, indexFieldsFromSchema, initLunora, installPlugins, isDeny, isPerDispatchMiddleware, isSafeHeaderValue, mask, mergeSchemaExtension, onConnect, onDisconnect, onQueryChange, onShardInit, onWhisper, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules, tagPerDispatchMiddleware, toWhereInput, withDeferredDeletes, withDeferredSchedules };
3748
+ export { DEFAULT_ACTION_CACHE_TTL_MS as ACTION_CACHE_DEFAULT_TTL_MS, ACTION_CACHE_TABLE, type ActionBuilder, type ActionCacheComponent, type ActionCacheContext, type ActionCacheDatabase, type ActionCacheFunctions, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_REDACTED_FIELDS as DOCUMENT_HISTORY_REDACTED_FIELDS, DOCUMENT_HISTORY_TABLE, type DataModelInit, type DeferredDeleteFlushResult, type DefineActionCacheOptions, type DefineComponentOptions, type DefineDocumentHistoryOptions, type DefineIdentityOptions, type DefineListArgsConfig, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type DocumentHistoryComponent, type DocumentHistoryEntry, type DocumentHistoryFunctions, type DurableObjectJurisdiction, type DurableStreamOptions, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExposeConfig, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpRunners, type HttpStreamHandlerOptions, type IdentityContract, type IdentityRejectMode, type IdentityValidation, type IndexFieldsByTable, type InferArgs, type InferEnv, type InferIdentity, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type ListArgsSpec, type ListArgsValidators, type ListArgsValue, type ListFilterOperators, type ListOrderByEntry, type ListWhere, type LunoraBuilders, LunoraEnvError, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskRegistry, type MaskStrategy, type Middleware, type MiddlewareContext, type MiddlewareNext, type MigrationCtx, type MigrationDefinition, type MigrationDocument, type MigrationReader, type MigrationTransform, type ModuleConfig, type ModuleDefinition, type MutationBuilder, type MutationCtx, type MutatorDefinition, type OnDeleteAction, type OneRelation, type OrmLike, DEFAULT_TTL_MS as PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, type Permission, type Plugin, type Policy, type PrefixedTables, type PresenceComponent, type PresenceFunctions, type PresenceMember, type ProtectPublicOptions, type QueryBuilder, type QueryCtx, type RankIndexDefinition, type RankIndexOptions, type ReactorHandler, type ReactorOutcome, type ReactorSelect, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredMutator, type RegisteredQuery, type RegisteredReactor, type RegisteredShape, type RegisteredStream, type RegisteredWhisperAuthorizer, type RelationBuilder, type RelationDefinition, type RlsOptions, type RlsReadRegistry, type Role, type Schema, type SchemaExtension, type ShapeDefinition, type ShapeGuardDeclaration, type ShapeReadWhereRequest, type ShardInitEvent, type ShardInitHandler, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, type StorageServeAuthorizer, type StorageServeAuthzContext, type TableBuilder, type TableDefinition, type TerminalKind, type TriggerBuilder, type TriggerDefinition, type TypedDefinePolicyInput, VERSION, type VectorEmbedder, type VectorIndexDefinition, type VectorIndexOptions, type VectorMetric, type VectorizeOptions, type WhereInput, type WhisperAuthorizeHandler, type WhisperEvent, actionCacheExtension, allowAll, asBucketStorage, assertShapesDeclareReadPolicies, beginDeferredDeletes, beginDeferredSchedules, bindOrm, bindTableFacade, buildMaskRegistry, buildRlsReadRegistry, cacheKeyFor, clampLimit, composePluginMiddleware, composeShapeReadWhere, createPolicyDsl, createSecrets, defineActionCache, defineAggregateIndex, defineComponent, defineDocumentHistory, defineEnv, defineIdentity, defineListArgs, defineMigration, defineModule, defineMutator, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineShape, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, deny, documentHistoryExtension, flushDeferredDeletes, httpAction, httpRoute, httpRouter, indexFieldsFromSchema, initLunora, installPlugins, isDeny, isPerDispatchMiddleware, isSafeHeaderValue, mask, mergeSchemaExtension, onConnect, onDisconnect, onQueryChange, onShardInit, onWhisper, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules, tagPerDispatchMiddleware, toWhereInput, withDeferredDeletes, withDeferredSchedules };
package/dist/index.d.ts CHANGED
@@ -3008,6 +3008,45 @@ interface RegisteredMigration extends MigrationDefinition {
3008
3008
  }
3009
3009
  /** Declare an online data migration. See the module docs for runtime semantics. */
3010
3010
  declare const defineMigration: (definition: MigrationDefinition) => RegisteredMigration;
3011
+ /**
3012
+ * Module authoring API — `defineModule` marks a folder under `lunora/` as a
3013
+ * module, the unit the Studio's module catalog and architecture diagram group
3014
+ * by. A folder is a module when it holds a `module.ts` whose default export is
3015
+ * a `defineModule(...)` call; every source file beneath it belongs to that
3016
+ * module. The module name is the folder name.
3017
+ *
3018
+ * Metadata only: modules change no `api.*` path, no dispatch path and nothing
3019
+ * at runtime — the whole app still deploys as one Worker. `@lunora/codegen`
3020
+ * reads the literals statically, so `description` and `tables` must be written
3021
+ * inline.
3022
+ */
3023
+ /** The config passed to {@link defineModule}. */
3024
+ interface ModuleConfig {
3025
+ /** One line shown in the Studio module catalog. */
3026
+ description?: string;
3027
+ /**
3028
+ * Tables this module owns. A function in another module writing one of
3029
+ * them is reported by the `cross_module_table_write` advisor lint. Omit to
3030
+ * declare no ownership (the lint then stays silent for this module).
3031
+ */
3032
+ tables?: ReadonlyArray<string>;
3033
+ }
3034
+ /** The branded result of {@link defineModule}, discovered by codegen. */
3035
+ interface ModuleDefinition extends ModuleConfig {
3036
+ /** Runtime brand identifying a `defineModule` result. */
3037
+ readonly isLunoraModule: true;
3038
+ }
3039
+ /**
3040
+ * Declare the module a `lunora/<folder>/module.ts` file stands for:
3041
+ *
3042
+ * ```ts
3043
+ * // lunora/billing/module.ts
3044
+ * import { defineModule } from "@lunora/server";
3045
+ *
3046
+ * export default defineModule({ description: "Invoices and payments", tables: ["invoices", "payments"] });
3047
+ * ```
3048
+ */
3049
+ declare const defineModule: (config?: ModuleConfig) => ModuleDefinition;
3011
3050
  /**
3012
3051
  * A mutator declaration. `server` is authoritative; `client` is the optimistic
3013
3052
  * twin (optional — omit it to let the optimistic write fall through to the
@@ -3706,4 +3745,4 @@ type RegisteredWhisperAuthorizer = RegisteredFunction<Record<string, never>, boo
3706
3745
  */
3707
3746
  declare const onWhisper: (handler: WhisperAuthorizeHandler) => RegisteredWhisperAuthorizer;
3708
3747
  declare const VERSION = "0.0.0";
3709
- export { DEFAULT_ACTION_CACHE_TTL_MS as ACTION_CACHE_DEFAULT_TTL_MS, ACTION_CACHE_TABLE, type ActionBuilder, type ActionCacheComponent, type ActionCacheContext, type ActionCacheDatabase, type ActionCacheFunctions, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_REDACTED_FIELDS as DOCUMENT_HISTORY_REDACTED_FIELDS, DOCUMENT_HISTORY_TABLE, type DataModelInit, type DeferredDeleteFlushResult, type DefineActionCacheOptions, type DefineComponentOptions, type DefineDocumentHistoryOptions, type DefineIdentityOptions, type DefineListArgsConfig, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type DocumentHistoryComponent, type DocumentHistoryEntry, type DocumentHistoryFunctions, type DurableObjectJurisdiction, type DurableStreamOptions, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExposeConfig, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpRunners, type HttpStreamHandlerOptions, type IdentityContract, type IdentityRejectMode, type IdentityValidation, type IndexFieldsByTable, type InferArgs, type InferEnv, type InferIdentity, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type ListArgsSpec, type ListArgsValidators, type ListArgsValue, type ListFilterOperators, type ListOrderByEntry, type ListWhere, type LunoraBuilders, LunoraEnvError, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskRegistry, type MaskStrategy, type Middleware, type MiddlewareContext, type MiddlewareNext, type MigrationCtx, type MigrationDefinition, type MigrationDocument, type MigrationReader, type MigrationTransform, type MutationBuilder, type MutationCtx, type MutatorDefinition, type OnDeleteAction, type OneRelation, type OrmLike, DEFAULT_TTL_MS as PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, type Permission, type Plugin, type Policy, type PrefixedTables, type PresenceComponent, type PresenceFunctions, type PresenceMember, type ProtectPublicOptions, type QueryBuilder, type QueryCtx, type RankIndexDefinition, type RankIndexOptions, type ReactorHandler, type ReactorOutcome, type ReactorSelect, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredMutator, type RegisteredQuery, type RegisteredReactor, type RegisteredShape, type RegisteredStream, type RegisteredWhisperAuthorizer, type RelationBuilder, type RelationDefinition, type RlsOptions, type RlsReadRegistry, type Role, type Schema, type SchemaExtension, type ShapeDefinition, type ShapeGuardDeclaration, type ShapeReadWhereRequest, type ShardInitEvent, type ShardInitHandler, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, type StorageServeAuthorizer, type StorageServeAuthzContext, type TableBuilder, type TableDefinition, type TerminalKind, type TriggerBuilder, type TriggerDefinition, type TypedDefinePolicyInput, VERSION, type VectorEmbedder, type VectorIndexDefinition, type VectorIndexOptions, type VectorMetric, type VectorizeOptions, type WhereInput, type WhisperAuthorizeHandler, type WhisperEvent, actionCacheExtension, allowAll, asBucketStorage, assertShapesDeclareReadPolicies, beginDeferredDeletes, beginDeferredSchedules, bindOrm, bindTableFacade, buildMaskRegistry, buildRlsReadRegistry, cacheKeyFor, clampLimit, composePluginMiddleware, composeShapeReadWhere, createPolicyDsl, createSecrets, defineActionCache, defineAggregateIndex, defineComponent, defineDocumentHistory, defineEnv, defineIdentity, defineListArgs, defineMigration, defineMutator, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineShape, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, deny, documentHistoryExtension, flushDeferredDeletes, httpAction, httpRoute, httpRouter, indexFieldsFromSchema, initLunora, installPlugins, isDeny, isPerDispatchMiddleware, isSafeHeaderValue, mask, mergeSchemaExtension, onConnect, onDisconnect, onQueryChange, onShardInit, onWhisper, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules, tagPerDispatchMiddleware, toWhereInput, withDeferredDeletes, withDeferredSchedules };
3748
+ export { DEFAULT_ACTION_CACHE_TTL_MS as ACTION_CACHE_DEFAULT_TTL_MS, ACTION_CACHE_TABLE, type ActionBuilder, type ActionCacheComponent, type ActionCacheContext, type ActionCacheDatabase, type ActionCacheFunctions, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_REDACTED_FIELDS as DOCUMENT_HISTORY_REDACTED_FIELDS, DOCUMENT_HISTORY_TABLE, type DataModelInit, type DeferredDeleteFlushResult, type DefineActionCacheOptions, type DefineComponentOptions, type DefineDocumentHistoryOptions, type DefineIdentityOptions, type DefineListArgsConfig, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type DocumentHistoryComponent, type DocumentHistoryEntry, type DocumentHistoryFunctions, type DurableObjectJurisdiction, type DurableStreamOptions, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExposeConfig, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpRunners, type HttpStreamHandlerOptions, type IdentityContract, type IdentityRejectMode, type IdentityValidation, type IndexFieldsByTable, type InferArgs, type InferEnv, type InferIdentity, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type ListArgsSpec, type ListArgsValidators, type ListArgsValue, type ListFilterOperators, type ListOrderByEntry, type ListWhere, type LunoraBuilders, LunoraEnvError, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskRegistry, type MaskStrategy, type Middleware, type MiddlewareContext, type MiddlewareNext, type MigrationCtx, type MigrationDefinition, type MigrationDocument, type MigrationReader, type MigrationTransform, type ModuleConfig, type ModuleDefinition, type MutationBuilder, type MutationCtx, type MutatorDefinition, type OnDeleteAction, type OneRelation, type OrmLike, DEFAULT_TTL_MS as PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, type Permission, type Plugin, type Policy, type PrefixedTables, type PresenceComponent, type PresenceFunctions, type PresenceMember, type ProtectPublicOptions, type QueryBuilder, type QueryCtx, type RankIndexDefinition, type RankIndexOptions, type ReactorHandler, type ReactorOutcome, type ReactorSelect, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredMutator, type RegisteredQuery, type RegisteredReactor, type RegisteredShape, type RegisteredStream, type RegisteredWhisperAuthorizer, type RelationBuilder, type RelationDefinition, type RlsOptions, type RlsReadRegistry, type Role, type Schema, type SchemaExtension, type ShapeDefinition, type ShapeGuardDeclaration, type ShapeReadWhereRequest, type ShardInitEvent, type ShardInitHandler, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, type StorageServeAuthorizer, type StorageServeAuthzContext, type TableBuilder, type TableDefinition, type TerminalKind, type TriggerBuilder, type TriggerDefinition, type TypedDefinePolicyInput, VERSION, type VectorEmbedder, type VectorIndexDefinition, type VectorIndexOptions, type VectorMetric, type VectorizeOptions, type WhereInput, type WhisperAuthorizeHandler, type WhisperEvent, actionCacheExtension, allowAll, asBucketStorage, assertShapesDeclareReadPolicies, beginDeferredDeletes, beginDeferredSchedules, bindOrm, bindTableFacade, buildMaskRegistry, buildRlsReadRegistry, cacheKeyFor, clampLimit, composePluginMiddleware, composeShapeReadWhere, createPolicyDsl, createSecrets, defineActionCache, defineAggregateIndex, defineComponent, defineDocumentHistory, defineEnv, defineIdentity, defineListArgs, defineMigration, defineModule, defineMutator, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineShape, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, deny, documentHistoryExtension, flushDeferredDeletes, httpAction, httpRoute, httpRouter, indexFieldsFromSchema, initLunora, installPlugins, isDeny, isPerDispatchMiddleware, isSafeHeaderValue, mask, mergeSchemaExtension, onConnect, onDisconnect, onQueryChange, onShardInit, onWhisper, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules, tagPerDispatchMiddleware, toWhereInput, withDeferredDeletes, withDeferredSchedules };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{ACTION_CACHE_DEFAULT_TTL_MS as t,ACTION_CACHE_TABLE as n,actionCacheExtension as i,cacheKeyFor as a,defineActionCache as f}from"./packem_shared/ACTION_CACHE_DEFAULT_TTL_MS-DHpfdhmu.mjs";import{initLunora as d}from"./packem_shared/initLunora-DAbEYdSo.mjs";import{isPerDispatchMiddleware as m,tagPerDispatchMiddleware as x}from"./packem_shared/isPerDispatchMiddleware-DDQPatSm.mjs";import{createSecrets as l}from"./packem_shared/createSecrets-D6rLB42U.mjs";import{beginDeferredDeletes as h,flushDeferredDeletes as S,withDeferredDeletes as u}from"./packem_shared/beginDeferredDeletes-DhwFBbvs.mjs";import{beginDeferredSchedules as T,withDeferredSchedules as g}from"./packem_shared/beginDeferredSchedules-DJ6U4iq5.mjs";import{DOCUMENT_HISTORY_REDACTED_FIELDS as R,DOCUMENT_HISTORY_TABLE as _,defineDocumentHistory as L,documentHistoryExtension as C}from"./packem_shared/DOCUMENT_HISTORY_REDACTED_FIELDS-DAfomt5Q.mjs";import{LunoraEnvError as P,defineEnv as M,redactSecrets as b}from"./packem_shared/LunoraEnvError-A5I-PzMh.mjs";import{bindOrm as F,bindTableFacade as O}from"./packem_shared/bindOrm-D_hFUjmr.mjs";import{httpAction as N,httpRoute as w,httpRouter as U,isSafeHeaderValue as k}from"./packem_shared/httpAction-DFVhrm8u.mjs";import{serveStorageObject as B}from"./packem_shared/serveStorageObject-9mdw0nyU.mjs";import{defineIdentity as W}from"./packem_shared/defineIdentity-DwkNKwYa.mjs";import{onConnect as Y,onDisconnect as J,onShardInit as K}from"./packem_shared/onConnect-BLRoOpv2.mjs";import{DEFAULT_LIMIT as X,DEFAULT_MAX_LIMIT as q,clampLimit as z,defineListArgs as G}from"./packem_shared/DEFAULT_LIMIT-pT_tV8R0.mjs";import{defineMigration as $}from"./packem_shared/defineMigration-CXOS0Bvq.mjs";import{defineMutator as re}from"./packem_shared/defineMutator-DKy8UtbB.mjs";import{c as te,d as ne,a as ie,b as ae,e as fe,f as se,g as de,h as pe,i as me,j as xe,k as ce,m as le}from"./packem_shared/plugin-DRIqze14.mjs";import{PRESENCE_DEFAULT_TTL_MS as he,PRESENCE_TABLE as Se,definePresence as ue,presenceExtension as De}from"./packem_shared/PRESENCE_DEFAULT_TTL_MS-DObDBz6_.mjs";import{protectPublic as ge}from"./packem_shared/protectPublic-BUYCMZZB.mjs";import{onQueryChange as Re}from"./packem_shared/onQueryChange-CatdYnH5.mjs";import{defineShape as Le}from"./packem_shared/defineShape-CbHQpfYD.mjs";import{anyApi as Ie}from"./types.mjs";import{onWhisper as Me}from"./packem_shared/onWhisper-CfDbFLQh.mjs";import{LunoraError as ye}from"@lunora/errors";import{cronJobs as Oe}from"@lunora/scheduler";import{ValidationError as Ne,v as we}from"@lunora/values";import{allowAll as ke,deny as ve,isDeny as Be,toWhereInput as Ve}from"./packem_shared/allowAll-DkRAgItV.mjs";import{asBucketStorage as je}from"./packem_shared/asBucketStorage-DoGYOjq3.mjs";import{assertShapesDeclareReadPolicies as Je,buildRlsReadRegistry as Ke,composeShapeReadWhere as Qe}from"./packem_shared/assertShapesDeclareReadPolicies-d9t7YZ7U.mjs";import{buildMaskRegistry as qe}from"./packem_shared/buildMaskRegistry-DpWMtalG.mjs";import{createPolicyDsl as Ge,definePermission as Ze,definePolicies as $e,definePolicy as er,defineRole as rr}from"./packem_shared/createPolicyDsl-BZa6SqLJ.mjs";import{defineStorageRule as tr,defineStorageRules as nr}from"./packem_shared/defineStorageRule-Dv4nJE0H.mjs";import{mask as ar}from"./packem_shared/mask-DrapWB_J.mjs";import{r as sr}from"./packem_shared/middleware-ChNz4wOv.mjs";import{storageRules as pr}from"./packem_shared/storageRules-DSmSbQqS.mjs";const e="0.0.0";export{t as ACTION_CACHE_DEFAULT_TTL_MS,n as ACTION_CACHE_TABLE,X as DEFAULT_LIMIT,q as DEFAULT_MAX_LIMIT,R as DOCUMENT_HISTORY_REDACTED_FIELDS,_ as DOCUMENT_HISTORY_TABLE,P as LunoraEnvError,ye as LunoraError,he as PRESENCE_DEFAULT_TTL_MS,Se as PRESENCE_TABLE,e as VERSION,Ne as ValidationError,i as actionCacheExtension,ke as allowAll,Ie as anyApi,je as asBucketStorage,Je as assertShapesDeclareReadPolicies,h as beginDeferredDeletes,T as beginDeferredSchedules,F as bindOrm,O as bindTableFacade,qe as buildMaskRegistry,Ke as buildRlsReadRegistry,a as cacheKeyFor,z as clampLimit,te as composePluginMiddleware,Qe as composeShapeReadWhere,Ge as createPolicyDsl,l as createSecrets,Oe as cronJobs,f as defineActionCache,ne as defineAggregateIndex,ie as defineComponent,L as defineDocumentHistory,M as defineEnv,W as defineIdentity,G as defineListArgs,$ as defineMigration,re as defineMutator,Ze as definePermission,ae as definePlugin,$e as definePolicies,er as definePolicy,ue as definePresence,fe as defineRankIndex,rr as defineRole,se as defineSchema,de as defineSchemaExtension,Le as defineShape,tr as defineStorageRule,nr as defineStorageRules,pe as defineTable,me as defineVectorIndex,ve as deny,C as documentHistoryExtension,S as flushDeferredDeletes,N as httpAction,w as httpRoute,U as httpRouter,xe as indexFieldsFromSchema,d as initLunora,ce as installPlugins,Be as isDeny,m as isPerDispatchMiddleware,k as isSafeHeaderValue,ar as mask,le as mergeSchemaExtension,Y as onConnect,J as onDisconnect,Re as onQueryChange,K as onShardInit,Me as onWhisper,De as presenceExtension,ge as protectPublic,b as redactSecrets,sr as rls,B as serveStorageObject,pr as storageRules,x as tagPerDispatchMiddleware,Ve as toWhereInput,we as v,u as withDeferredDeletes,g as withDeferredSchedules};
1
+ import{ACTION_CACHE_DEFAULT_TTL_MS as t,ACTION_CACHE_TABLE as n,actionCacheExtension as i,cacheKeyFor as a,defineActionCache as f}from"./packem_shared/ACTION_CACHE_DEFAULT_TTL_MS-DHpfdhmu.mjs";import{initLunora as d}from"./packem_shared/initLunora-DAbEYdSo.mjs";import{isPerDispatchMiddleware as m,tagPerDispatchMiddleware as x}from"./packem_shared/isPerDispatchMiddleware-DDQPatSm.mjs";import{createSecrets as l}from"./packem_shared/createSecrets-D6rLB42U.mjs";import{beginDeferredDeletes as h,flushDeferredDeletes as u,withDeferredDeletes as S}from"./packem_shared/beginDeferredDeletes-DhwFBbvs.mjs";import{beginDeferredSchedules as T,withDeferredSchedules as g}from"./packem_shared/beginDeferredSchedules-DJ6U4iq5.mjs";import{DOCUMENT_HISTORY_REDACTED_FIELDS as R,DOCUMENT_HISTORY_TABLE as _,defineDocumentHistory as L,documentHistoryExtension as C}from"./packem_shared/DOCUMENT_HISTORY_REDACTED_FIELDS-DAfomt5Q.mjs";import{LunoraEnvError as M,defineEnv as P,redactSecrets as b}from"./packem_shared/LunoraEnvError-A5I-PzMh.mjs";import{bindOrm as F,bindTableFacade as O}from"./packem_shared/bindOrm-D_hFUjmr.mjs";import{httpAction as N,httpRoute as w,httpRouter as U,isSafeHeaderValue as k}from"./packem_shared/httpAction-DFVhrm8u.mjs";import{serveStorageObject as B}from"./packem_shared/serveStorageObject-9mdw0nyU.mjs";import{defineIdentity as W}from"./packem_shared/defineIdentity-DwkNKwYa.mjs";import{onConnect as Y,onDisconnect as J,onShardInit as K}from"./packem_shared/onConnect-BLRoOpv2.mjs";import{DEFAULT_LIMIT as X,DEFAULT_MAX_LIMIT as q,clampLimit as z,defineListArgs as G}from"./packem_shared/DEFAULT_LIMIT-pT_tV8R0.mjs";import{defineMigration as $}from"./packem_shared/defineMigration-CXOS0Bvq.mjs";import{defineModule as re}from"./packem_shared/defineModule-OecXWM3U.mjs";import{defineMutator as te}from"./packem_shared/defineMutator-DKy8UtbB.mjs";import{c as ie,d as ae,a as fe,b as se,e as de,f as pe,g as me,h as xe,i as ce,j as le,k as Ee,m as he}from"./packem_shared/plugin-DRIqze14.mjs";import{PRESENCE_DEFAULT_TTL_MS as Se,PRESENCE_TABLE as De,definePresence as Te,presenceExtension as ge}from"./packem_shared/PRESENCE_DEFAULT_TTL_MS-DObDBz6_.mjs";import{protectPublic as Re}from"./packem_shared/protectPublic-BUYCMZZB.mjs";import{onQueryChange as Le}from"./packem_shared/onQueryChange-CatdYnH5.mjs";import{defineShape as Ie}from"./packem_shared/defineShape-CbHQpfYD.mjs";import{anyApi as Pe}from"./types.mjs";import{onWhisper as ye}from"./packem_shared/onWhisper-CfDbFLQh.mjs";import{LunoraError as Oe}from"@lunora/errors";import{cronJobs as Ne}from"@lunora/scheduler";import{ValidationError as Ue,v as ke}from"@lunora/values";import{allowAll as Be,deny as Ve,isDeny as We,toWhereInput as je}from"./packem_shared/allowAll-DkRAgItV.mjs";import{asBucketStorage as Je}from"./packem_shared/asBucketStorage-DoGYOjq3.mjs";import{assertShapesDeclareReadPolicies as Qe,buildRlsReadRegistry as Xe,composeShapeReadWhere as qe}from"./packem_shared/assertShapesDeclareReadPolicies-d9t7YZ7U.mjs";import{buildMaskRegistry as Ge}from"./packem_shared/buildMaskRegistry-DpWMtalG.mjs";import{createPolicyDsl as $e,definePermission as er,definePolicies as rr,definePolicy as or,defineRole as tr}from"./packem_shared/createPolicyDsl-BZa6SqLJ.mjs";import{defineStorageRule as ir,defineStorageRules as ar}from"./packem_shared/defineStorageRule-Dv4nJE0H.mjs";import{mask as sr}from"./packem_shared/mask-DrapWB_J.mjs";import{r as pr}from"./packem_shared/middleware-ChNz4wOv.mjs";import{storageRules as xr}from"./packem_shared/storageRules-DSmSbQqS.mjs";const e="0.0.0";export{t as ACTION_CACHE_DEFAULT_TTL_MS,n as ACTION_CACHE_TABLE,X as DEFAULT_LIMIT,q as DEFAULT_MAX_LIMIT,R as DOCUMENT_HISTORY_REDACTED_FIELDS,_ as DOCUMENT_HISTORY_TABLE,M as LunoraEnvError,Oe as LunoraError,Se as PRESENCE_DEFAULT_TTL_MS,De as PRESENCE_TABLE,e as VERSION,Ue as ValidationError,i as actionCacheExtension,Be as allowAll,Pe as anyApi,Je as asBucketStorage,Qe as assertShapesDeclareReadPolicies,h as beginDeferredDeletes,T as beginDeferredSchedules,F as bindOrm,O as bindTableFacade,Ge as buildMaskRegistry,Xe as buildRlsReadRegistry,a as cacheKeyFor,z as clampLimit,ie as composePluginMiddleware,qe as composeShapeReadWhere,$e as createPolicyDsl,l as createSecrets,Ne as cronJobs,f as defineActionCache,ae as defineAggregateIndex,fe as defineComponent,L as defineDocumentHistory,P as defineEnv,W as defineIdentity,G as defineListArgs,$ as defineMigration,re as defineModule,te as defineMutator,er as definePermission,se as definePlugin,rr as definePolicies,or as definePolicy,Te as definePresence,de as defineRankIndex,tr as defineRole,pe as defineSchema,me as defineSchemaExtension,Ie as defineShape,ir as defineStorageRule,ar as defineStorageRules,xe as defineTable,ce as defineVectorIndex,Ve as deny,C as documentHistoryExtension,u as flushDeferredDeletes,N as httpAction,w as httpRoute,U as httpRouter,le as indexFieldsFromSchema,d as initLunora,Ee as installPlugins,We as isDeny,m as isPerDispatchMiddleware,k as isSafeHeaderValue,sr as mask,he as mergeSchemaExtension,Y as onConnect,J as onDisconnect,Le as onQueryChange,K as onShardInit,ye as onWhisper,ge as presenceExtension,Re as protectPublic,b as redactSecrets,pr as rls,B as serveStorageObject,xr as storageRules,x as tagPerDispatchMiddleware,je as toWhereInput,ke as v,S as withDeferredDeletes,g as withDeferredSchedules};
@@ -0,0 +1 @@
1
+ const t=(e={})=>{if(e.description!==void 0&&typeof e.description!="string")throw new TypeError("defineModule: `description` must be a string when provided");if(e.tables!==void 0&&(!Array.isArray(e.tables)||e.tables.some(r=>typeof r!="string"||r.length===0)))throw new TypeError("defineModule: `tables` must be an array of non-empty table names when provided");return{...e,isLunoraModule:!0}};export{t as defineModule};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/server",
3
- "version": "1.0.0-alpha.164",
3
+ "version": "1.0.0-alpha.165",
4
4
  "description": "Server primitives for Lunora: defineSchema, defineTable, query, mutation, and action",
5
5
  "keywords": [
6
6
  "backend",