@event-driven-io/emmett-sqlite 0.43.0-alpha.4 → 0.43.0-beta.1
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/cloudflare.d.cts +1 -1
- package/dist/cloudflare.d.ts +1 -1
- package/dist/index.cjs +514 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -24
- package/dist/index.d.ts +19 -24
- package/dist/index.js +482 -190
- package/dist/index.js.map +1 -1
- package/dist/sqlite3.d.cts +1 -1
- package/dist/sqlite3.d.ts +1 -1
- package/dist/sqliteProjection-V1lU-4KS.d.cts +146 -0
- package/dist/sqliteProjection-V1lU-4KS.d.ts +146 -0
- package/package.json +3 -3
- package/dist/sqliteProjection-CFGjb8aY.d.cts +0 -172
- package/dist/sqliteProjection-CFGjb8aY.d.ts +0 -172
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { a as SQLiteEventStore,
|
|
2
|
-
export {
|
|
1
|
+
import { a as SQLiteEventStore, b as SQLiteReadEventMetadata, A as AnyEventStoreDriver, c as SQLiteProjectionDefinition, I as InferOptionsFromEventStoreDriver } from './sqliteProjection-V1lU-4KS.cjs';
|
|
2
|
+
export { C as CreateEventStoreSchemaOptions, v as EventHandler, t as EventStoreSchemaMigrationOptions, w as SQLiteEventStoreDefaultStreamVersion, S as SQLiteEventStoreOptions, e as SQLiteProjectionHandler, d as SQLiteProjectionHandlerContext, f as SQLiteProjectionHandlerOptions, g as SQLiteRawBatchSQLProjection, j as SQLiteRawSQLProjection, x as SQLiteReadEvent, l as SQLiteStreamExistsOptions, u as createEventStoreSchema, y as getSQLiteEventStore, h as handleProjections, o as messagesTableSQL, p as processorsTableSQL, q as projectionsTableSQL, r as schemaSQL, s as sqliteProjection, i as sqliteRawBatchSQLProjection, k as sqliteRawSQLProjection, m as streamExists, n as streamsTableSQL } from './sqliteProjection-V1lU-4KS.cjs';
|
|
3
|
+
import * as _event_driven_io_emmett from '@event-driven-io/emmett';
|
|
4
|
+
import { Event, AppendToStreamOptions, BeforeEventStoreCommitHandler, Message, RecordedMessageMetadata, RecordedMessage, RecordedMessageMetadataWithGlobalPosition, ProcessorCheckpoint, ReadStreamOptions, ReadStreamResult, ReadEventMetadataWithGlobalPosition, ThenThrows } from '@event-driven-io/emmett';
|
|
3
5
|
import { SQL, SQLExecutor, Dumbo, QueryResultRow } from '@event-driven-io/dumbo';
|
|
4
6
|
import { AnySQLiteConnection } from '@event-driven-io/dumbo/sqlite';
|
|
5
|
-
import { Event, AppendToStreamOptions, BeforeEventStoreCommitHandler, ReadEventMetadata, ReadEvent, ReadEventMetadataWithGlobalPosition, ReadStreamOptions, BigIntStreamPosition, ReadStreamResult, ThenThrows } from '@event-driven-io/emmett';
|
|
6
7
|
|
|
7
8
|
type AppendEventResult = {
|
|
8
9
|
success: true;
|
|
@@ -45,30 +46,30 @@ type ReadMessagesBatchOptions = {
|
|
|
45
46
|
from: bigint;
|
|
46
47
|
to: bigint;
|
|
47
48
|
};
|
|
48
|
-
type ReadMessagesBatchResult<
|
|
49
|
+
type ReadMessagesBatchResult<MessageType extends Message, MessageMetadataType extends RecordedMessageMetadata = RecordedMessageMetadata> = {
|
|
49
50
|
currentGlobalPosition: bigint;
|
|
50
|
-
messages:
|
|
51
|
-
|
|
51
|
+
messages: RecordedMessage<MessageType, MessageMetadataType>[];
|
|
52
|
+
areMessagesLeft: boolean;
|
|
52
53
|
};
|
|
53
|
-
declare const readMessagesBatch: <MessageType extends
|
|
54
|
+
declare const readMessagesBatch: <MessageType extends Message, RecordedMessageMetadataType extends RecordedMessageMetadataWithGlobalPosition = RecordedMessageMetadataWithGlobalPosition>(execute: SQLExecutor, options: ReadMessagesBatchOptions & {
|
|
54
55
|
partition?: string;
|
|
55
|
-
}) => Promise<ReadMessagesBatchResult<MessageType,
|
|
56
|
+
}) => Promise<ReadMessagesBatchResult<MessageType, RecordedMessageMetadataType>>;
|
|
56
57
|
|
|
57
58
|
type ReadProcessorCheckpointResult = {
|
|
58
|
-
|
|
59
|
+
lastProcessedCheckpoint: ProcessorCheckpoint | null;
|
|
59
60
|
};
|
|
60
61
|
declare const readProcessorCheckpoint: (execute: SQLExecutor, options: {
|
|
61
62
|
processorId: string;
|
|
62
63
|
partition?: string;
|
|
63
64
|
}) => Promise<ReadProcessorCheckpointResult>;
|
|
64
65
|
|
|
65
|
-
declare const readStream: <EventType extends Event, EventPayloadType extends Event = EventType>(execute: SQLExecutor, streamId: string, options?: ReadStreamOptions<
|
|
66
|
+
declare const readStream: <EventType extends Event, EventPayloadType extends Event = EventType>(execute: SQLExecutor, streamId: string, options?: ReadStreamOptions<EventType, EventPayloadType> & {
|
|
66
67
|
partition?: string;
|
|
67
68
|
}) => Promise<ReadStreamResult<EventType, ReadEventMetadataWithGlobalPosition>>;
|
|
68
69
|
|
|
69
|
-
type
|
|
70
|
+
type StoreProcessorCheckpointResult = {
|
|
70
71
|
success: true;
|
|
71
|
-
|
|
72
|
+
newCheckpoint: ProcessorCheckpoint | null;
|
|
72
73
|
} | {
|
|
73
74
|
success: false;
|
|
74
75
|
reason: 'IGNORED' | 'MISMATCH';
|
|
@@ -76,17 +77,11 @@ type StoreLastProcessedProcessorPositionResult<Position extends bigint | null =
|
|
|
76
77
|
declare function storeProcessorCheckpoint(execute: SQLExecutor, options: {
|
|
77
78
|
processorId: string;
|
|
78
79
|
version: number | undefined;
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
newCheckpoint: ProcessorCheckpoint | null;
|
|
81
|
+
lastProcessedCheckpoint: ProcessorCheckpoint | null;
|
|
81
82
|
partition?: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
declare const streamsTableSQL: SQL;
|
|
85
|
-
declare const messagesTableSQL: SQL;
|
|
86
|
-
declare const processorsTableSQL: SQL;
|
|
87
|
-
declare const projectionsTableSQL: SQL;
|
|
88
|
-
declare const schemaSQL: SQL[];
|
|
89
|
-
declare const createEventStoreSchema: (pool: AnySQLiteConnection, hooks?: SQLiteEventStoreOptions["hooks"]) => Promise<void>;
|
|
83
|
+
processorInstanceId?: string;
|
|
84
|
+
}): Promise<StoreProcessorCheckpointResult>;
|
|
90
85
|
|
|
91
86
|
declare const emmettPrefix = "emt";
|
|
92
87
|
declare const globalTag = "global";
|
|
@@ -149,7 +144,7 @@ declare const SQLiteProjectionSpec: {
|
|
|
149
144
|
};
|
|
150
145
|
declare const eventInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata = SQLiteReadEventMetadata>(streamName: string, event: SQLiteProjectionSpecEvent<EventType, EventMetaDataType>) => SQLiteProjectionSpecEvent<EventType, EventMetaDataType>;
|
|
151
146
|
declare const eventsInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata = SQLiteReadEventMetadata>(streamName: string, events: SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[]) => SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[];
|
|
152
|
-
declare const newEventsInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata =
|
|
147
|
+
declare const newEventsInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata = _event_driven_io_emmett.RecordedMessageMetadataWithGlobalPosition>(streamName: string, events: SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[]) => SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[];
|
|
153
148
|
declare const assertSQLQueryResultMatches: <T extends QueryResultRow>(sql: SQL, rows: T[]) => SQLiteProjectionAssert;
|
|
154
149
|
declare const expectSQL: {
|
|
155
150
|
query: (sql: SQL) => {
|
|
@@ -159,4 +154,4 @@ declare const expectSQL: {
|
|
|
159
154
|
};
|
|
160
155
|
};
|
|
161
156
|
|
|
162
|
-
export { type AppendEventResult, type ReadLastMessageGlobalPositionResult, type ReadMessagesBatchOptions, type ReadMessagesBatchResult, type ReadProcessorCheckpointResult, SQLiteEventStore,
|
|
157
|
+
export { type AppendEventResult, type ReadLastMessageGlobalPositionResult, type ReadMessagesBatchOptions, type ReadMessagesBatchResult, type ReadProcessorCheckpointResult, SQLiteEventStore, type SQLiteProjectionAssert, SQLiteProjectionDefinition, SQLiteProjectionSpec, type SQLiteProjectionSpecEvent, type SQLiteProjectionSpecOptions, type SQLiteProjectionSpecWhenOptions, SQLiteReadEventMetadata, type StoreProcessorCheckpointResult, appendToStream, assertSQLQueryResultMatches, defaultTag, emmettPrefix, eventInStream, eventsInStream, expectSQL, globalNames, globalTag, messagesTable, migration_0_42_0_FromSubscriptionsToProcessors, migration_0_42_0_SQLs, newEventsInStream, processorsTable, projectionsTable, readLastMessageGlobalPosition, readMessagesBatch, readProcessorCheckpoint, readStream, schema_0_41_0, schema_0_42_0, storeProcessorCheckpoint, streamsTable, unknownTag };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { a as SQLiteEventStore,
|
|
2
|
-
export {
|
|
1
|
+
import { a as SQLiteEventStore, b as SQLiteReadEventMetadata, A as AnyEventStoreDriver, c as SQLiteProjectionDefinition, I as InferOptionsFromEventStoreDriver } from './sqliteProjection-V1lU-4KS.js';
|
|
2
|
+
export { C as CreateEventStoreSchemaOptions, v as EventHandler, t as EventStoreSchemaMigrationOptions, w as SQLiteEventStoreDefaultStreamVersion, S as SQLiteEventStoreOptions, e as SQLiteProjectionHandler, d as SQLiteProjectionHandlerContext, f as SQLiteProjectionHandlerOptions, g as SQLiteRawBatchSQLProjection, j as SQLiteRawSQLProjection, x as SQLiteReadEvent, l as SQLiteStreamExistsOptions, u as createEventStoreSchema, y as getSQLiteEventStore, h as handleProjections, o as messagesTableSQL, p as processorsTableSQL, q as projectionsTableSQL, r as schemaSQL, s as sqliteProjection, i as sqliteRawBatchSQLProjection, k as sqliteRawSQLProjection, m as streamExists, n as streamsTableSQL } from './sqliteProjection-V1lU-4KS.js';
|
|
3
|
+
import * as _event_driven_io_emmett from '@event-driven-io/emmett';
|
|
4
|
+
import { Event, AppendToStreamOptions, BeforeEventStoreCommitHandler, Message, RecordedMessageMetadata, RecordedMessage, RecordedMessageMetadataWithGlobalPosition, ProcessorCheckpoint, ReadStreamOptions, ReadStreamResult, ReadEventMetadataWithGlobalPosition, ThenThrows } from '@event-driven-io/emmett';
|
|
3
5
|
import { SQL, SQLExecutor, Dumbo, QueryResultRow } from '@event-driven-io/dumbo';
|
|
4
6
|
import { AnySQLiteConnection } from '@event-driven-io/dumbo/sqlite';
|
|
5
|
-
import { Event, AppendToStreamOptions, BeforeEventStoreCommitHandler, ReadEventMetadata, ReadEvent, ReadEventMetadataWithGlobalPosition, ReadStreamOptions, BigIntStreamPosition, ReadStreamResult, ThenThrows } from '@event-driven-io/emmett';
|
|
6
7
|
|
|
7
8
|
type AppendEventResult = {
|
|
8
9
|
success: true;
|
|
@@ -45,30 +46,30 @@ type ReadMessagesBatchOptions = {
|
|
|
45
46
|
from: bigint;
|
|
46
47
|
to: bigint;
|
|
47
48
|
};
|
|
48
|
-
type ReadMessagesBatchResult<
|
|
49
|
+
type ReadMessagesBatchResult<MessageType extends Message, MessageMetadataType extends RecordedMessageMetadata = RecordedMessageMetadata> = {
|
|
49
50
|
currentGlobalPosition: bigint;
|
|
50
|
-
messages:
|
|
51
|
-
|
|
51
|
+
messages: RecordedMessage<MessageType, MessageMetadataType>[];
|
|
52
|
+
areMessagesLeft: boolean;
|
|
52
53
|
};
|
|
53
|
-
declare const readMessagesBatch: <MessageType extends
|
|
54
|
+
declare const readMessagesBatch: <MessageType extends Message, RecordedMessageMetadataType extends RecordedMessageMetadataWithGlobalPosition = RecordedMessageMetadataWithGlobalPosition>(execute: SQLExecutor, options: ReadMessagesBatchOptions & {
|
|
54
55
|
partition?: string;
|
|
55
|
-
}) => Promise<ReadMessagesBatchResult<MessageType,
|
|
56
|
+
}) => Promise<ReadMessagesBatchResult<MessageType, RecordedMessageMetadataType>>;
|
|
56
57
|
|
|
57
58
|
type ReadProcessorCheckpointResult = {
|
|
58
|
-
|
|
59
|
+
lastProcessedCheckpoint: ProcessorCheckpoint | null;
|
|
59
60
|
};
|
|
60
61
|
declare const readProcessorCheckpoint: (execute: SQLExecutor, options: {
|
|
61
62
|
processorId: string;
|
|
62
63
|
partition?: string;
|
|
63
64
|
}) => Promise<ReadProcessorCheckpointResult>;
|
|
64
65
|
|
|
65
|
-
declare const readStream: <EventType extends Event, EventPayloadType extends Event = EventType>(execute: SQLExecutor, streamId: string, options?: ReadStreamOptions<
|
|
66
|
+
declare const readStream: <EventType extends Event, EventPayloadType extends Event = EventType>(execute: SQLExecutor, streamId: string, options?: ReadStreamOptions<EventType, EventPayloadType> & {
|
|
66
67
|
partition?: string;
|
|
67
68
|
}) => Promise<ReadStreamResult<EventType, ReadEventMetadataWithGlobalPosition>>;
|
|
68
69
|
|
|
69
|
-
type
|
|
70
|
+
type StoreProcessorCheckpointResult = {
|
|
70
71
|
success: true;
|
|
71
|
-
|
|
72
|
+
newCheckpoint: ProcessorCheckpoint | null;
|
|
72
73
|
} | {
|
|
73
74
|
success: false;
|
|
74
75
|
reason: 'IGNORED' | 'MISMATCH';
|
|
@@ -76,17 +77,11 @@ type StoreLastProcessedProcessorPositionResult<Position extends bigint | null =
|
|
|
76
77
|
declare function storeProcessorCheckpoint(execute: SQLExecutor, options: {
|
|
77
78
|
processorId: string;
|
|
78
79
|
version: number | undefined;
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
newCheckpoint: ProcessorCheckpoint | null;
|
|
81
|
+
lastProcessedCheckpoint: ProcessorCheckpoint | null;
|
|
81
82
|
partition?: string;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
declare const streamsTableSQL: SQL;
|
|
85
|
-
declare const messagesTableSQL: SQL;
|
|
86
|
-
declare const processorsTableSQL: SQL;
|
|
87
|
-
declare const projectionsTableSQL: SQL;
|
|
88
|
-
declare const schemaSQL: SQL[];
|
|
89
|
-
declare const createEventStoreSchema: (pool: AnySQLiteConnection, hooks?: SQLiteEventStoreOptions["hooks"]) => Promise<void>;
|
|
83
|
+
processorInstanceId?: string;
|
|
84
|
+
}): Promise<StoreProcessorCheckpointResult>;
|
|
90
85
|
|
|
91
86
|
declare const emmettPrefix = "emt";
|
|
92
87
|
declare const globalTag = "global";
|
|
@@ -149,7 +144,7 @@ declare const SQLiteProjectionSpec: {
|
|
|
149
144
|
};
|
|
150
145
|
declare const eventInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata = SQLiteReadEventMetadata>(streamName: string, event: SQLiteProjectionSpecEvent<EventType, EventMetaDataType>) => SQLiteProjectionSpecEvent<EventType, EventMetaDataType>;
|
|
151
146
|
declare const eventsInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata = SQLiteReadEventMetadata>(streamName: string, events: SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[]) => SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[];
|
|
152
|
-
declare const newEventsInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata =
|
|
147
|
+
declare const newEventsInStream: <EventType extends Event = Event, EventMetaDataType extends SQLiteReadEventMetadata = _event_driven_io_emmett.RecordedMessageMetadataWithGlobalPosition>(streamName: string, events: SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[]) => SQLiteProjectionSpecEvent<EventType, EventMetaDataType>[];
|
|
153
148
|
declare const assertSQLQueryResultMatches: <T extends QueryResultRow>(sql: SQL, rows: T[]) => SQLiteProjectionAssert;
|
|
154
149
|
declare const expectSQL: {
|
|
155
150
|
query: (sql: SQL) => {
|
|
@@ -159,4 +154,4 @@ declare const expectSQL: {
|
|
|
159
154
|
};
|
|
160
155
|
};
|
|
161
156
|
|
|
162
|
-
export { type AppendEventResult, type ReadLastMessageGlobalPositionResult, type ReadMessagesBatchOptions, type ReadMessagesBatchResult, type ReadProcessorCheckpointResult, SQLiteEventStore,
|
|
157
|
+
export { type AppendEventResult, type ReadLastMessageGlobalPositionResult, type ReadMessagesBatchOptions, type ReadMessagesBatchResult, type ReadProcessorCheckpointResult, SQLiteEventStore, type SQLiteProjectionAssert, SQLiteProjectionDefinition, SQLiteProjectionSpec, type SQLiteProjectionSpecEvent, type SQLiteProjectionSpecOptions, type SQLiteProjectionSpecWhenOptions, SQLiteReadEventMetadata, type StoreProcessorCheckpointResult, appendToStream, assertSQLQueryResultMatches, defaultTag, emmettPrefix, eventInStream, eventsInStream, expectSQL, globalNames, globalTag, messagesTable, migration_0_42_0_FromSubscriptionsToProcessors, migration_0_42_0_SQLs, newEventsInStream, processorsTable, projectionsTable, readLastMessageGlobalPosition, readMessagesBatch, readProcessorCheckpoint, readStream, schema_0_41_0, schema_0_42_0, storeProcessorCheckpoint, streamsTable, unknownTag };
|