@lunora/server 1.0.0-alpha.257 → 1.0.0-alpha.259
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/in-process.d.mts +1 -1
- package/dist/in-process.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/otel.d.mts +1 -1
- package/dist/otel.d.ts +1 -1
- package/dist/packem_shared/{types.d-COuDZkFa.d.mts → types.d-BOnXpMCp.d.mts} +33 -3
- package/dist/packem_shared/{types.d-COuDZkFa.d.ts → types.d-BOnXpMCp.d.ts} +33 -3
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
package/dist/in-process.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SqlExec } from '@lunora/shard-engine';
|
|
2
|
-
import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-
|
|
2
|
+
import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-BOnXpMCp.mjs";
|
|
3
3
|
import '@lunora/values';
|
|
4
4
|
/** The kind of a registered Lunora function. */
|
|
5
5
|
type FunctionKind = "action" | "mutation" | "query";
|
package/dist/in-process.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SqlExec } from '@lunora/shard-engine';
|
|
2
|
-
import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-
|
|
2
|
+
import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-BOnXpMCp.js";
|
|
3
3
|
import '@lunora/values';
|
|
4
4
|
/** The kind of a registered Lunora function. */
|
|
5
5
|
type FunctionKind = "action" | "mutation" | "query";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Validator, Infer, ColumnValidator, v, Id, ValidatorMap, InferValidatorMap } from '@lunora/values';
|
|
2
2
|
export { type ColumnValidator, type GeoPoint, type Id, type Infer, ValidationError, type Validator, type ValidatorKind, v } from '@lunora/values';
|
|
3
|
-
import { A as ArgsValidator, I as InferArgs, R as RegisteredAction, E as ExposeConfig, X as X402ProcedureConfig, b as ActionCtx, M as MutationCtx, c as RegisteredMutation, Q as QueryCtx, d as RegisteredQuery, e as DurableStreamOptions, f as RegisteredStream, F as FunctionKind, T as TableDefinition, g as RegisteredFunction, V as VectorIndexDefinition, S as Schema, h as AggregateOp, G as GlobalBackend, K as KeyedRelationDefinition, i as RelationThrough, j as ThroughRelationDefinition, O as OnDeleteAction, k as RelationDefinition, l as SearchLanguage, m as SearchStrategy, n as ExternalSourceDefinition, o as TriggerBuilder, p as TriggerDefinition, q as VectorEmbedder, r as VectorMetric, s as DurableObjectJurisdiction, t as AggregateIndexDefinition, u as RankIndexDefinition, v as Secrets, w as LiveTopicRef, x as LifecycleEvent, y as ShardInitEvent, z as RegisteredLifecycleHook, W as WhisperEvent } from "./packem_shared/types.d-
|
|
4
|
-
export type { B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, Z as IndexDefinition, _ as IndexRangeBuilder, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, a5 as MutationStorage, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, a9 as RankSortKey, aa as ReadOnlyStorage, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as
|
|
3
|
+
import { A as ArgsValidator, I as InferArgs, R as RegisteredAction, E as ExposeConfig, X as X402ProcedureConfig, b as ActionCtx, M as MutationCtx, c as RegisteredMutation, Q as QueryCtx, d as RegisteredQuery, e as DurableStreamOptions, f as RegisteredStream, F as FunctionKind, T as TableDefinition, g as RegisteredFunction, V as VectorIndexDefinition, S as Schema, h as AggregateOp, G as GlobalBackend, K as KeyedRelationDefinition, i as RelationThrough, j as ThroughRelationDefinition, O as OnDeleteAction, k as RelationDefinition, l as SearchLanguage, m as SearchStrategy, n as ExternalSourceDefinition, o as TriggerBuilder, p as TriggerDefinition, q as VectorEmbedder, r as VectorMetric, s as DurableObjectJurisdiction, t as AggregateIndexDefinition, u as RankIndexDefinition, v as Secrets, w as LiveTopicRef, x as LifecycleEvent, y as ShardInitEvent, z as RegisteredLifecycleHook, W as WhisperEvent } from "./packem_shared/types.d-BOnXpMCp.mjs";
|
|
4
|
+
export type { B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, Z as IndexDefinition, _ as IndexRangeBuilder, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, a5 as MutationStorage, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, a9 as RankSortKey, aa as ReadOnlyStorage, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as ScheduledJobState, an as ScheduledJobView, ao as Scheduler, ap as SearchFilterBuilder, aq as SearchIndexDefinition, ar as ShardMode, as as SpanContextIds, at as SpanEvaluation, a as SpanHandle, au as SpanIdentity, av as SpanKind, aw as SpanLink, ax as SpanOptions, ay as Storage, az as StorageListOptions, aA as StorageListResult, aB as StorageMetadata, aC as StorageMultipartUpload, aD as StorageMultipartUploadOptions, aE as StorageObjectBody, aF as StorageObjectHead, aG as StorageRange, aH as StorageUploadBody, aI as StorageUploadOptions, aJ as StorageUploadResult, aK as StorageUploadedPart, aL as SystemDatabaseReader, aM as SystemDoc, aN as SystemQuery, aO as SystemTableName, aP as TableReader, aQ as TableVectorIndex, aR as TriggerAggregateOptions, aS as TriggerCtx, aT as TriggerDatabase, aU as TriggerDeleteEvent, aV as TriggerEvent, aW as TriggerGroupByEntry, aX as TriggerGroupByOptions, aY as TriggerHandler, aZ as TriggerInsertEvent, a_ as TriggerOp, a$ as TriggerQueryArgs, b0 as TriggerQueryPage, b1 as TriggerRankOptions, b2 as TriggerRankPageOptions, b3 as TriggerRankResult, b4 as TriggerRow, b5 as TriggerTiming, b6 as TriggerUpdateEvent, b7 as TtlDefinition, b8 as VectorMatch, b9 as VectorMatches, ba as VectorQueryInput, bb as VectorRecord, bc as VectorSearch, bd as VectorSearchReader, be as VectorUpsertInput, bf as WorkflowCreateOptions, bg as WorkflowEventDefinition, bh as WorkflowHandle, bi as WorkflowInstance, bj as WorkflowInstanceEvent, bk as WorkflowInstanceStatus, bl as WorkflowStatusResult, bm as Workflows } from "./packem_shared/types.d-BOnXpMCp.mjs";
|
|
5
5
|
import { LunoraError } from '@lunora/errors';
|
|
6
6
|
export { LunoraError, type LunoraErrorCode } from '@lunora/errors';
|
|
7
7
|
import { Context, Hono, ExecutionContext } from 'hono';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Validator, Infer, ColumnValidator, v, Id, ValidatorMap, InferValidatorMap } from '@lunora/values';
|
|
2
2
|
export { type ColumnValidator, type GeoPoint, type Id, type Infer, ValidationError, type Validator, type ValidatorKind, v } from '@lunora/values';
|
|
3
|
-
import { A as ArgsValidator, I as InferArgs, R as RegisteredAction, E as ExposeConfig, X as X402ProcedureConfig, b as ActionCtx, M as MutationCtx, c as RegisteredMutation, Q as QueryCtx, d as RegisteredQuery, e as DurableStreamOptions, f as RegisteredStream, F as FunctionKind, T as TableDefinition, g as RegisteredFunction, V as VectorIndexDefinition, S as Schema, h as AggregateOp, G as GlobalBackend, K as KeyedRelationDefinition, i as RelationThrough, j as ThroughRelationDefinition, O as OnDeleteAction, k as RelationDefinition, l as SearchLanguage, m as SearchStrategy, n as ExternalSourceDefinition, o as TriggerBuilder, p as TriggerDefinition, q as VectorEmbedder, r as VectorMetric, s as DurableObjectJurisdiction, t as AggregateIndexDefinition, u as RankIndexDefinition, v as Secrets, w as LiveTopicRef, x as LifecycleEvent, y as ShardInitEvent, z as RegisteredLifecycleHook, W as WhisperEvent } from "./packem_shared/types.d-
|
|
4
|
-
export type { B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, Z as IndexDefinition, _ as IndexRangeBuilder, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, a5 as MutationStorage, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, a9 as RankSortKey, aa as ReadOnlyStorage, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as
|
|
3
|
+
import { A as ArgsValidator, I as InferArgs, R as RegisteredAction, E as ExposeConfig, X as X402ProcedureConfig, b as ActionCtx, M as MutationCtx, c as RegisteredMutation, Q as QueryCtx, d as RegisteredQuery, e as DurableStreamOptions, f as RegisteredStream, F as FunctionKind, T as TableDefinition, g as RegisteredFunction, V as VectorIndexDefinition, S as Schema, h as AggregateOp, G as GlobalBackend, K as KeyedRelationDefinition, i as RelationThrough, j as ThroughRelationDefinition, O as OnDeleteAction, k as RelationDefinition, l as SearchLanguage, m as SearchStrategy, n as ExternalSourceDefinition, o as TriggerBuilder, p as TriggerDefinition, q as VectorEmbedder, r as VectorMetric, s as DurableObjectJurisdiction, t as AggregateIndexDefinition, u as RankIndexDefinition, v as Secrets, w as LiveTopicRef, x as LifecycleEvent, y as ShardInitEvent, z as RegisteredLifecycleHook, W as WhisperEvent } from "./packem_shared/types.d-BOnXpMCp.js";
|
|
4
|
+
export type { B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, Z as IndexDefinition, _ as IndexRangeBuilder, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, a5 as MutationStorage, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, a9 as RankSortKey, aa as ReadOnlyStorage, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as ScheduledJobState, an as ScheduledJobView, ao as Scheduler, ap as SearchFilterBuilder, aq as SearchIndexDefinition, ar as ShardMode, as as SpanContextIds, at as SpanEvaluation, a as SpanHandle, au as SpanIdentity, av as SpanKind, aw as SpanLink, ax as SpanOptions, ay as Storage, az as StorageListOptions, aA as StorageListResult, aB as StorageMetadata, aC as StorageMultipartUpload, aD as StorageMultipartUploadOptions, aE as StorageObjectBody, aF as StorageObjectHead, aG as StorageRange, aH as StorageUploadBody, aI as StorageUploadOptions, aJ as StorageUploadResult, aK as StorageUploadedPart, aL as SystemDatabaseReader, aM as SystemDoc, aN as SystemQuery, aO as SystemTableName, aP as TableReader, aQ as TableVectorIndex, aR as TriggerAggregateOptions, aS as TriggerCtx, aT as TriggerDatabase, aU as TriggerDeleteEvent, aV as TriggerEvent, aW as TriggerGroupByEntry, aX as TriggerGroupByOptions, aY as TriggerHandler, aZ as TriggerInsertEvent, a_ as TriggerOp, a$ as TriggerQueryArgs, b0 as TriggerQueryPage, b1 as TriggerRankOptions, b2 as TriggerRankPageOptions, b3 as TriggerRankResult, b4 as TriggerRow, b5 as TriggerTiming, b6 as TriggerUpdateEvent, b7 as TtlDefinition, b8 as VectorMatch, b9 as VectorMatches, ba as VectorQueryInput, bb as VectorRecord, bc as VectorSearch, bd as VectorSearchReader, be as VectorUpsertInput, bf as WorkflowCreateOptions, bg as WorkflowEventDefinition, bh as WorkflowHandle, bi as WorkflowInstance, bj as WorkflowInstanceEvent, bk as WorkflowInstanceStatus, bl as WorkflowStatusResult, bm as Workflows } from "./packem_shared/types.d-BOnXpMCp.js";
|
|
5
5
|
import { LunoraError } from '@lunora/errors';
|
|
6
6
|
export { LunoraError, type LunoraErrorCode } from '@lunora/errors';
|
|
7
7
|
import { Context, Hono, ExecutionContext } from 'hono';
|
package/dist/otel.d.mts
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* `@opentelemetry/api` is a PEER dependency: it keeps a module-global registry,
|
|
42
42
|
* so a second copy in the tree would silently split it.
|
|
43
43
|
*/
|
|
44
|
-
import { a as SpanHandle, L as LunoraTracer } from "./packem_shared/types.d-
|
|
44
|
+
import { a as SpanHandle, L as LunoraTracer } from "./packem_shared/types.d-BOnXpMCp.mjs";
|
|
45
45
|
import '@lunora/values';
|
|
46
46
|
/**
|
|
47
47
|
* @since 1.0.0
|
package/dist/otel.d.ts
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* `@opentelemetry/api` is a PEER dependency: it keeps a module-global registry,
|
|
42
42
|
* so a second copy in the tree would silently split it.
|
|
43
43
|
*/
|
|
44
|
-
import { a as SpanHandle, L as LunoraTracer } from "./packem_shared/types.d-
|
|
44
|
+
import { a as SpanHandle, L as LunoraTracer } from "./packem_shared/types.d-BOnXpMCp.js";
|
|
45
45
|
import '@lunora/values';
|
|
46
46
|
/**
|
|
47
47
|
* @since 1.0.0
|
|
@@ -1217,8 +1217,12 @@ interface ScheduledFunctionDoc {
|
|
|
1217
1217
|
args: Record<string, unknown>;
|
|
1218
1218
|
/** Number of dispatch attempts already made (absent until the first retry). */
|
|
1219
1219
|
attempts?: number;
|
|
1220
|
+
/** When the job reached a terminal state (epoch ms). Set only on a `get()` of a finished job. */
|
|
1221
|
+
completedAt?: number;
|
|
1220
1222
|
/** When the job was enqueued (epoch ms). */
|
|
1221
1223
|
enqueuedAt: number;
|
|
1224
|
+
/** Why a `failed` job was dead-lettered. */
|
|
1225
|
+
error?: string;
|
|
1222
1226
|
/**
|
|
1223
1227
|
* Fully-qualified `ns:fn` path of the function to invoke. Absent when the job
|
|
1224
1228
|
* targets a durable workflow/agent instead — exactly one of `functionPath` /
|
|
@@ -1233,6 +1237,13 @@ interface ScheduledFunctionDoc {
|
|
|
1233
1237
|
scheduledFor: number;
|
|
1234
1238
|
/** Routing hint forwarded so dispatch lands on the right shard. */
|
|
1235
1239
|
shardKey?: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* Lifecycle state (`pending`, `running`, `succeeded`, `failed`, `canceled`).
|
|
1242
|
+
* `get()` reports it, including a finished job's outcome for a bounded
|
|
1243
|
+
* retention window; `query().collect()` lists pending jobs only, which carry
|
|
1244
|
+
* no state field.
|
|
1245
|
+
*/
|
|
1246
|
+
state?: "canceled" | "failed" | "pending" | "running" | "succeeded";
|
|
1236
1247
|
/**
|
|
1237
1248
|
* The workflow/agent export key (its generated class name) a fresh durable instance is started from
|
|
1238
1249
|
* on fire (the {@link ScheduledFunctionDoc.args} become its `params`). Set
|
|
@@ -1835,6 +1846,8 @@ interface ScheduledJob {
|
|
|
1835
1846
|
attempts?: number;
|
|
1836
1847
|
/** When the job was enqueued (epoch ms). */
|
|
1837
1848
|
enqueuedAt: number;
|
|
1849
|
+
/** Why the job was dead-lettered. Set only on a `failed` job. */
|
|
1850
|
+
error?: string;
|
|
1838
1851
|
/**
|
|
1839
1852
|
* The `ns:fn` path of the function to dispatch on fire. Absent when the job
|
|
1840
1853
|
* targets a durable workflow/agent instead — see {@link ScheduledJob.workflow}.
|
|
@@ -1859,6 +1872,23 @@ interface ScheduledJob {
|
|
|
1859
1872
|
*/
|
|
1860
1873
|
workflow?: string;
|
|
1861
1874
|
}
|
|
1875
|
+
/**
|
|
1876
|
+
* Where a job is in its life, as {@link Scheduler.get} reports it. `succeeded`
|
|
1877
|
+
* means the dispatch answered 2xx — for a function, that it returned; for a
|
|
1878
|
+
* workflow/agent target, that its instance was started. `failed` is a job that
|
|
1879
|
+
* exhausted its retry budget; `canceled` one removed by {@link Scheduler.cancel}.
|
|
1880
|
+
*/
|
|
1881
|
+
type ScheduledJobState = "canceled" | "failed" | "pending" | "running" | "succeeded";
|
|
1882
|
+
/**
|
|
1883
|
+
* A job with its lifecycle state. Terminal states are kept for a bounded
|
|
1884
|
+
* retention window after `completedAt`, after which {@link Scheduler.get}
|
|
1885
|
+
* answers `null`.
|
|
1886
|
+
*/
|
|
1887
|
+
interface ScheduledJobView extends ScheduledJob {
|
|
1888
|
+
/** When the job reached its terminal state (epoch ms). Absent while `pending`/`running`. */
|
|
1889
|
+
completedAt?: number;
|
|
1890
|
+
state: ScheduledJobState;
|
|
1891
|
+
}
|
|
1862
1892
|
/**
|
|
1863
1893
|
* A schedulable durable-workflow reference — the generated `workflows.<name>` /
|
|
1864
1894
|
* `agents.<name>` object, which carries its export key (the generated class name) and
|
|
@@ -1892,8 +1922,8 @@ interface Scheduler {
|
|
|
1892
1922
|
cancel: (id: string) => Promise<{
|
|
1893
1923
|
cancelled: boolean;
|
|
1894
1924
|
}>;
|
|
1895
|
-
/** Resolve a
|
|
1896
|
-
get: (id: string) => Promise<
|
|
1925
|
+
/** Resolve a job by id with its lifecycle state, or `null` when never scheduled or past retention. */
|
|
1926
|
+
get: (id: string) => Promise<ScheduledJobView | null>;
|
|
1897
1927
|
/** List all pending scheduled jobs. */
|
|
1898
1928
|
list: () => Promise<ScheduledJob[]>;
|
|
1899
1929
|
/**
|
|
@@ -2928,4 +2958,4 @@ interface ActionCtx {
|
|
|
2928
2958
|
/** Start / resume / inspect durable workflows; see {@link Workflows}. */
|
|
2929
2959
|
readonly workflows: Workflows;
|
|
2930
2960
|
}
|
|
2931
|
-
export { LifecycleEventKind as $, ArgsValidator as A, AuthState as B, CachePurge as C, DatabaseWriter as D, ExposeConfig as E, FunctionKind as F, GlobalBackend as G, DatabaseReader as H, InferArgs as I, FunctionVisibility as J, KeyedRelationDefinition as K, LunoraTracer as L, MutationCtx as M, GeoBoundingBox as N, OnDeleteAction as O, GeoFilterBuilder as P, QueryCtx as Q, RegisteredAction as R, Schema as S, TableDefinition as T, GeoIndexDefinition as U, VectorIndexDefinition as V, WhisperEvent as W, X402ProcedureConfig as X, GeoPointInput as Y, IndexDefinition as Z, IndexRangeBuilder as _, SpanHandle as a,
|
|
2961
|
+
export { LifecycleEventKind as $, ArgsValidator as A, AuthState as B, CachePurge as C, DatabaseWriter as D, ExposeConfig as E, FunctionKind as F, GlobalBackend as G, DatabaseReader as H, InferArgs as I, FunctionVisibility as J, KeyedRelationDefinition as K, LunoraTracer as L, MutationCtx as M, GeoBoundingBox as N, OnDeleteAction as O, GeoFilterBuilder as P, QueryCtx as Q, RegisteredAction as R, Schema as S, TableDefinition as T, GeoIndexDefinition as U, VectorIndexDefinition as V, WhisperEvent as W, X402ProcedureConfig as X, GeoPointInput as Y, IndexDefinition as Z, IndexRangeBuilder as _, SpanHandle as a, TriggerQueryArgs as a$, LogFields as a0, LunoraLogMethod as a1, LunoraLogger as a2, LunoraMetrics as a3, LunoraWideEvent as a4, MutationStorage as a5, PaginationOptions as a6, PaginationResult as a7, PatchIfResult as a8, RankSortKey as a9, StorageListResult as aA, StorageMetadata as aB, StorageMultipartUpload as aC, StorageMultipartUploadOptions as aD, StorageObjectBody as aE, StorageObjectHead as aF, StorageRange as aG, StorageUploadBody as aH, StorageUploadOptions as aI, StorageUploadResult as aJ, StorageUploadedPart as aK, SystemDatabaseReader as aL, SystemDoc as aM, SystemQuery as aN, SystemTableName as aO, TableReader as aP, TableVectorIndex as aQ, TriggerAggregateOptions as aR, TriggerCtx as aS, TriggerDatabase as aT, TriggerDeleteEvent as aU, TriggerEvent as aV, TriggerGroupByEntry as aW, TriggerGroupByOptions as aX, TriggerHandler as aY, TriggerInsertEvent as aZ, TriggerOp as a_, ReadOnlyStorage as aa, RelatedDirection as ab, RelatedNode as ac, RelatedOptions as ad, RelatedPage as ae, RelatedStart as af, RelatedStartReference as ag, RestCacheConfig as ah, RetryPolicy as ai, RunQueryOptions as aj, ScheduledFunctionDoc as ak, ScheduledJob as al, ScheduledJobState as am, ScheduledJobView as an, Scheduler as ao, SearchFilterBuilder as ap, SearchIndexDefinition as aq, ShardMode as ar, SpanContextIds as as, SpanEvaluation as at, SpanIdentity as au, SpanKind as av, SpanLink as aw, SpanOptions as ax, Storage as ay, StorageListOptions as az, ActionCtx as b, TriggerQueryPage as b0, TriggerRankOptions as b1, TriggerRankPageOptions as b2, TriggerRankResult as b3, TriggerRow as b4, TriggerTiming as b5, TriggerUpdateEvent as b6, TtlDefinition as b7, VectorMatch as b8, VectorMatches as b9, VectorQueryInput as ba, VectorRecord as bb, VectorSearch as bc, VectorSearchReader as bd, VectorUpsertInput as be, WorkflowCreateOptions as bf, WorkflowEventDefinition as bg, WorkflowHandle as bh, WorkflowInstance as bi, WorkflowInstanceEvent as bj, WorkflowInstanceStatus as bk, WorkflowStatusResult as bl, Workflows as bm, ExternalSourceCursor as bn, ExternalSourceMode as bo, ExternalSourceRefresh as bp, SecretsStoreSecretLike as bq, RegisteredMutation as c, RegisteredQuery as d, DurableStreamOptions as e, RegisteredStream as f, RegisteredFunction as g, AggregateOp as h, RelationThrough as i, ThroughRelationDefinition as j, RelationDefinition as k, SearchLanguage as l, SearchStrategy as m, ExternalSourceDefinition as n, TriggerBuilder as o, TriggerDefinition as p, VectorEmbedder as q, VectorMetric as r, DurableObjectJurisdiction as s, AggregateIndexDefinition as t, RankIndexDefinition as u, Secrets as v, LiveTopicRef as w, LifecycleEvent as x, ShardInitEvent as y, RegisteredLifecycleHook as z };
|
|
@@ -1217,8 +1217,12 @@ interface ScheduledFunctionDoc {
|
|
|
1217
1217
|
args: Record<string, unknown>;
|
|
1218
1218
|
/** Number of dispatch attempts already made (absent until the first retry). */
|
|
1219
1219
|
attempts?: number;
|
|
1220
|
+
/** When the job reached a terminal state (epoch ms). Set only on a `get()` of a finished job. */
|
|
1221
|
+
completedAt?: number;
|
|
1220
1222
|
/** When the job was enqueued (epoch ms). */
|
|
1221
1223
|
enqueuedAt: number;
|
|
1224
|
+
/** Why a `failed` job was dead-lettered. */
|
|
1225
|
+
error?: string;
|
|
1222
1226
|
/**
|
|
1223
1227
|
* Fully-qualified `ns:fn` path of the function to invoke. Absent when the job
|
|
1224
1228
|
* targets a durable workflow/agent instead — exactly one of `functionPath` /
|
|
@@ -1233,6 +1237,13 @@ interface ScheduledFunctionDoc {
|
|
|
1233
1237
|
scheduledFor: number;
|
|
1234
1238
|
/** Routing hint forwarded so dispatch lands on the right shard. */
|
|
1235
1239
|
shardKey?: string;
|
|
1240
|
+
/**
|
|
1241
|
+
* Lifecycle state (`pending`, `running`, `succeeded`, `failed`, `canceled`).
|
|
1242
|
+
* `get()` reports it, including a finished job's outcome for a bounded
|
|
1243
|
+
* retention window; `query().collect()` lists pending jobs only, which carry
|
|
1244
|
+
* no state field.
|
|
1245
|
+
*/
|
|
1246
|
+
state?: "canceled" | "failed" | "pending" | "running" | "succeeded";
|
|
1236
1247
|
/**
|
|
1237
1248
|
* The workflow/agent export key (its generated class name) a fresh durable instance is started from
|
|
1238
1249
|
* on fire (the {@link ScheduledFunctionDoc.args} become its `params`). Set
|
|
@@ -1835,6 +1846,8 @@ interface ScheduledJob {
|
|
|
1835
1846
|
attempts?: number;
|
|
1836
1847
|
/** When the job was enqueued (epoch ms). */
|
|
1837
1848
|
enqueuedAt: number;
|
|
1849
|
+
/** Why the job was dead-lettered. Set only on a `failed` job. */
|
|
1850
|
+
error?: string;
|
|
1838
1851
|
/**
|
|
1839
1852
|
* The `ns:fn` path of the function to dispatch on fire. Absent when the job
|
|
1840
1853
|
* targets a durable workflow/agent instead — see {@link ScheduledJob.workflow}.
|
|
@@ -1859,6 +1872,23 @@ interface ScheduledJob {
|
|
|
1859
1872
|
*/
|
|
1860
1873
|
workflow?: string;
|
|
1861
1874
|
}
|
|
1875
|
+
/**
|
|
1876
|
+
* Where a job is in its life, as {@link Scheduler.get} reports it. `succeeded`
|
|
1877
|
+
* means the dispatch answered 2xx — for a function, that it returned; for a
|
|
1878
|
+
* workflow/agent target, that its instance was started. `failed` is a job that
|
|
1879
|
+
* exhausted its retry budget; `canceled` one removed by {@link Scheduler.cancel}.
|
|
1880
|
+
*/
|
|
1881
|
+
type ScheduledJobState = "canceled" | "failed" | "pending" | "running" | "succeeded";
|
|
1882
|
+
/**
|
|
1883
|
+
* A job with its lifecycle state. Terminal states are kept for a bounded
|
|
1884
|
+
* retention window after `completedAt`, after which {@link Scheduler.get}
|
|
1885
|
+
* answers `null`.
|
|
1886
|
+
*/
|
|
1887
|
+
interface ScheduledJobView extends ScheduledJob {
|
|
1888
|
+
/** When the job reached its terminal state (epoch ms). Absent while `pending`/`running`. */
|
|
1889
|
+
completedAt?: number;
|
|
1890
|
+
state: ScheduledJobState;
|
|
1891
|
+
}
|
|
1862
1892
|
/**
|
|
1863
1893
|
* A schedulable durable-workflow reference — the generated `workflows.<name>` /
|
|
1864
1894
|
* `agents.<name>` object, which carries its export key (the generated class name) and
|
|
@@ -1892,8 +1922,8 @@ interface Scheduler {
|
|
|
1892
1922
|
cancel: (id: string) => Promise<{
|
|
1893
1923
|
cancelled: boolean;
|
|
1894
1924
|
}>;
|
|
1895
|
-
/** Resolve a
|
|
1896
|
-
get: (id: string) => Promise<
|
|
1925
|
+
/** Resolve a job by id with its lifecycle state, or `null` when never scheduled or past retention. */
|
|
1926
|
+
get: (id: string) => Promise<ScheduledJobView | null>;
|
|
1897
1927
|
/** List all pending scheduled jobs. */
|
|
1898
1928
|
list: () => Promise<ScheduledJob[]>;
|
|
1899
1929
|
/**
|
|
@@ -2928,4 +2958,4 @@ interface ActionCtx {
|
|
|
2928
2958
|
/** Start / resume / inspect durable workflows; see {@link Workflows}. */
|
|
2929
2959
|
readonly workflows: Workflows;
|
|
2930
2960
|
}
|
|
2931
|
-
export { LifecycleEventKind as $, ArgsValidator as A, AuthState as B, CachePurge as C, DatabaseWriter as D, ExposeConfig as E, FunctionKind as F, GlobalBackend as G, DatabaseReader as H, InferArgs as I, FunctionVisibility as J, KeyedRelationDefinition as K, LunoraTracer as L, MutationCtx as M, GeoBoundingBox as N, OnDeleteAction as O, GeoFilterBuilder as P, QueryCtx as Q, RegisteredAction as R, Schema as S, TableDefinition as T, GeoIndexDefinition as U, VectorIndexDefinition as V, WhisperEvent as W, X402ProcedureConfig as X, GeoPointInput as Y, IndexDefinition as Z, IndexRangeBuilder as _, SpanHandle as a,
|
|
2961
|
+
export { LifecycleEventKind as $, ArgsValidator as A, AuthState as B, CachePurge as C, DatabaseWriter as D, ExposeConfig as E, FunctionKind as F, GlobalBackend as G, DatabaseReader as H, InferArgs as I, FunctionVisibility as J, KeyedRelationDefinition as K, LunoraTracer as L, MutationCtx as M, GeoBoundingBox as N, OnDeleteAction as O, GeoFilterBuilder as P, QueryCtx as Q, RegisteredAction as R, Schema as S, TableDefinition as T, GeoIndexDefinition as U, VectorIndexDefinition as V, WhisperEvent as W, X402ProcedureConfig as X, GeoPointInput as Y, IndexDefinition as Z, IndexRangeBuilder as _, SpanHandle as a, TriggerQueryArgs as a$, LogFields as a0, LunoraLogMethod as a1, LunoraLogger as a2, LunoraMetrics as a3, LunoraWideEvent as a4, MutationStorage as a5, PaginationOptions as a6, PaginationResult as a7, PatchIfResult as a8, RankSortKey as a9, StorageListResult as aA, StorageMetadata as aB, StorageMultipartUpload as aC, StorageMultipartUploadOptions as aD, StorageObjectBody as aE, StorageObjectHead as aF, StorageRange as aG, StorageUploadBody as aH, StorageUploadOptions as aI, StorageUploadResult as aJ, StorageUploadedPart as aK, SystemDatabaseReader as aL, SystemDoc as aM, SystemQuery as aN, SystemTableName as aO, TableReader as aP, TableVectorIndex as aQ, TriggerAggregateOptions as aR, TriggerCtx as aS, TriggerDatabase as aT, TriggerDeleteEvent as aU, TriggerEvent as aV, TriggerGroupByEntry as aW, TriggerGroupByOptions as aX, TriggerHandler as aY, TriggerInsertEvent as aZ, TriggerOp as a_, ReadOnlyStorage as aa, RelatedDirection as ab, RelatedNode as ac, RelatedOptions as ad, RelatedPage as ae, RelatedStart as af, RelatedStartReference as ag, RestCacheConfig as ah, RetryPolicy as ai, RunQueryOptions as aj, ScheduledFunctionDoc as ak, ScheduledJob as al, ScheduledJobState as am, ScheduledJobView as an, Scheduler as ao, SearchFilterBuilder as ap, SearchIndexDefinition as aq, ShardMode as ar, SpanContextIds as as, SpanEvaluation as at, SpanIdentity as au, SpanKind as av, SpanLink as aw, SpanOptions as ax, Storage as ay, StorageListOptions as az, ActionCtx as b, TriggerQueryPage as b0, TriggerRankOptions as b1, TriggerRankPageOptions as b2, TriggerRankResult as b3, TriggerRow as b4, TriggerTiming as b5, TriggerUpdateEvent as b6, TtlDefinition as b7, VectorMatch as b8, VectorMatches as b9, VectorQueryInput as ba, VectorRecord as bb, VectorSearch as bc, VectorSearchReader as bd, VectorUpsertInput as be, WorkflowCreateOptions as bf, WorkflowEventDefinition as bg, WorkflowHandle as bh, WorkflowInstance as bi, WorkflowInstanceEvent as bj, WorkflowInstanceStatus as bk, WorkflowStatusResult as bl, Workflows as bm, ExternalSourceCursor as bn, ExternalSourceMode as bo, ExternalSourceRefresh as bp, SecretsStoreSecretLike as bq, RegisteredMutation as c, RegisteredQuery as d, DurableStreamOptions as e, RegisteredStream as f, RegisteredFunction as g, AggregateOp as h, RelationThrough as i, ThroughRelationDefinition as j, RelationDefinition as k, SearchLanguage as l, SearchStrategy as m, ExternalSourceDefinition as n, TriggerBuilder as o, TriggerDefinition as p, VectorEmbedder as q, VectorMetric as r, DurableObjectJurisdiction as s, AggregateIndexDefinition as t, RankIndexDefinition as u, Secrets as v, LiveTopicRef as w, LifecycleEvent as x, ShardInitEvent as y, RegisteredLifecycleHook as z };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { b as ActionCtx, t as AggregateIndexDefinition, h as AggregateOp, A as ArgsValidator, B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, s as DurableObjectJurisdiction, e as DurableStreamOptions, E as ExposeConfig,
|
|
1
|
+
export type { b as ActionCtx, t as AggregateIndexDefinition, h as AggregateOp, A as ArgsValidator, B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, s as DurableObjectJurisdiction, e as DurableStreamOptions, E as ExposeConfig, bn as ExternalSourceCursor, n as ExternalSourceDefinition, bo as ExternalSourceMode, bp as ExternalSourceRefresh, F as FunctionKind, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, G as GlobalBackend, Z as IndexDefinition, _ as IndexRangeBuilder, I as InferArgs, K as KeyedRelationDefinition, x as LifecycleEvent, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, M as MutationCtx, a5 as MutationStorage, O as OnDeleteAction, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, Q as QueryCtx, u as RankIndexDefinition, a9 as RankSortKey, aa as ReadOnlyStorage, R as RegisteredAction, g as RegisteredFunction, z as RegisteredLifecycleHook, c as RegisteredMutation, d as RegisteredQuery, f as RegisteredStream, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, k as RelationDefinition, i as RelationThrough, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as ScheduledJobState, an as ScheduledJobView, ao as Scheduler, S as Schema, ap as SearchFilterBuilder, aq as SearchIndexDefinition, l as SearchLanguage, m as SearchStrategy, v as Secrets, bq as SecretsStoreSecretLike, y as ShardInitEvent, ar as ShardMode, as as SpanContextIds, at as SpanEvaluation, a as SpanHandle, au as SpanIdentity, av as SpanKind, aw as SpanLink, ax as SpanOptions, ay as Storage, az as StorageListOptions, aA as StorageListResult, aB as StorageMetadata, aC as StorageMultipartUpload, aD as StorageMultipartUploadOptions, aE as StorageObjectBody, aF as StorageObjectHead, aG as StorageRange, aH as StorageUploadBody, aI as StorageUploadOptions, aJ as StorageUploadResult, aK as StorageUploadedPart, aL as SystemDatabaseReader, aM as SystemDoc, aN as SystemQuery, aO as SystemTableName, T as TableDefinition, aP as TableReader, aQ as TableVectorIndex, j as ThroughRelationDefinition, aR as TriggerAggregateOptions, o as TriggerBuilder, aS as TriggerCtx, aT as TriggerDatabase, p as TriggerDefinition, aU as TriggerDeleteEvent, aV as TriggerEvent, aW as TriggerGroupByEntry, aX as TriggerGroupByOptions, aY as TriggerHandler, aZ as TriggerInsertEvent, a_ as TriggerOp, a$ as TriggerQueryArgs, b0 as TriggerQueryPage, b1 as TriggerRankOptions, b2 as TriggerRankPageOptions, b3 as TriggerRankResult, b4 as TriggerRow, b5 as TriggerTiming, b6 as TriggerUpdateEvent, b7 as TtlDefinition, q as VectorEmbedder, V as VectorIndexDefinition, b8 as VectorMatch, b9 as VectorMatches, r as VectorMetric, ba as VectorQueryInput, bb as VectorRecord, bc as VectorSearch, bd as VectorSearchReader, be as VectorUpsertInput, W as WhisperEvent, bf as WorkflowCreateOptions, bg as WorkflowEventDefinition, bh as WorkflowHandle, bi as WorkflowInstance, bj as WorkflowInstanceEvent, bk as WorkflowInstanceStatus, bl as WorkflowStatusResult, bm as Workflows, X as X402ProcedureConfig } from "./packem_shared/types.d-BOnXpMCp.mjs";
|
|
2
2
|
import '@lunora/values';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { b as ActionCtx, t as AggregateIndexDefinition, h as AggregateOp, A as ArgsValidator, B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, s as DurableObjectJurisdiction, e as DurableStreamOptions, E as ExposeConfig,
|
|
1
|
+
export type { b as ActionCtx, t as AggregateIndexDefinition, h as AggregateOp, A as ArgsValidator, B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, s as DurableObjectJurisdiction, e as DurableStreamOptions, E as ExposeConfig, bn as ExternalSourceCursor, n as ExternalSourceDefinition, bo as ExternalSourceMode, bp as ExternalSourceRefresh, F as FunctionKind, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, G as GlobalBackend, Z as IndexDefinition, _ as IndexRangeBuilder, I as InferArgs, K as KeyedRelationDefinition, x as LifecycleEvent, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, M as MutationCtx, a5 as MutationStorage, O as OnDeleteAction, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, Q as QueryCtx, u as RankIndexDefinition, a9 as RankSortKey, aa as ReadOnlyStorage, R as RegisteredAction, g as RegisteredFunction, z as RegisteredLifecycleHook, c as RegisteredMutation, d as RegisteredQuery, f as RegisteredStream, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, k as RelationDefinition, i as RelationThrough, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as ScheduledJobState, an as ScheduledJobView, ao as Scheduler, S as Schema, ap as SearchFilterBuilder, aq as SearchIndexDefinition, l as SearchLanguage, m as SearchStrategy, v as Secrets, bq as SecretsStoreSecretLike, y as ShardInitEvent, ar as ShardMode, as as SpanContextIds, at as SpanEvaluation, a as SpanHandle, au as SpanIdentity, av as SpanKind, aw as SpanLink, ax as SpanOptions, ay as Storage, az as StorageListOptions, aA as StorageListResult, aB as StorageMetadata, aC as StorageMultipartUpload, aD as StorageMultipartUploadOptions, aE as StorageObjectBody, aF as StorageObjectHead, aG as StorageRange, aH as StorageUploadBody, aI as StorageUploadOptions, aJ as StorageUploadResult, aK as StorageUploadedPart, aL as SystemDatabaseReader, aM as SystemDoc, aN as SystemQuery, aO as SystemTableName, T as TableDefinition, aP as TableReader, aQ as TableVectorIndex, j as ThroughRelationDefinition, aR as TriggerAggregateOptions, o as TriggerBuilder, aS as TriggerCtx, aT as TriggerDatabase, p as TriggerDefinition, aU as TriggerDeleteEvent, aV as TriggerEvent, aW as TriggerGroupByEntry, aX as TriggerGroupByOptions, aY as TriggerHandler, aZ as TriggerInsertEvent, a_ as TriggerOp, a$ as TriggerQueryArgs, b0 as TriggerQueryPage, b1 as TriggerRankOptions, b2 as TriggerRankPageOptions, b3 as TriggerRankResult, b4 as TriggerRow, b5 as TriggerTiming, b6 as TriggerUpdateEvent, b7 as TtlDefinition, q as VectorEmbedder, V as VectorIndexDefinition, b8 as VectorMatch, b9 as VectorMatches, r as VectorMetric, ba as VectorQueryInput, bb as VectorRecord, bc as VectorSearch, bd as VectorSearchReader, be as VectorUpsertInput, W as WhisperEvent, bf as WorkflowCreateOptions, bg as WorkflowEventDefinition, bh as WorkflowHandle, bi as WorkflowInstance, bj as WorkflowInstanceEvent, bk as WorkflowInstanceStatus, bl as WorkflowStatusResult, bm as Workflows, X as X402ProcedureConfig } from "./packem_shared/types.d-BOnXpMCp.js";
|
|
2
2
|
import '@lunora/values';
|
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.259",
|
|
4
4
|
"description": "Server primitives for Lunora: defineSchema, defineTable, query, mutation, and action",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backend",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@lunora/errors": ">=1.0.0-alpha.77 <2.0.0-0",
|
|
76
|
-
"@lunora/scheduler": "1.0.0-alpha.
|
|
77
|
-
"@lunora/shard-engine": "1.0.0-alpha.
|
|
78
|
-
"@lunora/values": "1.0.0-alpha.
|
|
76
|
+
"@lunora/scheduler": "1.0.0-alpha.162",
|
|
77
|
+
"@lunora/shard-engine": "1.0.0-alpha.178",
|
|
78
|
+
"@lunora/values": "1.0.0-alpha.89",
|
|
79
79
|
"@lunora/wire": "1.0.0-alpha.6",
|
|
80
80
|
"drizzle-orm": "1.0.0-rc.5",
|
|
81
81
|
"hono": "^4.13.13"
|