@event-driven-io/emmett-sqlite 0.43.0-alpha.3 → 0.43.0-alpha.4
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/cli.d.cts +2 -2
- package/dist/cli.d.ts +2 -2
- package/dist/cloudflare.cjs +16 -1
- package/dist/cloudflare.cjs.map +1 -1
- package/dist/cloudflare.d.cts +16 -1
- package/dist/cloudflare.d.ts +16 -1
- package/dist/cloudflare.js +17 -2
- package/dist/cloudflare.js.map +1 -1
- package/dist/index.cjs +5 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -162
- package/dist/index.d.ts +9 -162
- package/dist/index.js +8 -18
- package/dist/index.js.map +1 -1
- package/dist/sqlite3.cjs +13 -1
- package/dist/sqlite3.cjs.map +1 -1
- package/dist/sqlite3.d.cts +15 -1
- package/dist/sqlite3.d.ts +15 -1
- package/dist/sqlite3.js +14 -2
- package/dist/sqlite3.js.map +1 -1
- package/dist/sqliteProjection-CFGjb8aY.d.cts +172 -0
- package/dist/sqliteProjection-CFGjb8aY.d.ts +172 -0
- package/package.json +3 -3
package/dist/cli.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
export { }
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
|
|
2
|
+
export { }
|
package/dist/cloudflare.cjs
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/cloudflare.ts
|
|
2
|
+
|
|
3
|
+
|
|
2
4
|
var _cloudflare = require('@event-driven-io/dumbo/cloudflare');
|
|
5
|
+
var d1EventStoreDriver = {
|
|
6
|
+
driverType: _cloudflare.d1DumboDriver.driverType,
|
|
7
|
+
dumboDriver: _cloudflare.d1DumboDriver,
|
|
8
|
+
mapToDumboOptions: (driverOptions) => ({
|
|
9
|
+
driver: _cloudflare.d1DumboDriver,
|
|
10
|
+
database: driverOptions.database,
|
|
11
|
+
...driverOptions.connectionOptions,
|
|
12
|
+
transactionOptions: {
|
|
13
|
+
allowNestedTransactions: true,
|
|
14
|
+
mode: "session_based"
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
};
|
|
3
18
|
|
|
4
19
|
|
|
5
|
-
exports.d1EventStoreDriver =
|
|
20
|
+
exports.d1EventStoreDriver = d1EventStoreDriver;
|
|
6
21
|
//# sourceMappingURL=cloudflare.cjs.map
|
package/dist/cloudflare.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/emmett/emmett/src/packages/emmett-sqlite/dist/cloudflare.cjs","../src/cloudflare.ts"],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/emmett/emmett/src/packages/emmett-sqlite/dist/cloudflare.cjs","../src/cloudflare.ts"],"names":[],"mappings":"AAAA;ACCA;AACE;AAAA,+DAEK;AAIA,IAAM,mBAAA,EAGT;AAAA,EACF,UAAA,EAAY,yBAAA,CAAc,UAAA;AAAA,EAC1B,WAAA,EAAa,yBAAA;AAAA,EACb,iBAAA,EAAmB,CAAC,aAAA,EAAA,GAAA,CAAmB;AAAA,IACrC,MAAA,EAAQ,yBAAA;AAAA,IACR,QAAA,EAAU,aAAA,CAAc,QAAA;AAAA,IACxB,GAAG,aAAA,CAAc,iBAAA;AAAA,IACjB,kBAAA,EAAoB;AAAA,MAClB,uBAAA,EAAyB,IAAA;AAAA,MACzB,IAAA,EAAM;AAAA,IACR;AAAA,EACF,CAAA;AACF,CAAA;ADNA;AACE;AACF,gDAAC","file":"/home/runner/work/emmett/emmett/src/packages/emmett-sqlite/dist/cloudflare.cjs","sourcesContent":[null,"import type { D1Database } from '@cloudflare/workers-types';\nimport {\n d1DumboDriver,\n type D1PoolOptions,\n} from '@event-driven-io/dumbo/cloudflare';\nimport type { SQLiteEventStoreOptions } from './eventStore';\nimport type { EventStoreDriver } from './eventStore/eventStoreDriver';\n\nexport const d1EventStoreDriver: EventStoreDriver<\n typeof d1DumboDriver,\n D1EventStoreDriverOptions\n> = {\n driverType: d1DumboDriver.driverType,\n dumboDriver: d1DumboDriver,\n mapToDumboOptions: (driverOptions) => ({\n driver: d1DumboDriver,\n database: driverOptions.database,\n ...driverOptions.connectionOptions,\n transactionOptions: {\n allowNestedTransactions: true,\n mode: 'session_based',\n },\n }),\n};\n\nexport type D1EventStoreDriver = typeof d1EventStoreDriver;\n\nexport type D1EventStoreDriverOptions = {\n database: D1Database;\n connectionOptions?: Omit<D1PoolOptions, 'database'>;\n};\n\nexport type D1EventStoreOptions = SQLiteEventStoreOptions<D1EventStoreDriver>;\n"]}
|
package/dist/cloudflare.d.cts
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { D1Database } from '@cloudflare/workers-types';
|
|
2
|
+
import { d1DumboDriver, D1PoolOptions } from '@event-driven-io/dumbo/cloudflare';
|
|
3
|
+
import { E as EventStoreDriver, S as SQLiteEventStoreOptions } from './sqliteProjection-CFGjb8aY.cjs';
|
|
4
|
+
import '@event-driven-io/dumbo';
|
|
5
|
+
import '@event-driven-io/dumbo/sqlite';
|
|
6
|
+
import '@event-driven-io/emmett';
|
|
7
|
+
|
|
8
|
+
declare const d1EventStoreDriver: EventStoreDriver<typeof d1DumboDriver, D1EventStoreDriverOptions>;
|
|
9
|
+
type D1EventStoreDriver = typeof d1EventStoreDriver;
|
|
10
|
+
type D1EventStoreDriverOptions = {
|
|
11
|
+
database: D1Database;
|
|
12
|
+
connectionOptions?: Omit<D1PoolOptions, 'database'>;
|
|
13
|
+
};
|
|
14
|
+
type D1EventStoreOptions = SQLiteEventStoreOptions<D1EventStoreDriver>;
|
|
15
|
+
|
|
16
|
+
export { type D1EventStoreDriver, type D1EventStoreDriverOptions, type D1EventStoreOptions, d1EventStoreDriver };
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { D1Database } from '@cloudflare/workers-types';
|
|
2
|
+
import { d1DumboDriver, D1PoolOptions } from '@event-driven-io/dumbo/cloudflare';
|
|
3
|
+
import { E as EventStoreDriver, S as SQLiteEventStoreOptions } from './sqliteProjection-CFGjb8aY.js';
|
|
4
|
+
import '@event-driven-io/dumbo';
|
|
5
|
+
import '@event-driven-io/dumbo/sqlite';
|
|
6
|
+
import '@event-driven-io/emmett';
|
|
7
|
+
|
|
8
|
+
declare const d1EventStoreDriver: EventStoreDriver<typeof d1DumboDriver, D1EventStoreDriverOptions>;
|
|
9
|
+
type D1EventStoreDriver = typeof d1EventStoreDriver;
|
|
10
|
+
type D1EventStoreDriverOptions = {
|
|
11
|
+
database: D1Database;
|
|
12
|
+
connectionOptions?: Omit<D1PoolOptions, 'database'>;
|
|
13
|
+
};
|
|
14
|
+
type D1EventStoreOptions = SQLiteEventStoreOptions<D1EventStoreDriver>;
|
|
15
|
+
|
|
16
|
+
export { type D1EventStoreDriver, type D1EventStoreDriverOptions, type D1EventStoreOptions, d1EventStoreDriver };
|
package/dist/cloudflare.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
// src/cloudflare.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
d1DumboDriver
|
|
4
|
+
} from "@event-driven-io/dumbo/cloudflare";
|
|
5
|
+
var d1EventStoreDriver = {
|
|
6
|
+
driverType: d1DumboDriver.driverType,
|
|
7
|
+
dumboDriver: d1DumboDriver,
|
|
8
|
+
mapToDumboOptions: (driverOptions) => ({
|
|
9
|
+
driver: d1DumboDriver,
|
|
10
|
+
database: driverOptions.database,
|
|
11
|
+
...driverOptions.connectionOptions,
|
|
12
|
+
transactionOptions: {
|
|
13
|
+
allowNestedTransactions: true,
|
|
14
|
+
mode: "session_based"
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
};
|
|
3
18
|
export {
|
|
4
|
-
|
|
19
|
+
d1EventStoreDriver
|
|
5
20
|
};
|
|
6
21
|
//# sourceMappingURL=cloudflare.js.map
|
package/dist/cloudflare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cloudflare.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/cloudflare.ts"],"sourcesContent":["import type { D1Database } from '@cloudflare/workers-types';\nimport {\n d1DumboDriver,\n type D1PoolOptions,\n} from '@event-driven-io/dumbo/cloudflare';\nimport type { SQLiteEventStoreOptions } from './eventStore';\nimport type { EventStoreDriver } from './eventStore/eventStoreDriver';\n\nexport const d1EventStoreDriver: EventStoreDriver<\n typeof d1DumboDriver,\n D1EventStoreDriverOptions\n> = {\n driverType: d1DumboDriver.driverType,\n dumboDriver: d1DumboDriver,\n mapToDumboOptions: (driverOptions) => ({\n driver: d1DumboDriver,\n database: driverOptions.database,\n ...driverOptions.connectionOptions,\n transactionOptions: {\n allowNestedTransactions: true,\n mode: 'session_based',\n },\n }),\n};\n\nexport type D1EventStoreDriver = typeof d1EventStoreDriver;\n\nexport type D1EventStoreDriverOptions = {\n database: D1Database;\n connectionOptions?: Omit<D1PoolOptions, 'database'>;\n};\n\nexport type D1EventStoreOptions = SQLiteEventStoreOptions<D1EventStoreDriver>;\n"],"mappings":";AACA;AAAA,EACE;AAAA,OAEK;AAIA,IAAM,qBAGT;AAAA,EACF,YAAY,cAAc;AAAA,EAC1B,aAAa;AAAA,EACb,mBAAmB,CAAC,mBAAmB;AAAA,IACrC,QAAQ;AAAA,IACR,UAAU,cAAc;AAAA,IACxB,GAAG,cAAc;AAAA,IACjB,oBAAoB;AAAA,MAClB,yBAAyB;AAAA,MACzB,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -515,19 +515,13 @@ var sqliteRawSQLProjection = (options) => {
|
|
|
515
515
|
};
|
|
516
516
|
|
|
517
517
|
// src/eventStore/projections/sqliteProjectionSpec.ts
|
|
518
|
-
|
|
519
|
-
|
|
520
518
|
var _dumbo = require('@event-driven-io/dumbo');
|
|
521
519
|
|
|
522
520
|
var SQLiteProjectionSpec = {
|
|
523
521
|
for: (options) => {
|
|
524
522
|
{
|
|
525
523
|
const pool = _nullishCoalesce(options.pool, () => ( _dumbo.dumbo.call(void 0, {
|
|
526
|
-
|
|
527
|
-
allowNestedTransactions: true,
|
|
528
|
-
mode: "session_based"
|
|
529
|
-
},
|
|
530
|
-
...options
|
|
524
|
+
...options.driver.mapToDumboOptions(options)
|
|
531
525
|
})));
|
|
532
526
|
const projection2 = options.projection;
|
|
533
527
|
let wasInitialized = false;
|
|
@@ -1061,8 +1055,6 @@ var readProcessorCheckpoint = async (execute, options) => {
|
|
|
1061
1055
|
// src/eventStore/SQLiteEventStore.ts
|
|
1062
1056
|
|
|
1063
1057
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
1058
|
// src/eventStore/consumers/messageBatchProcessing/index.ts
|
|
1067
1059
|
var DefaultSQLiteEventStoreProcessorBatchSize = 100;
|
|
1068
1060
|
var DefaultSQLiteEventStoreProcessorPullingFrequencyInMs = 50;
|
|
@@ -1132,8 +1124,6 @@ var zipSQLiteEventStoreMessageBatchPullerStartFrom = (options) => {
|
|
|
1132
1124
|
// src/eventStore/consumers/sqliteEventStoreConsumer.ts
|
|
1133
1125
|
|
|
1134
1126
|
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
1127
|
// src/eventStore/consumers/sqliteProcessor.ts
|
|
1138
1128
|
var genericSQLiteProcessor = (options) => {
|
|
1139
1129
|
const { eachMessage } = options;
|
|
@@ -1225,11 +1215,11 @@ var sqliteEventStoreConsumer = (options) => {
|
|
|
1225
1215
|
let start;
|
|
1226
1216
|
let currentMessagePuller;
|
|
1227
1217
|
const pool = _nullishCoalesce(options.pool, () => ( _dumbo.dumbo.call(void 0, {
|
|
1218
|
+
...options.driver.mapToDumboOptions(options),
|
|
1228
1219
|
transactionOptions: {
|
|
1229
1220
|
allowNestedTransactions: true,
|
|
1230
1221
|
mode: "session_based"
|
|
1231
|
-
}
|
|
1232
|
-
...options
|
|
1222
|
+
}
|
|
1233
1223
|
})));
|
|
1234
1224
|
const eachBatch = (messagesBatch) => pool.withConnection(async (connection) => {
|
|
1235
1225
|
const activeProcessors = processors.filter((s) => s.isActive);
|
|
@@ -1309,11 +1299,11 @@ var SQLiteEventStoreDefaultStreamVersion = 0n;
|
|
|
1309
1299
|
var getSQLiteEventStore = (options) => {
|
|
1310
1300
|
let autoGenerateSchema = false;
|
|
1311
1301
|
const pool = _nullishCoalesce(options.pool, () => ( _dumbo.dumbo.call(void 0, {
|
|
1302
|
+
...options.driver.mapToDumboOptions(options),
|
|
1312
1303
|
transactionOptions: {
|
|
1313
1304
|
allowNestedTransactions: true,
|
|
1314
1305
|
mode: "session_based"
|
|
1315
|
-
}
|
|
1316
|
-
...options
|
|
1306
|
+
}
|
|
1317
1307
|
})));
|
|
1318
1308
|
let migrateSchema = void 0;
|
|
1319
1309
|
const inlineProjections = (_nullishCoalesce(options.projections, () => ( []))).filter(({ type }) => type === "inline").map(({ projection: projection2 }) => projection2);
|