doxum 0.1.25 → 0.1.26
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/README.md +11 -1
- package/dist/advanced.cjs.map +1 -1
- package/dist/advanced.d.cts +17 -25
- package/dist/advanced.d.ts +17 -25
- package/dist/advanced.js.map +1 -1
- package/dist/{contract-Dawq6LKS.d.ts → contract-CNR6BS75.d.cts} +174 -47
- package/dist/{contract-DB8XvNt0.d.cts → contract-COgxO5sv.d.ts} +174 -47
- package/dist/{definition-DT1NpMul.d.ts → definition-CDOuvb5C.d.cts} +13 -12
- package/dist/{definition-CHVS-RDY.d.cts → definition-xgk3YNBp.d.ts} +13 -12
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/local-sync.d.cts +1 -1
- package/dist/local-sync.d.ts +1 -1
- package/dist/scheduler--137L3j-.js.map +1 -1
- package/dist/scheduler-D4VthaaK.cjs.map +1 -1
- package/package.json +3 -2
- package/skills/doxum-runtime/SKILL.md +7 -1
- package/skills/doxum-runtime/references/api.en.md +13 -7
- package/skills/doxum-runtime/references/api.zh-CN.md +12 -6
- package/skills/doxum-runtime/references/projections.en.md +4 -1
- package/skills/doxum-runtime/references/projections.zh-CN.md +4 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as table, A as ParseError, B as DocumentListConfig, C as Read, D as ChangeSet, E as Change, F as CollectionPath, G as ReadonlyValue, H as DocumentTreeValue, I as PathValueOf, J as field, K as Schema, L as SchemaPath, M as parse, N as CollectionEntry, O as MemberChange, P as CollectionId, Q as optional, R as DocumentAddress, S as Draft, T as snapshot, U as Infer, V as DocumentTreeNode, W as ObjectSchema, X as map, Y as list, Z as object, _ as Unsubscribe, a as DocumentProblem, b as CollectionImpact, c as HistoryState, d as OperationResult, et as tree, f as ReadonlyDocument, g as Readable, h as TransactionResult, i as DocumentDisposedError, j as ParseIssue, k as ValueTransition, l as LocalHistory, m as TransactionRejected, n as DocumentCommit, o as DocumentReentrancyError, p as Synchronous, q as Validator, r as DocumentDiagnostic, s as DocumentRuntime, t as CommitSource, tt as variant, u as ObserverError, v as MutationIssue, w as replace, x as DocumentImpact, y as MutationIssueCode, z as DocumentAnchor } from "./contract-
|
|
2
|
-
import { d as ExternalCollectionRead, f as ExternalCollectionSource, g as ProjectionError, h as ProjectionDisposedError, i as
|
|
1
|
+
import { $ as table, A as ParseError, B as DocumentListConfig, C as Read, D as ChangeSet, E as Change, F as CollectionPath, G as ReadonlyValue, H as DocumentTreeValue, I as PathValueOf, J as field, K as Schema, L as SchemaPath, M as parse, N as CollectionEntry, O as MemberChange, P as CollectionId, Q as optional, R as DocumentAddress, S as Draft, T as snapshot, U as Infer, V as DocumentTreeNode, W as ObjectSchema, X as map, Y as list, Z as object, _ as Unsubscribe, a as DocumentProblem, b as CollectionImpact, c as HistoryState, d as OperationResult, et as tree, f as ReadonlyDocument, g as Readable, h as TransactionResult, i as DocumentDisposedError, j as ParseIssue, k as ValueTransition, l as LocalHistory, m as TransactionRejected, n as DocumentCommit, o as DocumentReentrancyError, p as Synchronous, q as Validator, r as DocumentDiagnostic, s as DocumentRuntime, t as CommitSource, tt as variant, u as ObserverError, v as MutationIssue, w as replace, x as DocumentImpact, y as MutationIssueCode, z as DocumentAnchor } from "./contract-CNR6BS75.cjs";
|
|
2
|
+
import { a as Projection, d as ExternalCollectionRead, f as ExternalCollectionSource, g as ProjectionError, h as ProjectionDisposedError, i as KeyedProjection, m as ExternalValueSource, n as CollectionInputDraft, p as ExternalValueEvent, r as Input, t as CollectionInput, u as ExternalCollectionEvent } from "./definition-CDOuvb5C.cjs";
|
|
3
3
|
|
|
4
4
|
//#region core/src/runtime.d.ts
|
|
5
5
|
declare const createDocument: <S extends ObjectSchema<object>>(input: {
|
|
@@ -24,16 +24,15 @@ declare const input: (<T>(initial: T, equality?: (previous: T, next: T) => boole
|
|
|
24
24
|
/** Establish a lazy reactive boundary from a document, readable, or external source. */
|
|
25
25
|
declare function observe<S extends ObjectSchema<object>>(document: ReadonlyDocument<S>): Projection<Infer<S>>;
|
|
26
26
|
declare function observe<T>(source: ExternalValueSource<T>): Projection<T>;
|
|
27
|
-
declare function observe<K extends string, V>(source: ExternalCollectionSource<K, V>):
|
|
27
|
+
declare function observe<K extends string, V>(source: ExternalCollectionSource<K, V>): KeyedProjection<K, V>;
|
|
28
28
|
declare function observe<T>(readable: Readable<T>): Projection<T>;
|
|
29
|
-
declare function observe<S extends ObjectSchema<object>, P extends CollectionPath>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P):
|
|
29
|
+
declare function observe<S extends ObjectSchema<object>, P extends CollectionPath>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): KeyedProjection<CollectionId<P>, ReadonlyValue<CollectionEntry<P>>>;
|
|
30
30
|
declare function observe<S extends ObjectSchema<object>, P>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): Projection<PathValueOf<P>>;
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region core/src/projection/derive.d.ts
|
|
33
33
|
type ProjectionDependencies = Readonly<Record<string, Projection<unknown>>>;
|
|
34
34
|
type ProjectionValues<D extends ProjectionDependencies> = { readonly [K in keyof D]: D[K] extends Projection<infer T> ? T : never };
|
|
35
35
|
type Equality<T> = (previous: T, next: T) => boolean;
|
|
36
|
-
type KeyedProjection<K extends string, V> = ProjectionWithChange<ReadonlyMap<K, V>, CollectionChange<K, V>>;
|
|
37
36
|
/** A declared dynamic lookup from one driver entry to one key in another keyed projection. */
|
|
38
37
|
type KeyedDependency<DriverKey extends string, DriverValue, SourceKey extends string = string, SourceValue = unknown> = {
|
|
39
38
|
readonly source: KeyedProjection<SourceKey, SourceValue>;
|
|
@@ -87,5 +86,5 @@ declare const createProjectionRuntime: (options?: {
|
|
|
87
86
|
readonly onError?: (error: ProjectionError) => void;
|
|
88
87
|
}) => ProjectionRuntime;
|
|
89
88
|
//#endregion
|
|
90
|
-
export { type Change, type ChangeSet, type CollectionImpact, type CollectionInput, type CollectionInputDraft, type CommitSource, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentProblem, DocumentReentrancyError, type DocumentRuntime, type DocumentSelector, type DocumentTreeNode, type DocumentTreeValue, type Draft, type ExternalCollectionEvent, type ExternalCollectionRead, type ExternalCollectionSource, type ExternalValueEvent, type ExternalValueSource, type HistoryState, type Infer, type Input, type LocalHistory, type MemberChange, type MutationIssue, type MutationIssueCode, type ObjectSchema, type ObserverError, type OperationResult, ParseError, type ParseIssue, type PathValueOf, type Projection, ProjectionDisposedError, ProjectionError, type ProjectionRuntime, type ProjectionScope, type Read, type Readable, type ReadonlyDocument, type ReadonlyValue, type Schema, type SchemaPath, TransactionRejected, type TransactionResult, type Unsubscribe, type Validator, type ValueTransition, createDocument, createProjectionRuntime, derive, field, input, list, map, object, observe, optional, parse, read, replace, select, snapshot, table, tree, variant };
|
|
89
|
+
export { type Change, type ChangeSet, type CollectionImpact, type CollectionInput, type CollectionInputDraft, type CommitSource, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentProblem, DocumentReentrancyError, type DocumentRuntime, type DocumentSelector, type DocumentTreeNode, type DocumentTreeValue, type Draft, type ExternalCollectionEvent, type ExternalCollectionRead, type ExternalCollectionSource, type ExternalValueEvent, type ExternalValueSource, type HistoryState, type Infer, type Input, type KeyedProjection, type LocalHistory, type MemberChange, type MutationIssue, type MutationIssueCode, type ObjectSchema, type ObserverError, type OperationResult, ParseError, type ParseIssue, type PathValueOf, type Projection, ProjectionDisposedError, ProjectionError, type ProjectionRuntime, type ProjectionScope, type Read, type Readable, type ReadonlyDocument, type ReadonlyValue, type Schema, type SchemaPath, TransactionRejected, type TransactionResult, type Unsubscribe, type Validator, type ValueTransition, createDocument, createProjectionRuntime, derive, field, input, list, map, object, observe, optional, parse, read, replace, select, snapshot, table, tree, variant };
|
|
91
90
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as table, A as ParseError, B as DocumentListConfig, C as Read, D as ChangeSet, E as Change, F as CollectionPath, G as ReadonlyValue, H as DocumentTreeValue, I as PathValueOf, J as field, K as Schema, L as SchemaPath, M as parse, N as CollectionEntry, O as MemberChange, P as CollectionId, Q as optional, R as DocumentAddress, S as Draft, T as snapshot, U as Infer, V as DocumentTreeNode, W as ObjectSchema, X as map, Y as list, Z as object, _ as Unsubscribe, a as DocumentProblem, b as CollectionImpact, c as HistoryState, d as OperationResult, et as tree, f as ReadonlyDocument, g as Readable, h as TransactionResult, i as DocumentDisposedError, j as ParseIssue, k as ValueTransition, l as LocalHistory, m as TransactionRejected, n as DocumentCommit, o as DocumentReentrancyError, p as Synchronous, q as Validator, r as DocumentDiagnostic, s as DocumentRuntime, t as CommitSource, tt as variant, u as ObserverError, v as MutationIssue, w as replace, x as DocumentImpact, y as MutationIssueCode, z as DocumentAnchor } from "./contract-
|
|
2
|
-
import { d as ExternalCollectionRead, f as ExternalCollectionSource, g as ProjectionError, h as ProjectionDisposedError, i as
|
|
1
|
+
import { $ as table, A as ParseError, B as DocumentListConfig, C as Read, D as ChangeSet, E as Change, F as CollectionPath, G as ReadonlyValue, H as DocumentTreeValue, I as PathValueOf, J as field, K as Schema, L as SchemaPath, M as parse, N as CollectionEntry, O as MemberChange, P as CollectionId, Q as optional, R as DocumentAddress, S as Draft, T as snapshot, U as Infer, V as DocumentTreeNode, W as ObjectSchema, X as map, Y as list, Z as object, _ as Unsubscribe, a as DocumentProblem, b as CollectionImpact, c as HistoryState, d as OperationResult, et as tree, f as ReadonlyDocument, g as Readable, h as TransactionResult, i as DocumentDisposedError, j as ParseIssue, k as ValueTransition, l as LocalHistory, m as TransactionRejected, n as DocumentCommit, o as DocumentReentrancyError, p as Synchronous, q as Validator, r as DocumentDiagnostic, s as DocumentRuntime, t as CommitSource, tt as variant, u as ObserverError, v as MutationIssue, w as replace, x as DocumentImpact, y as MutationIssueCode, z as DocumentAnchor } from "./contract-COgxO5sv.js";
|
|
2
|
+
import { a as Projection, d as ExternalCollectionRead, f as ExternalCollectionSource, g as ProjectionError, h as ProjectionDisposedError, i as KeyedProjection, m as ExternalValueSource, n as CollectionInputDraft, p as ExternalValueEvent, r as Input, t as CollectionInput, u as ExternalCollectionEvent } from "./definition-xgk3YNBp.js";
|
|
3
3
|
|
|
4
4
|
//#region core/src/runtime.d.ts
|
|
5
5
|
declare const createDocument: <S extends ObjectSchema<object>>(input: {
|
|
@@ -24,16 +24,15 @@ declare const input: (<T>(initial: T, equality?: (previous: T, next: T) => boole
|
|
|
24
24
|
/** Establish a lazy reactive boundary from a document, readable, or external source. */
|
|
25
25
|
declare function observe<S extends ObjectSchema<object>>(document: ReadonlyDocument<S>): Projection<Infer<S>>;
|
|
26
26
|
declare function observe<T>(source: ExternalValueSource<T>): Projection<T>;
|
|
27
|
-
declare function observe<K extends string, V>(source: ExternalCollectionSource<K, V>):
|
|
27
|
+
declare function observe<K extends string, V>(source: ExternalCollectionSource<K, V>): KeyedProjection<K, V>;
|
|
28
28
|
declare function observe<T>(readable: Readable<T>): Projection<T>;
|
|
29
|
-
declare function observe<S extends ObjectSchema<object>, P extends CollectionPath>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P):
|
|
29
|
+
declare function observe<S extends ObjectSchema<object>, P extends CollectionPath>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): KeyedProjection<CollectionId<P>, ReadonlyValue<CollectionEntry<P>>>;
|
|
30
30
|
declare function observe<S extends ObjectSchema<object>, P>(document: ReadonlyDocument<S>, selector: (path: SchemaPath<S>) => P): Projection<PathValueOf<P>>;
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region core/src/projection/derive.d.ts
|
|
33
33
|
type ProjectionDependencies = Readonly<Record<string, Projection<unknown>>>;
|
|
34
34
|
type ProjectionValues<D extends ProjectionDependencies> = { readonly [K in keyof D]: D[K] extends Projection<infer T> ? T : never };
|
|
35
35
|
type Equality<T> = (previous: T, next: T) => boolean;
|
|
36
|
-
type KeyedProjection<K extends string, V> = ProjectionWithChange<ReadonlyMap<K, V>, CollectionChange<K, V>>;
|
|
37
36
|
/** A declared dynamic lookup from one driver entry to one key in another keyed projection. */
|
|
38
37
|
type KeyedDependency<DriverKey extends string, DriverValue, SourceKey extends string = string, SourceValue = unknown> = {
|
|
39
38
|
readonly source: KeyedProjection<SourceKey, SourceValue>;
|
|
@@ -87,5 +86,5 @@ declare const createProjectionRuntime: (options?: {
|
|
|
87
86
|
readonly onError?: (error: ProjectionError) => void;
|
|
88
87
|
}) => ProjectionRuntime;
|
|
89
88
|
//#endregion
|
|
90
|
-
export { type Change, type ChangeSet, type CollectionImpact, type CollectionInput, type CollectionInputDraft, type CommitSource, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentProblem, DocumentReentrancyError, type DocumentRuntime, type DocumentSelector, type DocumentTreeNode, type DocumentTreeValue, type Draft, type ExternalCollectionEvent, type ExternalCollectionRead, type ExternalCollectionSource, type ExternalValueEvent, type ExternalValueSource, type HistoryState, type Infer, type Input, type LocalHistory, type MemberChange, type MutationIssue, type MutationIssueCode, type ObjectSchema, type ObserverError, type OperationResult, ParseError, type ParseIssue, type PathValueOf, type Projection, ProjectionDisposedError, ProjectionError, type ProjectionRuntime, type ProjectionScope, type Read, type Readable, type ReadonlyDocument, type ReadonlyValue, type Schema, type SchemaPath, TransactionRejected, type TransactionResult, type Unsubscribe, type Validator, type ValueTransition, createDocument, createProjectionRuntime, derive, field, input, list, map, object, observe, optional, parse, read, replace, select, snapshot, table, tree, variant };
|
|
89
|
+
export { type Change, type ChangeSet, type CollectionImpact, type CollectionInput, type CollectionInputDraft, type CommitSource, type DocumentAddress, type DocumentAnchor, type DocumentCommit, type DocumentDiagnostic, DocumentDisposedError, type DocumentImpact, type DocumentListConfig, type DocumentProblem, DocumentReentrancyError, type DocumentRuntime, type DocumentSelector, type DocumentTreeNode, type DocumentTreeValue, type Draft, type ExternalCollectionEvent, type ExternalCollectionRead, type ExternalCollectionSource, type ExternalValueEvent, type ExternalValueSource, type HistoryState, type Infer, type Input, type KeyedProjection, type LocalHistory, type MemberChange, type MutationIssue, type MutationIssueCode, type ObjectSchema, type ObserverError, type OperationResult, ParseError, type ParseIssue, type PathValueOf, type Projection, ProjectionDisposedError, ProjectionError, type ProjectionRuntime, type ProjectionScope, type Read, type Readable, type ReadonlyDocument, type ReadonlyValue, type Schema, type SchemaPath, TransactionRejected, type TransactionResult, type Unsubscribe, type Validator, type ValueTransition, createDocument, createProjectionRuntime, derive, field, input, list, map, object, observe, optional, parse, read, replace, select, snapshot, table, tree, variant };
|
|
91
90
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const field = (validator) => node$2({
|
|
|
9
9
|
kind: "field",
|
|
10
10
|
...validator ? { validator } : {}
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
function optional(value) {
|
|
13
13
|
const concrete = schemaNodeOf(value);
|
|
14
14
|
if (![
|
|
15
15
|
"field",
|
|
@@ -22,7 +22,7 @@ const optional = (value) => {
|
|
|
22
22
|
...concrete,
|
|
23
23
|
optional: true
|
|
24
24
|
});
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
const object = (shape) => node$2({
|
|
27
27
|
kind: "object",
|
|
28
28
|
shape: Object.freeze(Object.fromEntries(Object.entries(shape).map(([key, value]) => [key, schemaNodeOf(value)])))
|