@powersync/common 1.39.0 → 1.40.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/bundle.cjs +2 -2
- package/dist/bundle.mjs +2 -2
- package/dist/index.d.cts +14 -0
- package/lib/client/AbstractPowerSyncDatabase.d.ts +13 -1
- package/lib/client/AbstractPowerSyncDatabase.js +16 -0
- package/lib/client/ConnectionManager.d.ts +2 -0
- package/lib/client/ConnectionManager.js +6 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1854,6 +1854,8 @@ declare class ConnectionManager extends BaseObserver<ConnectionManagerListener>
|
|
|
1854
1854
|
*/
|
|
1855
1855
|
private locallyActiveSubscriptions;
|
|
1856
1856
|
constructor(options: ConnectionManagerOptions);
|
|
1857
|
+
get connector(): PowerSyncBackendConnector | null;
|
|
1858
|
+
get connectionOptions(): InternalConnectionOptions | null;
|
|
1857
1859
|
get logger(): ILogger;
|
|
1858
1860
|
close(): Promise<void>;
|
|
1859
1861
|
connect(connector: PowerSyncBackendConnector, options: InternalConnectionOptions): Promise<void>;
|
|
@@ -2899,6 +2901,18 @@ declare abstract class AbstractPowerSyncDatabase extends BaseObserver<PowerSyncD
|
|
|
2899
2901
|
protected connectionManager: ConnectionManager;
|
|
2900
2902
|
private subscriptions;
|
|
2901
2903
|
get syncStreamImplementation(): StreamingSyncImplementation | null;
|
|
2904
|
+
/**
|
|
2905
|
+
* The connector used to connect to the PowerSync service.
|
|
2906
|
+
*
|
|
2907
|
+
* @returns The connector used to connect to the PowerSync service or null if `connect()` has not been called.
|
|
2908
|
+
*/
|
|
2909
|
+
get connector(): PowerSyncBackendConnector | null;
|
|
2910
|
+
/**
|
|
2911
|
+
* The resolved connection options used to connect to the PowerSync service.
|
|
2912
|
+
*
|
|
2913
|
+
* @returns The resolved connection options used to connect to the PowerSync service or null if `connect()` has not been called.
|
|
2914
|
+
*/
|
|
2915
|
+
get connectionOptions(): InternalConnectionOptions | null;
|
|
2902
2916
|
protected _schema: Schema;
|
|
2903
2917
|
private _database;
|
|
2904
2918
|
protected runExclusiveMutex: Mutex;
|
|
@@ -12,7 +12,7 @@ import { PowerSyncBackendConnector } from './connection/PowerSyncBackendConnecto
|
|
|
12
12
|
import { BucketStorageAdapter } from './sync/bucket/BucketStorageAdapter.js';
|
|
13
13
|
import { CrudBatch } from './sync/bucket/CrudBatch.js';
|
|
14
14
|
import { CrudTransaction } from './sync/bucket/CrudTransaction.js';
|
|
15
|
-
import { StreamingSyncImplementation, StreamingSyncImplementationListener, type AdditionalConnectionOptions, type PowerSyncConnectionOptions, type RequiredAdditionalConnectionOptions } from './sync/stream/AbstractStreamingSyncImplementation.js';
|
|
15
|
+
import { InternalConnectionOptions, StreamingSyncImplementation, StreamingSyncImplementationListener, type AdditionalConnectionOptions, type PowerSyncConnectionOptions, type RequiredAdditionalConnectionOptions } from './sync/stream/AbstractStreamingSyncImplementation.js';
|
|
16
16
|
import { TriggerManager } from './triggers/TriggerManager.js';
|
|
17
17
|
import { WatchCompatibleQuery } from './watched/WatchedQuery.js';
|
|
18
18
|
import { WatchedQueryComparator } from './watched/processors/comparators.js';
|
|
@@ -132,6 +132,18 @@ export declare abstract class AbstractPowerSyncDatabase extends BaseObserver<Pow
|
|
|
132
132
|
protected connectionManager: ConnectionManager;
|
|
133
133
|
private subscriptions;
|
|
134
134
|
get syncStreamImplementation(): StreamingSyncImplementation | null;
|
|
135
|
+
/**
|
|
136
|
+
* The connector used to connect to the PowerSync service.
|
|
137
|
+
*
|
|
138
|
+
* @returns The connector used to connect to the PowerSync service or null if `connect()` has not been called.
|
|
139
|
+
*/
|
|
140
|
+
get connector(): PowerSyncBackendConnector | null;
|
|
141
|
+
/**
|
|
142
|
+
* The resolved connection options used to connect to the PowerSync service.
|
|
143
|
+
*
|
|
144
|
+
* @returns The resolved connection options used to connect to the PowerSync service or null if `connect()` has not been called.
|
|
145
|
+
*/
|
|
146
|
+
get connectionOptions(): InternalConnectionOptions | null;
|
|
135
147
|
protected _schema: Schema;
|
|
136
148
|
private _database;
|
|
137
149
|
protected runExclusiveMutex: Mutex;
|
|
@@ -63,6 +63,22 @@ export class AbstractPowerSyncDatabase extends BaseObserver {
|
|
|
63
63
|
get syncStreamImplementation() {
|
|
64
64
|
return this.connectionManager.syncStreamImplementation;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The connector used to connect to the PowerSync service.
|
|
68
|
+
*
|
|
69
|
+
* @returns The connector used to connect to the PowerSync service or null if `connect()` has not been called.
|
|
70
|
+
*/
|
|
71
|
+
get connector() {
|
|
72
|
+
return this.connectionManager.connector;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The resolved connection options used to connect to the PowerSync service.
|
|
76
|
+
*
|
|
77
|
+
* @returns The resolved connection options used to connect to the PowerSync service or null if `connect()` has not been called.
|
|
78
|
+
*/
|
|
79
|
+
get connectionOptions() {
|
|
80
|
+
return this.connectionManager.connectionOptions;
|
|
81
|
+
}
|
|
66
82
|
_schema;
|
|
67
83
|
_database;
|
|
68
84
|
runExclusiveMutex;
|
|
@@ -85,6 +85,8 @@ export declare class ConnectionManager extends BaseObserver<ConnectionManagerLis
|
|
|
85
85
|
*/
|
|
86
86
|
private locallyActiveSubscriptions;
|
|
87
87
|
constructor(options: ConnectionManagerOptions);
|
|
88
|
+
get connector(): PowerSyncBackendConnector | null;
|
|
89
|
+
get connectionOptions(): InternalConnectionOptions | null;
|
|
88
90
|
get logger(): ILogger;
|
|
89
91
|
close(): Promise<void>;
|
|
90
92
|
connect(connector: PowerSyncBackendConnector, options: InternalConnectionOptions): Promise<void>;
|
|
@@ -48,6 +48,12 @@ export class ConnectionManager extends BaseObserver {
|
|
|
48
48
|
this.syncStreamImplementation = null;
|
|
49
49
|
this.syncDisposer = null;
|
|
50
50
|
}
|
|
51
|
+
get connector() {
|
|
52
|
+
return this.pendingConnectionOptions?.connector ?? null;
|
|
53
|
+
}
|
|
54
|
+
get connectionOptions() {
|
|
55
|
+
return this.pendingConnectionOptions?.options ?? null;
|
|
56
|
+
}
|
|
51
57
|
get logger() {
|
|
52
58
|
return this.options.logger;
|
|
53
59
|
}
|