@lunora/server 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +31 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.mjs +3 -2
- package/dist/packem_shared/{PRESENCE_DEFAULT_TTL_MS-UQuUI5sV.mjs → PRESENCE_DEFAULT_TTL_MS-BgBQsqQ-.mjs} +1 -1
- package/dist/packem_shared/createSecrets-TsIP9lOa.mjs +55 -0
- package/dist/packem_shared/{defineAggregateIndex-B20MIOmj.mjs → defineAggregateIndex-C2gT1GzM.mjs} +3 -0
- package/dist/types.d.mts +41 -2
- package/dist/types.d.ts +41 -2
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Validator, Infer, v } from '@lunora/values';
|
|
2
2
|
export { type ColumnValidator, type Id, type Infer, ValidationError, type Validator, type ValidatorKind, v } from '@lunora/values';
|
|
3
|
-
import { ArgsValidator, InferArgs, RegisteredAction, ActionCtx, MutationCtx, RegisteredMutation, QueryCtx, RegisteredQuery, RegisteredStream, FunctionKind, LifecycleEvent, RegisteredLifecycleHook, TableDefinition, RegisteredFunction, VectorIndexDefinition, Schema, AggregateOp, RelationDefinition, GlobalBackend, OnDeleteAction, TriggerBuilder, TriggerDefinition, VectorEmbedder, VectorMetric, AggregateIndexDefinition, RankIndexDefinition } from "./types.mjs";
|
|
3
|
+
import { ArgsValidator, InferArgs, RegisteredAction, ActionCtx, MutationCtx, RegisteredMutation, QueryCtx, RegisteredQuery, RegisteredStream, FunctionKind, Secrets, LifecycleEvent, RegisteredLifecycleHook, TableDefinition, RegisteredFunction, VectorIndexDefinition, Schema, AggregateOp, DurableObjectJurisdiction, RelationDefinition, GlobalBackend, OnDeleteAction, TriggerBuilder, TriggerDefinition, VectorEmbedder, VectorMetric, AggregateIndexDefinition, RankIndexDefinition } from "./types.mjs";
|
|
4
4
|
export { type AnyApi, type AuthState, type DatabaseReader, type DatabaseWriter, type FunctionVisibility, type IndexDefinition, type IndexRangeBuilder, type LifecycleEventKind, type LunoraLogger, type PaginationOptions, type PaginationResult, type RankSortKey, type ReadOnlyStorage, type ScheduledFunctionDoc, type ScheduledJob, type Scheduler, type SearchFilterBuilder, type SearchIndexDefinition, type ShardMode, type Storage, type StorageMetadata, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemTableName, type TableReader, type TableVectorIndex, type TriggerAggregateOptions, type TriggerCtx, type TriggerDatabase, type TriggerDeleteEvent, type TriggerEvent, type TriggerGroupByEntry, type TriggerGroupByOptions, type TriggerHandler, type TriggerInsertEvent, type TriggerOp, type TriggerQueryArgs, type TriggerQueryPage, type TriggerRankOptions, type TriggerRankPageOptions, type TriggerRankResult, type TriggerRow, type TriggerTiming, type TriggerUpdateEvent, type VectorMatch, type VectorMatches, type VectorQueryInput, type VectorRecord, type VectorSearch, type VectorSearchReader, type VectorUpsertInput, type WorkflowCreateOptions, type WorkflowHandle, type WorkflowInstance, type WorkflowInstanceStatus, type WorkflowStatusResult, type Workflows, anyApi } from "./types.mjs";
|
|
5
5
|
import { Context, Hono } from 'hono';
|
|
6
6
|
import { b as Permission, R as Role, T as TypedDefinePolicyInput, a as Policy, D as DefinePolicyInput, W as WhereInput, c as RlsOptions } from "./packem_shared/types.d-DmvyEMD6.mjs";
|
|
@@ -187,6 +187,13 @@ declare const initLunora: {
|
|
|
187
187
|
dataModel: <DataModel>() => DataModelInit<DataModel>;
|
|
188
188
|
};
|
|
189
189
|
/**
|
|
190
|
+
* Build the `ctx.secrets` reader from the worker `env`. `get(name)` resolves
|
|
191
|
+
* `env[name].get()` — the `secrets_store_secrets[]` binding of that name. An
|
|
192
|
+
* absent or non-Secrets-Store binding throws a directed error pointing at the
|
|
193
|
+
* wrangler config; the lookup is lazy, so an unused secret never resolves.
|
|
194
|
+
*/
|
|
195
|
+
declare const createSecrets: (env: Record<string, unknown>) => Secrets;
|
|
196
|
+
/**
|
|
190
197
|
* Redact secrets from a free-form message. Masks, in order: any quoted value
|
|
191
198
|
* whose contents look like a credential (so a value surfaced as `received string
|
|
192
199
|
* "sk_live_…"` is masked even though the surrounding text is not a token); a
|
|
@@ -1309,6 +1316,28 @@ type ExtendableSchema<T extends Record<string, TableDefinition>> = {
|
|
|
1309
1316
|
readonly key: Key;
|
|
1310
1317
|
}) => ExtendableSchema<PrefixedTables<X, Key> & T>;
|
|
1311
1318
|
/**
|
|
1319
|
+
* Pin every Durable Object the app reaches — shards, fan-out, subscriptions,
|
|
1320
|
+
* the scheduler, and `ctx.containers` — to a Cloudflare data-residency
|
|
1321
|
+
* jurisdiction (`"eu"`, `"us"`, `"fedramp"`). Codegen reads this off the
|
|
1322
|
+
* schema and emits it into the generated worker's `createWorker({ jurisdiction })`
|
|
1323
|
+
* (and `ctx.scheduler` / `ctx.containers`). Non-mutating: returns a fresh
|
|
1324
|
+
* `ExtendableSchema`, so it composes with `.rls(...)` / `.extend(...)` in any order.
|
|
1325
|
+
*
|
|
1326
|
+
* ⚠️ **Set this once, before your first deploy — changing or removing it
|
|
1327
|
+
* strands data.** A Durable Object name maps to a *different* ID in each
|
|
1328
|
+
* jurisdiction, so toggling this on an existing app makes every shard, scheduler
|
|
1329
|
+
* job, and session DO resolve to a NEW, empty DO; the previous data stays in the
|
|
1330
|
+
* old jurisdiction's DOs and is no longer reachable. There is no in-place
|
|
1331
|
+
* migration — you would have to export from the old jurisdiction and import
|
|
1332
|
+
* into the new one.
|
|
1333
|
+
*
|
|
1334
|
+
* Note: this pins **DO-backed** state only. D1-backed state — `.global()`
|
|
1335
|
+
* tables and `@lunora/auth` sessions alike — is governed by D1's own location
|
|
1336
|
+
* settings, not this option.
|
|
1337
|
+
* @see https://developers.cloudflare.com/durable-objects/reference/data-location/
|
|
1338
|
+
*/
|
|
1339
|
+
jurisdiction: (jurisdiction: DurableObjectJurisdiction) => ExtendableSchema<T>;
|
|
1340
|
+
/**
|
|
1312
1341
|
* Turn on secure-by-default RLS for the whole schema. Every table is then
|
|
1313
1342
|
* protected — the DO/D1 write path denies raw, non-RLS `ctx.db` access, so a
|
|
1314
1343
|
* procedure that forgets `.use(rls(...))` fails closed. Opt a table out with
|
|
@@ -1788,4 +1817,4 @@ interface StorageContextIn {
|
|
|
1788
1817
|
}
|
|
1789
1818
|
declare const storageRules: <Context extends StorageContextIn = StorageContextIn>(rules: ReadonlyArray<StorageRule<Context>>, options?: StorageRulesOptions) => Middleware<Context, Context>;
|
|
1790
1819
|
declare const VERSION = "0.0.0";
|
|
1791
|
-
export { type ActionBuilder, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, type DataModelInit, type DefineComponentOptions, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpStreamHandlerOptions, type InferArgs, type InferEnv, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type LunoraBuilders, LunoraEnvError, LunoraError, type LunoraErrorCode, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskStrategy, type Middleware, type MiddlewareNext, type MigrationDefinition, type MigrationDocument, type MigrationTransform, type MutationBuilder, type MutationCtx, 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 RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationBuilder, type RelationDefinition, type RlsOptions, type Role, type Schema, type SchemaExtension, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, 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, asBucketStorage, bindOrm, bindTableFacade, composePluginMiddleware, createPolicyDsl, defineAggregateIndex, defineComponent, defineEnv, defineMigration, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, httpAction, httpRoute, httpRouter, initLunora, installPlugins, mask, mergeSchemaExtension, onConnect, onDisconnect, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules };
|
|
1820
|
+
export { type ActionBuilder, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, type DataModelInit, type DefineComponentOptions, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type DurableObjectJurisdiction, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpStreamHandlerOptions, type InferArgs, type InferEnv, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type LunoraBuilders, LunoraEnvError, LunoraError, type LunoraErrorCode, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskStrategy, type Middleware, type MiddlewareNext, type MigrationDefinition, type MigrationDocument, type MigrationTransform, type MutationBuilder, type MutationCtx, 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 RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationBuilder, type RelationDefinition, type RlsOptions, type Role, type Schema, type SchemaExtension, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, 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, asBucketStorage, bindOrm, bindTableFacade, composePluginMiddleware, createPolicyDsl, createSecrets, defineAggregateIndex, defineComponent, defineEnv, defineMigration, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, httpAction, httpRoute, httpRouter, initLunora, installPlugins, mask, mergeSchemaExtension, onConnect, onDisconnect, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Validator, Infer, v } from '@lunora/values';
|
|
2
2
|
export { type ColumnValidator, type Id, type Infer, ValidationError, type Validator, type ValidatorKind, v } from '@lunora/values';
|
|
3
|
-
import { ArgsValidator, InferArgs, RegisteredAction, ActionCtx, MutationCtx, RegisteredMutation, QueryCtx, RegisteredQuery, RegisteredStream, FunctionKind, LifecycleEvent, RegisteredLifecycleHook, TableDefinition, RegisteredFunction, VectorIndexDefinition, Schema, AggregateOp, RelationDefinition, GlobalBackend, OnDeleteAction, TriggerBuilder, TriggerDefinition, VectorEmbedder, VectorMetric, AggregateIndexDefinition, RankIndexDefinition } from "./types.js";
|
|
3
|
+
import { ArgsValidator, InferArgs, RegisteredAction, ActionCtx, MutationCtx, RegisteredMutation, QueryCtx, RegisteredQuery, RegisteredStream, FunctionKind, Secrets, LifecycleEvent, RegisteredLifecycleHook, TableDefinition, RegisteredFunction, VectorIndexDefinition, Schema, AggregateOp, DurableObjectJurisdiction, RelationDefinition, GlobalBackend, OnDeleteAction, TriggerBuilder, TriggerDefinition, VectorEmbedder, VectorMetric, AggregateIndexDefinition, RankIndexDefinition } from "./types.js";
|
|
4
4
|
export { type AnyApi, type AuthState, type DatabaseReader, type DatabaseWriter, type FunctionVisibility, type IndexDefinition, type IndexRangeBuilder, type LifecycleEventKind, type LunoraLogger, type PaginationOptions, type PaginationResult, type RankSortKey, type ReadOnlyStorage, type ScheduledFunctionDoc, type ScheduledJob, type Scheduler, type SearchFilterBuilder, type SearchIndexDefinition, type ShardMode, type Storage, type StorageMetadata, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemTableName, type TableReader, type TableVectorIndex, type TriggerAggregateOptions, type TriggerCtx, type TriggerDatabase, type TriggerDeleteEvent, type TriggerEvent, type TriggerGroupByEntry, type TriggerGroupByOptions, type TriggerHandler, type TriggerInsertEvent, type TriggerOp, type TriggerQueryArgs, type TriggerQueryPage, type TriggerRankOptions, type TriggerRankPageOptions, type TriggerRankResult, type TriggerRow, type TriggerTiming, type TriggerUpdateEvent, type VectorMatch, type VectorMatches, type VectorQueryInput, type VectorRecord, type VectorSearch, type VectorSearchReader, type VectorUpsertInput, type WorkflowCreateOptions, type WorkflowHandle, type WorkflowInstance, type WorkflowInstanceStatus, type WorkflowStatusResult, type Workflows, anyApi } from "./types.js";
|
|
5
5
|
import { Context, Hono } from 'hono';
|
|
6
6
|
import { b as Permission, R as Role, T as TypedDefinePolicyInput, a as Policy, D as DefinePolicyInput, W as WhereInput, c as RlsOptions } from "./packem_shared/types.d-BDY0FYHK.js";
|
|
@@ -187,6 +187,13 @@ declare const initLunora: {
|
|
|
187
187
|
dataModel: <DataModel>() => DataModelInit<DataModel>;
|
|
188
188
|
};
|
|
189
189
|
/**
|
|
190
|
+
* Build the `ctx.secrets` reader from the worker `env`. `get(name)` resolves
|
|
191
|
+
* `env[name].get()` — the `secrets_store_secrets[]` binding of that name. An
|
|
192
|
+
* absent or non-Secrets-Store binding throws a directed error pointing at the
|
|
193
|
+
* wrangler config; the lookup is lazy, so an unused secret never resolves.
|
|
194
|
+
*/
|
|
195
|
+
declare const createSecrets: (env: Record<string, unknown>) => Secrets;
|
|
196
|
+
/**
|
|
190
197
|
* Redact secrets from a free-form message. Masks, in order: any quoted value
|
|
191
198
|
* whose contents look like a credential (so a value surfaced as `received string
|
|
192
199
|
* "sk_live_…"` is masked even though the surrounding text is not a token); a
|
|
@@ -1309,6 +1316,28 @@ type ExtendableSchema<T extends Record<string, TableDefinition>> = {
|
|
|
1309
1316
|
readonly key: Key;
|
|
1310
1317
|
}) => ExtendableSchema<PrefixedTables<X, Key> & T>;
|
|
1311
1318
|
/**
|
|
1319
|
+
* Pin every Durable Object the app reaches — shards, fan-out, subscriptions,
|
|
1320
|
+
* the scheduler, and `ctx.containers` — to a Cloudflare data-residency
|
|
1321
|
+
* jurisdiction (`"eu"`, `"us"`, `"fedramp"`). Codegen reads this off the
|
|
1322
|
+
* schema and emits it into the generated worker's `createWorker({ jurisdiction })`
|
|
1323
|
+
* (and `ctx.scheduler` / `ctx.containers`). Non-mutating: returns a fresh
|
|
1324
|
+
* `ExtendableSchema`, so it composes with `.rls(...)` / `.extend(...)` in any order.
|
|
1325
|
+
*
|
|
1326
|
+
* ⚠️ **Set this once, before your first deploy — changing or removing it
|
|
1327
|
+
* strands data.** A Durable Object name maps to a *different* ID in each
|
|
1328
|
+
* jurisdiction, so toggling this on an existing app makes every shard, scheduler
|
|
1329
|
+
* job, and session DO resolve to a NEW, empty DO; the previous data stays in the
|
|
1330
|
+
* old jurisdiction's DOs and is no longer reachable. There is no in-place
|
|
1331
|
+
* migration — you would have to export from the old jurisdiction and import
|
|
1332
|
+
* into the new one.
|
|
1333
|
+
*
|
|
1334
|
+
* Note: this pins **DO-backed** state only. D1-backed state — `.global()`
|
|
1335
|
+
* tables and `@lunora/auth` sessions alike — is governed by D1's own location
|
|
1336
|
+
* settings, not this option.
|
|
1337
|
+
* @see https://developers.cloudflare.com/durable-objects/reference/data-location/
|
|
1338
|
+
*/
|
|
1339
|
+
jurisdiction: (jurisdiction: DurableObjectJurisdiction) => ExtendableSchema<T>;
|
|
1340
|
+
/**
|
|
1312
1341
|
* Turn on secure-by-default RLS for the whole schema. Every table is then
|
|
1313
1342
|
* protected — the DO/D1 write path denies raw, non-RLS `ctx.db` access, so a
|
|
1314
1343
|
* procedure that forgets `.use(rls(...))` fails closed. Opt a table out with
|
|
@@ -1788,4 +1817,4 @@ interface StorageContextIn {
|
|
|
1788
1817
|
}
|
|
1789
1818
|
declare const storageRules: <Context extends StorageContextIn = StorageContextIn>(rules: ReadonlyArray<StorageRule<Context>>, options?: StorageRulesOptions) => Middleware<Context, Context>;
|
|
1790
1819
|
declare const VERSION = "0.0.0";
|
|
1791
|
-
export { type ActionBuilder, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, type DataModelInit, type DefineComponentOptions, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpStreamHandlerOptions, type InferArgs, type InferEnv, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type LunoraBuilders, LunoraEnvError, LunoraError, type LunoraErrorCode, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskStrategy, type Middleware, type MiddlewareNext, type MigrationDefinition, type MigrationDocument, type MigrationTransform, type MutationBuilder, type MutationCtx, 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 RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationBuilder, type RelationDefinition, type RlsOptions, type Role, type Schema, type SchemaExtension, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, 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, asBucketStorage, bindOrm, bindTableFacade, composePluginMiddleware, createPolicyDsl, defineAggregateIndex, defineComponent, defineEnv, defineMigration, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, httpAction, httpRoute, httpRouter, initLunora, installPlugins, mask, mergeSchemaExtension, onConnect, onDisconnect, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules };
|
|
1820
|
+
export { type ActionBuilder, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, type DataModelInit, type DefineComponentOptions, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineStorageRuleInput, type DurableObjectJurisdiction, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpStreamHandlerOptions, type InferArgs, type InferEnv, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type LunoraBuilders, LunoraEnvError, LunoraError, type LunoraErrorCode, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskStrategy, type Middleware, type MiddlewareNext, type MigrationDefinition, type MigrationDocument, type MigrationTransform, type MutationBuilder, type MutationCtx, 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 RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationBuilder, type RelationDefinition, type RlsOptions, type Role, type Schema, type SchemaExtension, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, 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, asBucketStorage, bindOrm, bindTableFacade, composePluginMiddleware, createPolicyDsl, createSecrets, defineAggregateIndex, defineComponent, defineEnv, defineMigration, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineSchema, defineSchemaExtension, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, httpAction, httpRoute, httpRouter, initLunora, installPlugins, mask, mergeSchemaExtension, onConnect, onDisconnect, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject, storageRules };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as asBucketStorage } from './packem_shared/asBucketStorage-Cnxd9y2q.mjs';
|
|
2
2
|
export { initLunora } from './packem_shared/initLunora-CATvPsVt.mjs';
|
|
3
|
+
export { createSecrets } from './packem_shared/createSecrets-TsIP9lOa.mjs';
|
|
3
4
|
export { LunoraEnvError, defineEnv, redactSecrets } from './packem_shared/LunoraEnvError-DjFkpkSP.mjs';
|
|
4
5
|
export { LunoraError } from './packem_shared/LunoraError-DhggBJZF.mjs';
|
|
5
6
|
export { bindOrm, bindTableFacade } from './packem_shared/bindOrm-Ce57S3N9.mjs';
|
|
@@ -7,9 +8,9 @@ export { httpAction, httpRoute, httpRouter, serveStorageObject } from './packem_
|
|
|
7
8
|
export { onConnect, onDisconnect } from './packem_shared/onConnect-CIPXKPyw.mjs';
|
|
8
9
|
export { defineMigration } from './packem_shared/defineMigration-CAJLr6fx.mjs';
|
|
9
10
|
export { composePluginMiddleware, defineComponent, definePlugin, defineSchemaExtension, installPlugins, mergeSchemaExtension } from './packem_shared/composePluginMiddleware-Ck5_TUO8.mjs';
|
|
10
|
-
export { PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, definePresence, presenceExtension } from './packem_shared/PRESENCE_DEFAULT_TTL_MS-
|
|
11
|
+
export { PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, definePresence, presenceExtension } from './packem_shared/PRESENCE_DEFAULT_TTL_MS-BgBQsqQ-.mjs';
|
|
11
12
|
export { protectPublic } from './packem_shared/protectPublic-BjFkQ_Or.mjs';
|
|
12
|
-
export { defineAggregateIndex, defineRankIndex, defineSchema, defineTable, defineVectorIndex } from './packem_shared/defineAggregateIndex-
|
|
13
|
+
export { defineAggregateIndex, defineRankIndex, defineSchema, defineTable, defineVectorIndex } from './packem_shared/defineAggregateIndex-C2gT1GzM.mjs';
|
|
13
14
|
export { anyApi } from './types.mjs';
|
|
14
15
|
export { cronJobs } from '@lunora/scheduler';
|
|
15
16
|
export { ValidationError, v } from '@lunora/values';
|
|
@@ -3,7 +3,7 @@ import { initLunora } from './initLunora-CATvPsVt.mjs';
|
|
|
3
3
|
import { LunoraError } from './LunoraError-DhggBJZF.mjs';
|
|
4
4
|
import { onDisconnect } from './onConnect-CIPXKPyw.mjs';
|
|
5
5
|
import { defineSchemaExtension, defineComponent } from './composePluginMiddleware-Ck5_TUO8.mjs';
|
|
6
|
-
import { defineTable } from './defineAggregateIndex-
|
|
6
|
+
import { defineTable } from './defineAggregateIndex-C2gT1GzM.mjs';
|
|
7
7
|
|
|
8
8
|
const DEFAULT_TTL_MS = 3e4;
|
|
9
9
|
const MAX_DATA_BYTES = 4096;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const NON_SECRET_BINDING_METHODS = [
|
|
2
|
+
"put",
|
|
3
|
+
// KV / R2
|
|
4
|
+
"list",
|
|
5
|
+
// KV / R2
|
|
6
|
+
"delete",
|
|
7
|
+
// KV / R2
|
|
8
|
+
"getWithMetadata",
|
|
9
|
+
// KV
|
|
10
|
+
"head",
|
|
11
|
+
// R2
|
|
12
|
+
"createMultipartUpload",
|
|
13
|
+
// R2
|
|
14
|
+
"idFromName",
|
|
15
|
+
// Durable Object namespace
|
|
16
|
+
"newUniqueId",
|
|
17
|
+
// Durable Object namespace
|
|
18
|
+
"getByName",
|
|
19
|
+
// Durable Object namespace
|
|
20
|
+
"send",
|
|
21
|
+
// Queue producer
|
|
22
|
+
"sendBatch",
|
|
23
|
+
// Queue producer
|
|
24
|
+
"writeDataPoint",
|
|
25
|
+
// Analytics Engine dataset
|
|
26
|
+
"create",
|
|
27
|
+
// Workflows binding (get(id) + create/createBatch)
|
|
28
|
+
"createBatch"
|
|
29
|
+
// Workflows binding
|
|
30
|
+
];
|
|
31
|
+
const isSecretBinding = (value) => {
|
|
32
|
+
if (typeof value !== "object" || value === null) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const record = value;
|
|
36
|
+
if (typeof record.get !== "function") {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
return !NON_SECRET_BINDING_METHODS.some((method) => typeof record[method] === "function");
|
|
40
|
+
};
|
|
41
|
+
const createSecrets = (env) => {
|
|
42
|
+
return {
|
|
43
|
+
get: async (name) => {
|
|
44
|
+
const binding = env[name];
|
|
45
|
+
if (!isSecretBinding(binding)) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`ctx.secrets: no Secrets Store binding named "${name}". Add a \`secrets_store_secrets[]\` entry (binding "${name}", pointing at your store + secret) to wrangler.jsonc — \`ctx.secrets\` reads a Secrets Store binding, not a plain \`.dev.vars\` value.`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return binding.get();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { createSecrets };
|
package/dist/packem_shared/{defineAggregateIndex-B20MIOmj.mjs → defineAggregateIndex-C2gT1GzM.mjs}
RENAMED
|
@@ -205,6 +205,9 @@ const withExtend = (schema) => {
|
|
|
205
205
|
extend(extension) {
|
|
206
206
|
return withExtend(mergeSchemaExtension(schema, extension));
|
|
207
207
|
},
|
|
208
|
+
jurisdiction(_jurisdiction) {
|
|
209
|
+
return withExtend(schema);
|
|
210
|
+
},
|
|
208
211
|
rls(mode) {
|
|
209
212
|
return withExtend({ ...schema, rlsMode: mode });
|
|
210
213
|
}
|
package/dist/types.d.mts
CHANGED
|
@@ -5,6 +5,14 @@ type ArgsValidator = ValidatorMap;
|
|
|
5
5
|
type InferArgs<A extends ArgsValidator> = InferValidatorMap<A>;
|
|
6
6
|
/** Storage backend for a `.global()` table: D1 (default) or a Postgres/MySQL database via Cloudflare Hyperdrive (PlanetScale, Neon, …). */
|
|
7
7
|
type GlobalBackend = "d1" | "hyperdrive";
|
|
8
|
+
/**
|
|
9
|
+
* Cloudflare Durable Object data-residency jurisdiction declared via
|
|
10
|
+
* `defineSchema(...).jurisdiction("…")`. Restricts where every DO the app
|
|
11
|
+
* reaches runs and persists data (GDPR, FedRAMP, US data residency). Widening
|
|
12
|
+
* union — Cloudflare adds values over time.
|
|
13
|
+
* @see https://developers.cloudflare.com/durable-objects/reference/data-location/
|
|
14
|
+
*/
|
|
15
|
+
type DurableObjectJurisdiction = "eu" | "fedramp" | "us";
|
|
8
16
|
/** How a table is routed at runtime. */
|
|
9
17
|
type ShardMode = {
|
|
10
18
|
backend?: GlobalBackend;
|
|
@@ -628,6 +636,31 @@ interface Workflows {
|
|
|
628
636
|
/** Resolve the handle for a declared workflow by export name. */
|
|
629
637
|
get: <Params = Record<string, unknown>>(name: string) => WorkflowHandle<Params>;
|
|
630
638
|
}
|
|
639
|
+
/**
|
|
640
|
+
* Structural projection of workers-types' `SecretsStoreSecret` binding — the
|
|
641
|
+
* per-secret `secrets_store_secrets[]` binding whose `.get()` resolves the
|
|
642
|
+
* secret value (or throws if it does not exist). Mirrored structurally so the
|
|
643
|
+
* runtime resolves it without a workerd type dependency.
|
|
644
|
+
*/
|
|
645
|
+
interface SecretsStoreSecretLike {
|
|
646
|
+
get: () => Promise<string>;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* `ctx.secrets` — read account-level secrets bound via Cloudflare Secrets Store.
|
|
650
|
+
* A core built-in (always present on every context, like `ctx.log`): a binding
|
|
651
|
+
* named in wrangler's `secrets_store_secrets[]` is read by its binding name.
|
|
652
|
+
*
|
|
653
|
+
* ```ts
|
|
654
|
+
* const apiKey = await ctx.secrets.get("STRIPE_KEY");
|
|
655
|
+
* ```
|
|
656
|
+
*
|
|
657
|
+
* The lookup is async (the platform fetches and decrypts on first read);
|
|
658
|
+
* reading an undeclared name throws a directed error naming the bound secrets.
|
|
659
|
+
*/
|
|
660
|
+
interface Secrets {
|
|
661
|
+
/** Resolve a Secrets Store secret by its wrangler binding name. */
|
|
662
|
+
get: (name: string) => Promise<string>;
|
|
663
|
+
}
|
|
631
664
|
/** Lifecycle phase relative to the SQL write. */
|
|
632
665
|
type TriggerTiming = "after" | "before";
|
|
633
666
|
/** The CRUD operation a trigger reacts to. `patch` and `replace` both map to `update`. */
|
|
@@ -913,7 +946,7 @@ interface VectorRecord {
|
|
|
913
946
|
}
|
|
914
947
|
/**
|
|
915
948
|
* Read-only vector surface exposed on {@link QueryCtx}. Mirrors the read half
|
|
916
|
-
* of `@lunora/vectors`' `LunoraVectors` so the live adapter is assignable.
|
|
949
|
+
* of `@lunora/bindings/vectors`' `LunoraVectors` so the live adapter is assignable.
|
|
917
950
|
*/
|
|
918
951
|
interface VectorSearchReader {
|
|
919
952
|
getByIds: (indexName: string, ids: ReadonlyArray<string>) => Promise<ReadonlyArray<VectorRecord>>;
|
|
@@ -983,6 +1016,8 @@ interface QueryCtx {
|
|
|
983
1016
|
* Mirrors Convex's `ctx.runQuery`.
|
|
984
1017
|
*/
|
|
985
1018
|
readonly runQuery: <A extends ArgsValidator, R>(reference: RegisteredQuery<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1019
|
+
/** Read account-level secrets from Cloudflare Secrets Store; see {@link Secrets}. */
|
|
1020
|
+
readonly secrets: Secrets;
|
|
986
1021
|
readonly storage: ReadOnlyStorage;
|
|
987
1022
|
readonly vectors: VectorSearchReader;
|
|
988
1023
|
}
|
|
@@ -1023,6 +1058,8 @@ interface MutationCtx {
|
|
|
1023
1058
|
*/
|
|
1024
1059
|
readonly runQuery: <A extends ArgsValidator, R>(reference: RegisteredQuery<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1025
1060
|
readonly scheduler: Scheduler;
|
|
1061
|
+
/** Read account-level secrets from Cloudflare Secrets Store; see {@link Secrets}. */
|
|
1062
|
+
readonly secrets: Secrets;
|
|
1026
1063
|
readonly storage: ReadOnlyStorage;
|
|
1027
1064
|
readonly vectors: VectorSearch;
|
|
1028
1065
|
/** Start / resume / inspect durable workflows; see {@link Workflows}. */
|
|
@@ -1051,6 +1088,8 @@ interface ActionCtx {
|
|
|
1051
1088
|
readonly runMutation: <A extends ArgsValidator, R>(reference: RegisteredMutation<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1052
1089
|
readonly runQuery: <A extends ArgsValidator, R>(reference: RegisteredQuery<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1053
1090
|
readonly scheduler: Scheduler;
|
|
1091
|
+
/** Read account-level secrets from Cloudflare Secrets Store; see {@link Secrets}. */
|
|
1092
|
+
readonly secrets: Secrets;
|
|
1054
1093
|
readonly storage: Storage;
|
|
1055
1094
|
readonly vectors: VectorSearch;
|
|
1056
1095
|
/** Start / resume / inspect durable workflows; see {@link Workflows}. */
|
|
@@ -1062,4 +1101,4 @@ interface ActionCtx {
|
|
|
1062
1101
|
*/
|
|
1063
1102
|
type AnyApi = Record<string, Record<string, RegisteredFunction<ArgsValidator, unknown, FunctionKind>>>;
|
|
1064
1103
|
declare const anyApi: AnyApi;
|
|
1065
|
-
export { type ActionCtx, type AggregateIndexDefinition, type AggregateOp, type AnyApi, type ArgsValidator, type AuthState, type DatabaseReader, type DatabaseWriter, type FunctionKind, type FunctionVisibility, type GlobalBackend, type IndexDefinition, type IndexRangeBuilder, type InferArgs, type LifecycleEvent, type LifecycleEventKind, type LunoraLogger, type MutationCtx, type OnDeleteAction, type PaginationOptions, type PaginationResult, type QueryCtx, type RankIndexDefinition, type RankSortKey, type ReadOnlyStorage, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationDefinition, type ScheduledFunctionDoc, type ScheduledJob, type Scheduler, type Schema, type SearchFilterBuilder, type SearchIndexDefinition, type ShardMode, type Storage, type StorageMetadata, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemTableName, type TableDefinition, type TableReader, type TableVectorIndex, type TriggerAggregateOptions, type TriggerBuilder, type TriggerCtx, type TriggerDatabase, type TriggerDefinition, type TriggerDeleteEvent, type TriggerEvent, type TriggerGroupByEntry, type TriggerGroupByOptions, type TriggerHandler, type TriggerInsertEvent, type TriggerOp, type TriggerQueryArgs, type TriggerQueryPage, type TriggerRankOptions, type TriggerRankPageOptions, type TriggerRankResult, type TriggerRow, type TriggerTiming, type TriggerUpdateEvent, type VectorEmbedder, type VectorIndexDefinition, type VectorMatch, type VectorMatches, type VectorMetric, type VectorQueryInput, type VectorRecord, type VectorSearch, type VectorSearchReader, type VectorUpsertInput, type WorkflowCreateOptions, type WorkflowHandle, type WorkflowInstance, type WorkflowInstanceStatus, type WorkflowStatusResult, type Workflows, anyApi };
|
|
1104
|
+
export { type ActionCtx, type AggregateIndexDefinition, type AggregateOp, type AnyApi, type ArgsValidator, type AuthState, type DatabaseReader, type DatabaseWriter, type DurableObjectJurisdiction, type FunctionKind, type FunctionVisibility, type GlobalBackend, type IndexDefinition, type IndexRangeBuilder, type InferArgs, type LifecycleEvent, type LifecycleEventKind, type LunoraLogger, type MutationCtx, type OnDeleteAction, type PaginationOptions, type PaginationResult, type QueryCtx, type RankIndexDefinition, type RankSortKey, type ReadOnlyStorage, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationDefinition, type ScheduledFunctionDoc, type ScheduledJob, type Scheduler, type Schema, type SearchFilterBuilder, type SearchIndexDefinition, type Secrets, type SecretsStoreSecretLike, type ShardMode, type Storage, type StorageMetadata, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemTableName, type TableDefinition, type TableReader, type TableVectorIndex, type TriggerAggregateOptions, type TriggerBuilder, type TriggerCtx, type TriggerDatabase, type TriggerDefinition, type TriggerDeleteEvent, type TriggerEvent, type TriggerGroupByEntry, type TriggerGroupByOptions, type TriggerHandler, type TriggerInsertEvent, type TriggerOp, type TriggerQueryArgs, type TriggerQueryPage, type TriggerRankOptions, type TriggerRankPageOptions, type TriggerRankResult, type TriggerRow, type TriggerTiming, type TriggerUpdateEvent, type VectorEmbedder, type VectorIndexDefinition, type VectorMatch, type VectorMatches, type VectorMetric, type VectorQueryInput, type VectorRecord, type VectorSearch, type VectorSearchReader, type VectorUpsertInput, type WorkflowCreateOptions, type WorkflowHandle, type WorkflowInstance, type WorkflowInstanceStatus, type WorkflowStatusResult, type Workflows, anyApi };
|
package/dist/types.d.ts
CHANGED
|
@@ -5,6 +5,14 @@ type ArgsValidator = ValidatorMap;
|
|
|
5
5
|
type InferArgs<A extends ArgsValidator> = InferValidatorMap<A>;
|
|
6
6
|
/** Storage backend for a `.global()` table: D1 (default) or a Postgres/MySQL database via Cloudflare Hyperdrive (PlanetScale, Neon, …). */
|
|
7
7
|
type GlobalBackend = "d1" | "hyperdrive";
|
|
8
|
+
/**
|
|
9
|
+
* Cloudflare Durable Object data-residency jurisdiction declared via
|
|
10
|
+
* `defineSchema(...).jurisdiction("…")`. Restricts where every DO the app
|
|
11
|
+
* reaches runs and persists data (GDPR, FedRAMP, US data residency). Widening
|
|
12
|
+
* union — Cloudflare adds values over time.
|
|
13
|
+
* @see https://developers.cloudflare.com/durable-objects/reference/data-location/
|
|
14
|
+
*/
|
|
15
|
+
type DurableObjectJurisdiction = "eu" | "fedramp" | "us";
|
|
8
16
|
/** How a table is routed at runtime. */
|
|
9
17
|
type ShardMode = {
|
|
10
18
|
backend?: GlobalBackend;
|
|
@@ -628,6 +636,31 @@ interface Workflows {
|
|
|
628
636
|
/** Resolve the handle for a declared workflow by export name. */
|
|
629
637
|
get: <Params = Record<string, unknown>>(name: string) => WorkflowHandle<Params>;
|
|
630
638
|
}
|
|
639
|
+
/**
|
|
640
|
+
* Structural projection of workers-types' `SecretsStoreSecret` binding — the
|
|
641
|
+
* per-secret `secrets_store_secrets[]` binding whose `.get()` resolves the
|
|
642
|
+
* secret value (or throws if it does not exist). Mirrored structurally so the
|
|
643
|
+
* runtime resolves it without a workerd type dependency.
|
|
644
|
+
*/
|
|
645
|
+
interface SecretsStoreSecretLike {
|
|
646
|
+
get: () => Promise<string>;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* `ctx.secrets` — read account-level secrets bound via Cloudflare Secrets Store.
|
|
650
|
+
* A core built-in (always present on every context, like `ctx.log`): a binding
|
|
651
|
+
* named in wrangler's `secrets_store_secrets[]` is read by its binding name.
|
|
652
|
+
*
|
|
653
|
+
* ```ts
|
|
654
|
+
* const apiKey = await ctx.secrets.get("STRIPE_KEY");
|
|
655
|
+
* ```
|
|
656
|
+
*
|
|
657
|
+
* The lookup is async (the platform fetches and decrypts on first read);
|
|
658
|
+
* reading an undeclared name throws a directed error naming the bound secrets.
|
|
659
|
+
*/
|
|
660
|
+
interface Secrets {
|
|
661
|
+
/** Resolve a Secrets Store secret by its wrangler binding name. */
|
|
662
|
+
get: (name: string) => Promise<string>;
|
|
663
|
+
}
|
|
631
664
|
/** Lifecycle phase relative to the SQL write. */
|
|
632
665
|
type TriggerTiming = "after" | "before";
|
|
633
666
|
/** The CRUD operation a trigger reacts to. `patch` and `replace` both map to `update`. */
|
|
@@ -913,7 +946,7 @@ interface VectorRecord {
|
|
|
913
946
|
}
|
|
914
947
|
/**
|
|
915
948
|
* Read-only vector surface exposed on {@link QueryCtx}. Mirrors the read half
|
|
916
|
-
* of `@lunora/vectors`' `LunoraVectors` so the live adapter is assignable.
|
|
949
|
+
* of `@lunora/bindings/vectors`' `LunoraVectors` so the live adapter is assignable.
|
|
917
950
|
*/
|
|
918
951
|
interface VectorSearchReader {
|
|
919
952
|
getByIds: (indexName: string, ids: ReadonlyArray<string>) => Promise<ReadonlyArray<VectorRecord>>;
|
|
@@ -983,6 +1016,8 @@ interface QueryCtx {
|
|
|
983
1016
|
* Mirrors Convex's `ctx.runQuery`.
|
|
984
1017
|
*/
|
|
985
1018
|
readonly runQuery: <A extends ArgsValidator, R>(reference: RegisteredQuery<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1019
|
+
/** Read account-level secrets from Cloudflare Secrets Store; see {@link Secrets}. */
|
|
1020
|
+
readonly secrets: Secrets;
|
|
986
1021
|
readonly storage: ReadOnlyStorage;
|
|
987
1022
|
readonly vectors: VectorSearchReader;
|
|
988
1023
|
}
|
|
@@ -1023,6 +1058,8 @@ interface MutationCtx {
|
|
|
1023
1058
|
*/
|
|
1024
1059
|
readonly runQuery: <A extends ArgsValidator, R>(reference: RegisteredQuery<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1025
1060
|
readonly scheduler: Scheduler;
|
|
1061
|
+
/** Read account-level secrets from Cloudflare Secrets Store; see {@link Secrets}. */
|
|
1062
|
+
readonly secrets: Secrets;
|
|
1026
1063
|
readonly storage: ReadOnlyStorage;
|
|
1027
1064
|
readonly vectors: VectorSearch;
|
|
1028
1065
|
/** Start / resume / inspect durable workflows; see {@link Workflows}. */
|
|
@@ -1051,6 +1088,8 @@ interface ActionCtx {
|
|
|
1051
1088
|
readonly runMutation: <A extends ArgsValidator, R>(reference: RegisteredMutation<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1052
1089
|
readonly runQuery: <A extends ArgsValidator, R>(reference: RegisteredQuery<A, R>, args: InferArgs<A>) => Promise<R>;
|
|
1053
1090
|
readonly scheduler: Scheduler;
|
|
1091
|
+
/** Read account-level secrets from Cloudflare Secrets Store; see {@link Secrets}. */
|
|
1092
|
+
readonly secrets: Secrets;
|
|
1054
1093
|
readonly storage: Storage;
|
|
1055
1094
|
readonly vectors: VectorSearch;
|
|
1056
1095
|
/** Start / resume / inspect durable workflows; see {@link Workflows}. */
|
|
@@ -1062,4 +1101,4 @@ interface ActionCtx {
|
|
|
1062
1101
|
*/
|
|
1063
1102
|
type AnyApi = Record<string, Record<string, RegisteredFunction<ArgsValidator, unknown, FunctionKind>>>;
|
|
1064
1103
|
declare const anyApi: AnyApi;
|
|
1065
|
-
export { type ActionCtx, type AggregateIndexDefinition, type AggregateOp, type AnyApi, type ArgsValidator, type AuthState, type DatabaseReader, type DatabaseWriter, type FunctionKind, type FunctionVisibility, type GlobalBackend, type IndexDefinition, type IndexRangeBuilder, type InferArgs, type LifecycleEvent, type LifecycleEventKind, type LunoraLogger, type MutationCtx, type OnDeleteAction, type PaginationOptions, type PaginationResult, type QueryCtx, type RankIndexDefinition, type RankSortKey, type ReadOnlyStorage, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationDefinition, type ScheduledFunctionDoc, type ScheduledJob, type Scheduler, type Schema, type SearchFilterBuilder, type SearchIndexDefinition, type ShardMode, type Storage, type StorageMetadata, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemTableName, type TableDefinition, type TableReader, type TableVectorIndex, type TriggerAggregateOptions, type TriggerBuilder, type TriggerCtx, type TriggerDatabase, type TriggerDefinition, type TriggerDeleteEvent, type TriggerEvent, type TriggerGroupByEntry, type TriggerGroupByOptions, type TriggerHandler, type TriggerInsertEvent, type TriggerOp, type TriggerQueryArgs, type TriggerQueryPage, type TriggerRankOptions, type TriggerRankPageOptions, type TriggerRankResult, type TriggerRow, type TriggerTiming, type TriggerUpdateEvent, type VectorEmbedder, type VectorIndexDefinition, type VectorMatch, type VectorMatches, type VectorMetric, type VectorQueryInput, type VectorRecord, type VectorSearch, type VectorSearchReader, type VectorUpsertInput, type WorkflowCreateOptions, type WorkflowHandle, type WorkflowInstance, type WorkflowInstanceStatus, type WorkflowStatusResult, type Workflows, anyApi };
|
|
1104
|
+
export { type ActionCtx, type AggregateIndexDefinition, type AggregateOp, type AnyApi, type ArgsValidator, type AuthState, type DatabaseReader, type DatabaseWriter, type DurableObjectJurisdiction, type FunctionKind, type FunctionVisibility, type GlobalBackend, type IndexDefinition, type IndexRangeBuilder, type InferArgs, type LifecycleEvent, type LifecycleEventKind, type LunoraLogger, type MutationCtx, type OnDeleteAction, type PaginationOptions, type PaginationResult, type QueryCtx, type RankIndexDefinition, type RankSortKey, type ReadOnlyStorage, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMutation, type RegisteredQuery, type RegisteredStream, type RelationDefinition, type ScheduledFunctionDoc, type ScheduledJob, type Scheduler, type Schema, type SearchFilterBuilder, type SearchIndexDefinition, type Secrets, type SecretsStoreSecretLike, type ShardMode, type Storage, type StorageMetadata, type SystemDatabaseReader, type SystemDoc, type SystemQuery, type SystemTableName, type TableDefinition, type TableReader, type TableVectorIndex, type TriggerAggregateOptions, type TriggerBuilder, type TriggerCtx, type TriggerDatabase, type TriggerDefinition, type TriggerDeleteEvent, type TriggerEvent, type TriggerGroupByEntry, type TriggerGroupByOptions, type TriggerHandler, type TriggerInsertEvent, type TriggerOp, type TriggerQueryArgs, type TriggerQueryPage, type TriggerRankOptions, type TriggerRankPageOptions, type TriggerRankResult, type TriggerRow, type TriggerTiming, type TriggerUpdateEvent, type VectorEmbedder, type VectorIndexDefinition, type VectorMatch, type VectorMatches, type VectorMetric, type VectorQueryInput, type VectorRecord, type VectorSearch, type VectorSearchReader, type VectorUpsertInput, type WorkflowCreateOptions, type WorkflowHandle, type WorkflowInstance, type WorkflowInstanceStatus, type WorkflowStatusResult, type Workflows, anyApi };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/server",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "Server primitives for Lunora: defineSchema, defineTable, query, mutation, and action",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backend",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"directory": "packages/server"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
|
-
"dist",
|
|
28
|
+
"./dist",
|
|
29
29
|
"README.md",
|
|
30
30
|
"LICENSE.md",
|
|
31
31
|
"__assets__"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@lunora/scheduler": "1.0.0-alpha.
|
|
66
|
-
"@lunora/values": "1.0.0-alpha.
|
|
65
|
+
"@lunora/scheduler": "1.0.0-alpha.3",
|
|
66
|
+
"@lunora/values": "1.0.0-alpha.3",
|
|
67
67
|
"drizzle-orm": "^0.45.2",
|
|
68
68
|
"hono": "^4.12.26"
|
|
69
69
|
},
|