@powersync/web 1.31.0 → 1.33.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/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js +1878 -0
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js.map +1 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530150.index.umd.js +555 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530150.index.umd.js.map +1 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530151.index.umd.js +555 -0
- package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-2530151.index.umd.js.map +1 -0
- package/dist/index.umd.js +4700 -43409
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +4187 -4919
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +4206 -4953
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/dist/worker/{node_modules_bson_lib_bson_mjs.umd.js → node_modules_pnpm_bson_6_10_4_node_modules_bson_lib_bson_mjs.umd.js} +6 -6
- package/dist/worker/node_modules_pnpm_bson_6_10_4_node_modules_bson_lib_bson_mjs.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-3a94cf.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-3a94cf.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-868779.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_mc-wa-s-868779.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqli-f60d0d.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqli-f60d0d.umd.js.map +1 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +44 -0
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +1 -0
- package/dist/worker/{node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-0d2437.umd.js} +24 -24
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-0d2437.umd.js.map +1 -0
- package/dist/worker/{node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-1d4e74.umd.js} +18 -18
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-1d4e74.umd.js.map +1 -0
- package/dist/worker/{node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js → node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-3622cf.umd.js} +18 -18
- package/dist/worker/node_modules_pnpm_journeyapps_wa-sqlite_1_4_1_node_modules_journeyapps_wa-sqlite_src_examples-3622cf.umd.js.map +1 -0
- package/lib/package.json +26 -22
- package/lib/src/attachments/IndexDBFileSystemAdapter.d.ts +25 -0
- package/lib/src/attachments/IndexDBFileSystemAdapter.js +104 -0
- package/lib/src/db/NavigatorTriggerClaimManager.d.ts +6 -0
- package/lib/src/db/NavigatorTriggerClaimManager.js +20 -0
- package/lib/src/db/PowerSyncDatabase.d.ts +5 -2
- package/lib/src/db/PowerSyncDatabase.js +46 -8
- package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js +1 -1
- package/lib/src/db/adapters/AbstractWebSQLOpenFactory.d.ts +2 -2
- package/lib/src/db/adapters/AbstractWebSQLOpenFactory.js +2 -2
- package/lib/src/db/adapters/AsyncDatabaseConnection.d.ts +1 -1
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +4 -4
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +29 -14
- package/lib/src/db/adapters/WebDBAdapter.d.ts +5 -2
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +2 -2
- package/lib/src/db/adapters/wa-sqlite/InternalWASQLiteDBAdapter.d.ts +12 -0
- package/lib/src/db/adapters/wa-sqlite/InternalWASQLiteDBAdapter.js +19 -0
- package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +2 -2
- package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.d.ts +4 -4
- package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +6 -6
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.d.ts +4 -4
- package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +7 -7
- package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.d.ts +1 -1
- package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js +3 -3
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.d.ts +5 -5
- package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +5 -5
- package/lib/src/db/sync/WebRemote.js +1 -1
- package/lib/src/db/sync/WebStreamingSyncImplementation.d.ts +1 -1
- package/lib/src/db/sync/WebStreamingSyncImplementation.js +1 -1
- package/lib/src/index.d.ts +13 -12
- package/lib/src/index.js +13 -12
- package/lib/src/worker/db/SharedWASQLiteConnection.d.ts +2 -2
- package/lib/src/worker/db/WASQLiteDB.worker.js +3 -3
- package/lib/src/worker/db/WorkerWASQLiteConnection.d.ts +2 -2
- package/lib/src/worker/db/WorkerWASQLiteConnection.js +1 -1
- package/lib/src/worker/db/open-worker-database.d.ts +2 -2
- package/lib/src/worker/db/open-worker-database.js +1 -1
- package/lib/src/worker/sync/BroadcastLogger.d.ts +1 -1
- package/lib/src/worker/sync/SharedSyncImplementation.d.ts +4 -4
- package/lib/src/worker/sync/SharedSyncImplementation.js +5 -5
- package/lib/src/worker/sync/SharedSyncImplementation.worker.js +2 -2
- package/lib/src/worker/sync/WorkerClient.d.ts +1 -1
- package/lib/src/worker/sync/WorkerClient.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -17
- package/src/attachments/IndexDBFileSystemAdapter.ts +117 -0
- package/src/db/NavigatorTriggerClaimManager.ts +23 -0
- package/src/db/PowerSyncDatabase.ts +53 -9
- package/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.ts +1 -1
- package/src/db/adapters/AbstractWebSQLOpenFactory.ts +3 -3
- package/src/db/adapters/AsyncDatabaseConnection.ts +1 -1
- package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +32 -20
- package/src/db/adapters/WebDBAdapter.ts +6 -2
- package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +2 -2
- package/src/db/adapters/wa-sqlite/InternalWASQLiteDBAdapter.ts +23 -0
- package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +2 -2
- package/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts +8 -8
- package/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.ts +8 -8
- package/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.ts +3 -3
- package/src/db/sync/SharedWebStreamingSyncImplementation.ts +7 -7
- package/src/db/sync/WebRemote.ts +1 -1
- package/src/db/sync/WebStreamingSyncImplementation.ts +2 -2
- package/src/index.ts +13 -12
- package/src/worker/db/SharedWASQLiteConnection.ts +2 -2
- package/src/worker/db/WASQLiteDB.worker.ts +5 -5
- package/src/worker/db/WorkerWASQLiteConnection.ts +2 -2
- package/src/worker/db/open-worker-database.ts +2 -2
- package/src/worker/sync/BroadcastLogger.ts +1 -1
- package/src/worker/sync/SharedSyncImplementation.ts +9 -9
- package/src/worker/sync/SharedSyncImplementation.worker.ts +2 -2
- package/src/worker/sync/WorkerClient.ts +2 -2
- package/dist/worker/node_modules_bson_lib_bson_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +0 -44
- package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js.map +0 -1
- package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js.map +0 -1
- /package/bin/{powersync.js → powersync.cjs} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { DBAdapter } from '@powersync/common';
|
|
2
|
-
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';
|
|
2
|
+
import { ResolvedWebSQLOpenOptions } from './web-sql-flags.js';
|
|
3
3
|
export type SharedConnectionWorker = {
|
|
4
4
|
identifier: string;
|
|
5
5
|
port: MessagePort;
|
|
6
6
|
};
|
|
7
|
+
export type WebDBAdapterConfiguration = ResolvedWebSQLOpenOptions & {
|
|
8
|
+
requiresPersistentTriggers: boolean;
|
|
9
|
+
};
|
|
7
10
|
export interface WebDBAdapter extends DBAdapter {
|
|
8
11
|
/**
|
|
9
12
|
* Get a MessagePort which can be used to share the internals of this connection.
|
|
@@ -13,5 +16,5 @@ export interface WebDBAdapter extends DBAdapter {
|
|
|
13
16
|
* Get the config options used to open this connection.
|
|
14
17
|
* This is useful for sharing connections.
|
|
15
18
|
*/
|
|
16
|
-
getConfiguration():
|
|
19
|
+
getConfiguration(): WebDBAdapterConfiguration;
|
|
17
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseObserver } from '@powersync/common';
|
|
2
2
|
import * as Comlink from 'comlink';
|
|
3
|
-
import { AsyncDatabaseConnection, OnTableChangeCallback, OpenAsyncDatabaseConnection, ProxiedQueryResult } from './AsyncDatabaseConnection';
|
|
4
|
-
import { ResolvedWebSQLOpenOptions } from './web-sql-flags';
|
|
3
|
+
import { AsyncDatabaseConnection, OnTableChangeCallback, OpenAsyncDatabaseConnection, ProxiedQueryResult } from './AsyncDatabaseConnection.js';
|
|
4
|
+
import { ResolvedWebSQLOpenOptions } from './web-sql-flags.js';
|
|
5
5
|
export type SharedConnectionWorker = {
|
|
6
6
|
identifier: string;
|
|
7
7
|
port: MessagePort;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LockedAsyncDatabaseAdapter } from '../LockedAsyncDatabaseAdapter.js';
|
|
2
|
+
import { WebDBAdapterConfiguration } from '../WebDBAdapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* An intermediary implementation of WASQLiteDBAdapter, which takes the same
|
|
6
|
+
* constructor arguments as {@link LockedAsyncDatabaseAdapter}, but provides some
|
|
7
|
+
* basic WA-SQLite specific functionality.
|
|
8
|
+
* This base class is used to avoid requiring overloading the constructor of {@link WASQLiteDBAdapter}
|
|
9
|
+
*/
|
|
10
|
+
export declare class InternalWASQLiteDBAdapter extends LockedAsyncDatabaseAdapter {
|
|
11
|
+
getConfiguration(): WebDBAdapterConfiguration;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LockedAsyncDatabaseAdapter } from '../LockedAsyncDatabaseAdapter.js';
|
|
2
|
+
import { WASQLiteVFS } from './WASQLiteConnection.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* An intermediary implementation of WASQLiteDBAdapter, which takes the same
|
|
6
|
+
* constructor arguments as {@link LockedAsyncDatabaseAdapter}, but provides some
|
|
7
|
+
* basic WA-SQLite specific functionality.
|
|
8
|
+
* This base class is used to avoid requiring overloading the constructor of {@link WASQLiteDBAdapter}
|
|
9
|
+
*/
|
|
10
|
+
export class InternalWASQLiteDBAdapter extends LockedAsyncDatabaseAdapter {
|
|
11
|
+
getConfiguration() {
|
|
12
|
+
// This is valid since we only handle WASQLite connections
|
|
13
|
+
const baseConfig = super.getConfiguration();
|
|
14
|
+
return {
|
|
15
|
+
...super.getConfiguration(),
|
|
16
|
+
requiresPersistentTriggers: baseConfig.vfs == WASQLiteVFS.OPFSCoopSyncVFS || baseConfig.vfs == WASQLiteVFS.AccessHandlePoolVFS
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as SQLite from '@journeyapps/wa-sqlite';
|
|
2
2
|
import { BaseObserver, BatchedUpdateNotification } from '@powersync/common';
|
|
3
3
|
import { Mutex } from 'async-mutex';
|
|
4
|
-
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../AsyncDatabaseConnection';
|
|
5
|
-
import { ResolvedWASQLiteOpenFactoryOptions } from './WASQLiteOpenFactory';
|
|
4
|
+
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../AsyncDatabaseConnection.js';
|
|
5
|
+
import { ResolvedWASQLiteOpenFactoryOptions } from './WASQLiteOpenFactory.js';
|
|
6
6
|
/**
|
|
7
7
|
* List of currently tested virtual filesystems
|
|
8
8
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PowerSyncOpenFactoryOptions } from '@powersync/common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { WASQLiteVFS } from './WASQLiteConnection';
|
|
2
|
+
import { ResolvedWebSQLOpenOptions, TemporaryStorageOption, WebSQLFlags } from '../web-sql-flags.js';
|
|
3
|
+
import { InternalWASQLiteDBAdapter } from './InternalWASQLiteDBAdapter.js';
|
|
4
|
+
import { WASQLiteVFS } from './WASQLiteConnection.js';
|
|
5
5
|
/**
|
|
6
6
|
* These flags are the same as {@link WebSQLFlags}.
|
|
7
7
|
* This export is maintained only for API consistency
|
|
@@ -27,6 +27,6 @@ export interface WASQLiteDBAdapterOptions extends Omit<PowerSyncOpenFactoryOptio
|
|
|
27
27
|
/**
|
|
28
28
|
* Adapter for WA-SQLite SQLite connections.
|
|
29
29
|
*/
|
|
30
|
-
export declare class WASQLiteDBAdapter extends
|
|
30
|
+
export declare class WASQLiteDBAdapter extends InternalWASQLiteDBAdapter {
|
|
31
31
|
constructor(options: WASQLiteDBAdapterOptions);
|
|
32
32
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { resolveWebPowerSyncFlags } from '../../PowerSyncDatabase';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory';
|
|
2
|
+
import { resolveWebPowerSyncFlags } from '../../PowerSyncDatabase.js';
|
|
3
|
+
import { DEFAULT_CACHE_SIZE_KB, TemporaryStorageOption } from '../web-sql-flags.js';
|
|
4
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../WorkerWrappedAsyncDatabaseConnection.js';
|
|
5
|
+
import { InternalWASQLiteDBAdapter } from './InternalWASQLiteDBAdapter.js';
|
|
6
|
+
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory.js';
|
|
7
7
|
/**
|
|
8
8
|
* Adapter for WA-SQLite SQLite connections.
|
|
9
9
|
*/
|
|
10
|
-
export class WASQLiteDBAdapter extends
|
|
10
|
+
export class WASQLiteDBAdapter extends InternalWASQLiteDBAdapter {
|
|
11
11
|
constructor(options) {
|
|
12
12
|
super({
|
|
13
13
|
name: options.dbFilename,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DBAdapter, type ILogLevel } from '@powersync/common';
|
|
2
|
-
import { AbstractWebSQLOpenFactory } from '../AbstractWebSQLOpenFactory';
|
|
3
|
-
import { AsyncDatabaseConnection } from '../AsyncDatabaseConnection';
|
|
4
|
-
import { ResolvedWebSQLOpenOptions, WebSQLOpenFactoryOptions } from '../web-sql-flags';
|
|
5
|
-
import { WASQLiteVFS } from './WASQLiteConnection';
|
|
2
|
+
import { AbstractWebSQLOpenFactory } from '../AbstractWebSQLOpenFactory.js';
|
|
3
|
+
import { AsyncDatabaseConnection } from '../AsyncDatabaseConnection.js';
|
|
4
|
+
import { ResolvedWebSQLOpenOptions, WebSQLOpenFactoryOptions } from '../web-sql-flags.js';
|
|
5
|
+
import { WASQLiteVFS } from './WASQLiteConnection.js';
|
|
6
6
|
export interface WASQLiteOpenFactoryOptions extends WebSQLOpenFactoryOptions {
|
|
7
7
|
vfs?: WASQLiteVFS;
|
|
8
8
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { openWorkerDatabasePort, resolveWorkerDatabasePortFactory } from '../../../worker/db/open-worker-database';
|
|
3
|
-
import { AbstractWebSQLOpenFactory } from '../AbstractWebSQLOpenFactory';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { WASQLiteVFS, WASqliteConnection } from './WASQLiteConnection';
|
|
2
|
+
import { openWorkerDatabasePort, resolveWorkerDatabasePortFactory } from '../../../worker/db/open-worker-database.js';
|
|
3
|
+
import { AbstractWebSQLOpenFactory } from '../AbstractWebSQLOpenFactory.js';
|
|
4
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../WorkerWrappedAsyncDatabaseConnection.js';
|
|
5
|
+
import { DEFAULT_CACHE_SIZE_KB, TemporaryStorageOption } from '../web-sql-flags.js';
|
|
6
|
+
import { InternalWASQLiteDBAdapter } from './InternalWASQLiteDBAdapter.js';
|
|
7
|
+
import { WASQLiteVFS, WASqliteConnection } from './WASQLiteConnection.js';
|
|
8
8
|
/**
|
|
9
9
|
* Opens a SQLite connection using WA-SQLite.
|
|
10
10
|
*/
|
|
@@ -18,7 +18,7 @@ export class WASQLiteOpenFactory extends AbstractWebSQLOpenFactory {
|
|
|
18
18
|
return this.options;
|
|
19
19
|
}
|
|
20
20
|
openAdapter() {
|
|
21
|
-
return new
|
|
21
|
+
return new InternalWASQLiteDBAdapter({
|
|
22
22
|
name: this.options.dbFilename,
|
|
23
23
|
openConnection: () => this.openConnection(),
|
|
24
24
|
debugMode: this.options.debugMode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractPowerSyncDatabase, DBAdapter, PowerSyncDatabaseOptions } from '@powersync/common';
|
|
2
|
-
import { AbstractWebPowerSyncDatabaseOpenFactory } from '../AbstractWebPowerSyncDatabaseOpenFactory';
|
|
2
|
+
import { AbstractWebPowerSyncDatabaseOpenFactory } from '../AbstractWebPowerSyncDatabaseOpenFactory.js';
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated {@link PowerSyncDatabase} can now be constructed directly
|
|
5
5
|
* @example
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PowerSyncDatabase } from '../../../db/PowerSyncDatabase';
|
|
2
|
-
import { AbstractWebPowerSyncDatabaseOpenFactory } from '../AbstractWebPowerSyncDatabaseOpenFactory';
|
|
3
|
-
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory';
|
|
1
|
+
import { PowerSyncDatabase } from '../../../db/PowerSyncDatabase.js';
|
|
2
|
+
import { AbstractWebPowerSyncDatabaseOpenFactory } from '../AbstractWebPowerSyncDatabaseOpenFactory.js';
|
|
3
|
+
import { WASQLiteOpenFactory } from './WASQLiteOpenFactory.js';
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated {@link PowerSyncDatabase} can now be constructed directly
|
|
6
6
|
* @example
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PowerSyncConnectionOptions, PowerSyncCredentials, SubscribedStream, SyncStatusOptions } from '@powersync/common';
|
|
2
2
|
import * as Comlink from 'comlink';
|
|
3
|
-
import { AbstractSharedSyncClientProvider } from '../../worker/sync/AbstractSharedSyncClientProvider';
|
|
4
|
-
import { WorkerClient } from '../../worker/sync/WorkerClient';
|
|
5
|
-
import { WebDBAdapter } from '../adapters/WebDBAdapter';
|
|
6
|
-
import { WebStreamingSyncImplementation, WebStreamingSyncImplementationOptions } from './WebStreamingSyncImplementation';
|
|
3
|
+
import { AbstractSharedSyncClientProvider } from '../../worker/sync/AbstractSharedSyncClientProvider.js';
|
|
4
|
+
import { WorkerClient } from '../../worker/sync/WorkerClient.js';
|
|
5
|
+
import { WebDBAdapter } from '../adapters/WebDBAdapter.js';
|
|
6
|
+
import { WebStreamingSyncImplementation, WebStreamingSyncImplementationOptions } from './WebStreamingSyncImplementation.js';
|
|
7
7
|
/**
|
|
8
8
|
* The shared worker will trigger methods on this side of the message port
|
|
9
9
|
* via this client provider.
|
|
@@ -17,7 +17,7 @@ declare class SharedSyncClientProvider extends AbstractSharedSyncClientProvider
|
|
|
17
17
|
invalidateCredentials(): void;
|
|
18
18
|
fetchCredentials(): Promise<PowerSyncCredentials | null>;
|
|
19
19
|
uploadCrud(): Promise<void>;
|
|
20
|
-
get logger(): import("
|
|
20
|
+
get logger(): import("@powersync/common").ILogger | undefined;
|
|
21
21
|
trace(...x: any[]): void;
|
|
22
22
|
debug(...x: any[]): void;
|
|
23
23
|
info(...x: any[]): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
3
|
-
import { AbstractSharedSyncClientProvider } from '../../worker/sync/AbstractSharedSyncClientProvider';
|
|
4
|
-
import { SharedSyncClientEvent } from '../../worker/sync/SharedSyncImplementation';
|
|
5
|
-
import { DEFAULT_CACHE_SIZE_KB, TemporaryStorageOption, resolveWebSQLFlags } from '../adapters/web-sql-flags';
|
|
6
|
-
import { WebStreamingSyncImplementation } from './WebStreamingSyncImplementation';
|
|
2
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
3
|
+
import { AbstractSharedSyncClientProvider } from '../../worker/sync/AbstractSharedSyncClientProvider.js';
|
|
4
|
+
import { SharedSyncClientEvent } from '../../worker/sync/SharedSyncImplementation.js';
|
|
5
|
+
import { DEFAULT_CACHE_SIZE_KB, TemporaryStorageOption, resolveWebSQLFlags } from '../adapters/web-sql-flags.js';
|
|
6
|
+
import { WebStreamingSyncImplementation } from './WebStreamingSyncImplementation.js';
|
|
7
7
|
/**
|
|
8
8
|
* The shared worker will trigger methods on this side of the message port
|
|
9
9
|
* via this client provider.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractRemote, DEFAULT_REMOTE_LOGGER, FetchImplementationProvider } from '@powersync/common';
|
|
2
|
-
import { getUserAgentInfo } from './userAgent';
|
|
2
|
+
import { getUserAgentInfo } from './userAgent.js';
|
|
3
3
|
/*
|
|
4
4
|
* Depends on browser's implementation of global fetch.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractStreamingSyncImplementation, AbstractStreamingSyncImplementationOptions, LockOptions } from '@powersync/common';
|
|
2
|
-
import { ResolvedWebSQLOpenOptions, WebSQLFlags } from '../adapters/web-sql-flags';
|
|
2
|
+
import { ResolvedWebSQLOpenOptions, WebSQLFlags } from '../adapters/web-sql-flags.js';
|
|
3
3
|
export interface WebStreamingSyncImplementationOptions extends AbstractStreamingSyncImplementationOptions {
|
|
4
4
|
flags?: WebSQLFlags;
|
|
5
5
|
sync?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractStreamingSyncImplementation, LockType } from '@powersync/common';
|
|
2
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
2
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
3
3
|
export class WebStreamingSyncImplementation extends AbstractStreamingSyncImplementation {
|
|
4
4
|
constructor(options) {
|
|
5
5
|
// Super will store and provide default values for options
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export * from '@powersync/common';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory';
|
|
4
|
-
export * from './db/adapters/AbstractWebSQLOpenFactory';
|
|
5
|
-
export * from './db/adapters/
|
|
6
|
-
export * from './db/adapters/wa-sqlite/
|
|
7
|
-
export * from './db/adapters/wa-sqlite/
|
|
8
|
-
export * from './db/adapters/wa-sqlite/
|
|
9
|
-
export * from './db/adapters/
|
|
10
|
-
export * from './db/
|
|
11
|
-
export * from './db/
|
|
12
|
-
export * from './db/sync/
|
|
13
|
-
export * from './db/sync/
|
|
2
|
+
export * from './attachments/IndexDBFileSystemAdapter.js';
|
|
3
|
+
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js';
|
|
4
|
+
export * from './db/adapters/AbstractWebSQLOpenFactory.js';
|
|
5
|
+
export * from './db/adapters/AsyncDatabaseConnection.js';
|
|
6
|
+
export * from './db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
7
|
+
export * from './db/adapters/wa-sqlite/WASQLiteDBAdapter.js';
|
|
8
|
+
export * from './db/adapters/wa-sqlite/WASQLiteOpenFactory.js';
|
|
9
|
+
export * from './db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js';
|
|
10
|
+
export * from './db/adapters/web-sql-flags.js';
|
|
11
|
+
export * from './db/PowerSyncDatabase.js';
|
|
12
|
+
export * from './db/sync/SharedWebStreamingSyncImplementation.js';
|
|
13
|
+
export * from './db/sync/WebRemote.js';
|
|
14
|
+
export * from './db/sync/WebStreamingSyncImplementation.js';
|
package/lib/src/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export * from '@powersync/common';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory';
|
|
4
|
-
export * from './db/adapters/AbstractWebSQLOpenFactory';
|
|
5
|
-
export * from './db/adapters/
|
|
6
|
-
export * from './db/adapters/wa-sqlite/
|
|
7
|
-
export * from './db/adapters/wa-sqlite/
|
|
8
|
-
export * from './db/adapters/wa-sqlite/
|
|
9
|
-
export * from './db/adapters/
|
|
10
|
-
export * from './db/
|
|
11
|
-
export * from './db/
|
|
12
|
-
export * from './db/sync/
|
|
13
|
-
export * from './db/sync/
|
|
2
|
+
export * from './attachments/IndexDBFileSystemAdapter.js';
|
|
3
|
+
export * from './db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js';
|
|
4
|
+
export * from './db/adapters/AbstractWebSQLOpenFactory.js';
|
|
5
|
+
export * from './db/adapters/AsyncDatabaseConnection.js';
|
|
6
|
+
export * from './db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
7
|
+
export * from './db/adapters/wa-sqlite/WASQLiteDBAdapter.js';
|
|
8
|
+
export * from './db/adapters/wa-sqlite/WASQLiteOpenFactory.js';
|
|
9
|
+
export * from './db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js';
|
|
10
|
+
export * from './db/adapters/web-sql-flags.js';
|
|
11
|
+
export * from './db/PowerSyncDatabase.js';
|
|
12
|
+
export * from './db/sync/SharedWebStreamingSyncImplementation.js';
|
|
13
|
+
export * from './db/sync/WebRemote.js';
|
|
14
|
+
export * from './db/sync/WebStreamingSyncImplementation.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ILogger } from '@powersync/common';
|
|
2
|
-
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../../db/adapters/AsyncDatabaseConnection';
|
|
3
|
-
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags';
|
|
2
|
+
import { AsyncDatabaseConnection, OnTableChangeCallback, ProxiedQueryResult } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
3
|
+
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags.js';
|
|
4
4
|
/**
|
|
5
5
|
* Keeps track of open DB connections and the clients which
|
|
6
6
|
* are using it.
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import '@journeyapps/wa-sqlite';
|
|
5
5
|
import { createBaseLogger, createLogger } from '@powersync/common';
|
|
6
6
|
import * as Comlink from 'comlink';
|
|
7
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
8
|
-
import { SharedWASQLiteConnection } from './SharedWASQLiteConnection';
|
|
9
|
-
import { WorkerWASQLiteConnection } from './WorkerWASQLiteConnection';
|
|
7
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
8
|
+
import { SharedWASQLiteConnection } from './SharedWASQLiteConnection.js';
|
|
9
|
+
import { WorkerWASQLiteConnection } from './WorkerWASQLiteConnection.js';
|
|
10
10
|
const baseLogger = createBaseLogger();
|
|
11
11
|
baseLogger.useDefaults();
|
|
12
12
|
const logger = createLogger('db-worker');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OnTableChangeCallback } from '../../db/adapters/AsyncDatabaseConnection';
|
|
2
|
-
import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
|
|
1
|
+
import { OnTableChangeCallback } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
2
|
+
import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
3
3
|
/**
|
|
4
4
|
* A Small proxy wrapper around the WASqliteConnection.
|
|
5
5
|
* This ensures that certain return types are properly proxied.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
|
|
2
|
+
import { WASqliteConnection } from '../../db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
3
3
|
/**
|
|
4
4
|
* A Small proxy wrapper around the WASqliteConnection.
|
|
5
5
|
* This ensures that certain return types are properly proxied.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { OpenAsyncDatabaseConnection } from '
|
|
3
|
-
import { WASQLiteVFS } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
|
|
2
|
+
import { OpenAsyncDatabaseConnection } from '../../db/adapters/AsyncDatabaseConnection.js';
|
|
3
|
+
import { WASQLiteVFS } from '../../db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
4
4
|
/**
|
|
5
5
|
* Opens a shared or dedicated worker which exposes opening of database connections
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { WASQLiteVFS } from '../../db/adapters/wa-sqlite/WASQLiteConnection';
|
|
2
|
+
import { WASQLiteVFS } from '../../db/adapters/wa-sqlite/WASQLiteConnection.js';
|
|
3
3
|
/**
|
|
4
4
|
* Opens a shared or dedicated worker which exposes opening of database connections
|
|
5
5
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseObserver, ConnectionManager, DBAdapter, SubscribedStream, SyncStatus, type ILogLevel, type ILogger, type PowerSyncConnectionOptions, type StreamingSyncImplementation, type StreamingSyncImplementationListener, type SyncStatusOptions } from '@powersync/common';
|
|
2
2
|
import { Mutex } from 'async-mutex';
|
|
3
3
|
import * as Comlink from 'comlink';
|
|
4
|
-
import { WebStreamingSyncImplementation, WebStreamingSyncImplementationOptions } from '../../db/sync/WebStreamingSyncImplementation';
|
|
5
|
-
import { WorkerWrappedAsyncDatabaseConnection } from '../../db/adapters/WorkerWrappedAsyncDatabaseConnection';
|
|
6
|
-
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags';
|
|
7
|
-
import { AbstractSharedSyncClientProvider } from './AbstractSharedSyncClientProvider';
|
|
4
|
+
import { WebStreamingSyncImplementation, WebStreamingSyncImplementationOptions } from '../../db/sync/WebStreamingSyncImplementation.js';
|
|
5
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../../db/adapters/WorkerWrappedAsyncDatabaseConnection.js';
|
|
6
|
+
import { ResolvedWebSQLOpenOptions } from '../../db/adapters/web-sql-flags.js';
|
|
7
|
+
import { AbstractSharedSyncClientProvider } from './AbstractSharedSyncClientProvider.js';
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
* Manual message events for shared sync clients
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AbortOperation, BaseObserver, ConnectionManager, SqliteBucketStorage, SyncStatus, createLogger } from '@powersync/common';
|
|
2
2
|
import { Mutex } from 'async-mutex';
|
|
3
3
|
import * as Comlink from 'comlink';
|
|
4
|
-
import { WebRemote } from '../../db/sync/WebRemote';
|
|
5
|
-
import { WebStreamingSyncImplementation } from '../../db/sync/WebStreamingSyncImplementation';
|
|
6
|
-
import { LockedAsyncDatabaseAdapter } from '../../db/adapters/LockedAsyncDatabaseAdapter';
|
|
7
|
-
import { WorkerWrappedAsyncDatabaseConnection } from '../../db/adapters/WorkerWrappedAsyncDatabaseConnection';
|
|
8
|
-
import { BroadcastLogger } from './BroadcastLogger';
|
|
4
|
+
import { WebRemote } from '../../db/sync/WebRemote.js';
|
|
5
|
+
import { WebStreamingSyncImplementation } from '../../db/sync/WebStreamingSyncImplementation.js';
|
|
6
|
+
import { LockedAsyncDatabaseAdapter } from '../../db/adapters/LockedAsyncDatabaseAdapter.js';
|
|
7
|
+
import { WorkerWrappedAsyncDatabaseConnection } from '../../db/adapters/WorkerWrappedAsyncDatabaseConnection.js';
|
|
8
|
+
import { BroadcastLogger } from './BroadcastLogger.js';
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
11
11
|
* Manual message events for shared sync clients
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBaseLogger } from '@powersync/common';
|
|
2
|
-
import { SharedSyncImplementation } from './SharedSyncImplementation';
|
|
3
|
-
import { WorkerClient } from './WorkerClient';
|
|
2
|
+
import { SharedSyncImplementation } from './SharedSyncImplementation.js';
|
|
3
|
+
import { WorkerClient } from './WorkerClient.js';
|
|
4
4
|
const _self = self;
|
|
5
5
|
const logger = createBaseLogger();
|
|
6
6
|
logger.useDefaults();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILogLevel, PowerSyncConnectionOptions, SubscribedStream } from '@powersync/common';
|
|
2
|
-
import { SharedSyncImplementation, SharedSyncInitOptions, WrappedSyncPort } from './SharedSyncImplementation';
|
|
2
|
+
import { SharedSyncImplementation, SharedSyncInitOptions, WrappedSyncPort } from './SharedSyncImplementation.js';
|
|
3
3
|
/**
|
|
4
4
|
* A client to the shared sync worker.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Comlink from 'comlink';
|
|
2
|
-
import { getNavigatorLocks } from '../../shared/navigator';
|
|
3
|
-
import { SharedSyncClientEvent } from './SharedSyncImplementation';
|
|
2
|
+
import { getNavigatorLocks } from '../../shared/navigator.js';
|
|
3
|
+
import { SharedSyncClientEvent } from './SharedSyncImplementation.js';
|
|
4
4
|
/**
|
|
5
5
|
* A client to the shared sync worker.
|
|
6
6
|
*
|