tablinum 0.4.0 → 0.6.0
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/crud/collection-handle.d.ts +2 -1
- package/dist/db/create-tablinum.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1383 -907
- package/dist/services/Config.d.ts +2 -0
- package/dist/storage/idb.d.ts +0 -1
- package/dist/svelte/collection.svelte.d.ts +2 -1
- package/dist/svelte/index.svelte.js +1458 -952
- package/dist/sync/compact-event.d.ts +3 -0
- package/dist/sync/sync-service.d.ts +4 -1
- package/package.json +8 -27
- package/README.md +0 -238
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Effect, Option, Stream } from "effect";
|
|
2
|
+
import type { LogLevel } from "effect";
|
|
2
3
|
import type { CollectionDef, CollectionFields } from "../schema/collection.ts";
|
|
3
4
|
import type { InferRecord } from "../schema/types.ts";
|
|
4
5
|
import type { RecordValidator, PartialValidator } from "../schema/validate.ts";
|
|
@@ -20,4 +21,4 @@ export interface CollectionHandle<C extends CollectionDef<CollectionFields>> {
|
|
|
20
21
|
readonly orderBy: (field: string & keyof Omit<InferRecord<C>, "id">) => QueryBuilder<InferRecord<C>>;
|
|
21
22
|
}
|
|
22
23
|
export type OnWriteCallback = (event: StoredEvent) => Effect.Effect<void, StorageError>;
|
|
23
|
-
export declare function createCollectionHandle<C extends CollectionDef<CollectionFields>>(def: C, storage: IDBStorageHandle, watchCtx: WatchContext, validator: RecordValidator<C["fields"]>, partialValidator: PartialValidator<C["fields"]>, makeEventId: () => string, localAuthor?: string, onWrite?: OnWriteCallback): CollectionHandle<C>;
|
|
24
|
+
export declare function createCollectionHandle<C extends CollectionDef<CollectionFields>>(def: C, storage: IDBStorageHandle, watchCtx: WatchContext, validator: RecordValidator<C["fields"]>, partialValidator: PartialValidator<C["fields"]>, makeEventId: () => string, localAuthor?: string, onWrite?: OnWriteCallback, logLevel?: LogLevel.LogLevel): CollectionHandle<C>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { Effect, Scope } from "effect";
|
|
2
|
+
import type { LogLevel } from "effect";
|
|
2
3
|
import type { SchemaConfig } from "../schema/types.ts";
|
|
3
4
|
import type { DatabaseHandle } from "./database-handle.ts";
|
|
4
5
|
import type { EpochKeyInput } from "./epoch.ts";
|
|
5
6
|
import { CryptoError, StorageError, ValidationError } from "../errors.ts";
|
|
7
|
+
export type TablinumLogLevel = "debug" | "info" | "warning" | "error" | "none" | LogLevel.LogLevel;
|
|
8
|
+
export declare function resolveLogLevel(input: TablinumLogLevel | undefined): LogLevel.LogLevel;
|
|
6
9
|
export interface TablinumConfig<S extends SchemaConfig> {
|
|
7
10
|
readonly schema: S;
|
|
8
11
|
readonly relays: readonly string[];
|
|
9
12
|
readonly privateKey?: Uint8Array | undefined;
|
|
10
13
|
readonly epochKeys?: ReadonlyArray<EpochKeyInput> | undefined;
|
|
11
14
|
readonly dbName?: string | undefined;
|
|
15
|
+
readonly logLevel?: TablinumLogLevel | undefined;
|
|
12
16
|
readonly onSyncError?: ((error: Error) => void) | undefined;
|
|
13
17
|
readonly onRemoved?: ((info: {
|
|
14
18
|
epochId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export type { CollectionDef, CollectionFields } from "./schema/collection.ts";
|
|
|
4
4
|
export type { FieldDef, FieldKind } from "./schema/field.ts";
|
|
5
5
|
export type { InferRecord, SchemaConfig } from "./schema/types.ts";
|
|
6
6
|
export { createTablinum } from "./db/create-tablinum.ts";
|
|
7
|
-
export type { TablinumConfig } from "./db/create-tablinum.ts";
|
|
7
|
+
export type { TablinumConfig, TablinumLogLevel } from "./db/create-tablinum.ts";
|
|
8
|
+
export { LogLevel } from "effect";
|
|
8
9
|
export type { DatabaseHandle, SyncStatus } from "./db/database-handle.ts";
|
|
9
10
|
export { encodeInvite, decodeInvite } from "./db/invite.ts";
|
|
10
11
|
export type { Invite } from "./db/invite.ts";
|