@dittolive/ditto 4.4.1 → 4.4.2-alpha1
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/README.md +2 -2
- package/node/ditto.cjs.js +312 -75
- package/node/ditto.darwin-arm64.node +0 -0
- package/node/ditto.darwin-x64.node +0 -0
- package/node/ditto.linux-arm.node +0 -0
- package/node/ditto.linux-x64.node +0 -0
- package/node/ditto.win32-x64.node +0 -0
- package/node/transports.darwin-arm64.node +0 -0
- package/node/transports.darwin-x64.node +0 -0
- package/package.json +1 -1
- package/types/ditto.d.ts +137 -40
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dittolive/ditto",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2-alpha1",
|
|
4
4
|
"description": "Ditto is a cross-platform embeddable NoSQL database that can sync with or without an internet connection.",
|
|
5
5
|
"homepage": "https://ditto.live",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/types/ditto.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ declare class ObserverManager {
|
|
|
72
72
|
|
|
73
73
|
/** @internal */
|
|
74
74
|
interface ObserverManaging {
|
|
75
|
-
hasObserver(token: ObserverToken):
|
|
76
|
-
removeObserver(token: ObserverToken):
|
|
75
|
+
hasObserver(token: ObserverToken): boolean;
|
|
76
|
+
removeObserver(token: ObserverToken): void;
|
|
77
77
|
}
|
|
78
78
|
/** @internal */
|
|
79
79
|
type ObserverOptions = {
|
|
@@ -89,7 +89,7 @@ declare class Observer {
|
|
|
89
89
|
/** @internal */
|
|
90
90
|
readonly observerManager: ObserverManaging;
|
|
91
91
|
/** @internal */
|
|
92
|
-
|
|
92
|
+
get token(): ObserverToken | undefined;
|
|
93
93
|
/** @internal */
|
|
94
94
|
readonly options?: ObserverOptions;
|
|
95
95
|
/** @internal */
|
|
@@ -104,6 +104,7 @@ declare class Observer {
|
|
|
104
104
|
*/
|
|
105
105
|
stop(): void;
|
|
106
106
|
private static finalizationRegistry;
|
|
107
|
+
private _token?;
|
|
107
108
|
private static finalize;
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -139,6 +140,23 @@ type WriteStrategy = 'merge' | 'insertIfAbsent' | 'insertDefaultIfAbsent';
|
|
|
139
140
|
type QueryArguments = {
|
|
140
141
|
[key: string]: any;
|
|
141
142
|
};
|
|
143
|
+
/**
|
|
144
|
+
* Values to be incorporated into a query keyed by the placeholder used within
|
|
145
|
+
* that query.
|
|
146
|
+
*
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
type DQLQueryArguments = {
|
|
150
|
+
[key: string]: DQLQueryArgumentValue;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Value for an invidual key in a {@link DQLQueryArguments} object.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
type DQLQueryArgumentValue = string | number | boolean | Uint8Array | undefined | null | DQLQueryArgumentValue[] | {
|
|
158
|
+
[key: string | number]: DQLQueryArgumentValue;
|
|
159
|
+
};
|
|
142
160
|
|
|
143
161
|
/** @internal */
|
|
144
162
|
declare class Value {
|
|
@@ -153,15 +171,16 @@ declare class Value {
|
|
|
153
171
|
*/
|
|
154
172
|
declare class Counter {
|
|
155
173
|
/** The value of the counter. */
|
|
156
|
-
|
|
174
|
+
get value(): number;
|
|
157
175
|
/**
|
|
158
176
|
* Creates a new counter that can be used as part of a document's content.
|
|
159
177
|
*/
|
|
160
178
|
constructor();
|
|
161
179
|
/** @internal */
|
|
162
180
|
static '@ditto.create'(mutDoc: any, path: any, value: any): any;
|
|
163
|
-
|
|
164
|
-
|
|
181
|
+
protected mutDoc: any;
|
|
182
|
+
protected path: any;
|
|
183
|
+
protected _value: number;
|
|
165
184
|
}
|
|
166
185
|
/**
|
|
167
186
|
* Represents a mutable CRDT counter that can be incremented by a specific
|
|
@@ -181,7 +200,7 @@ declare class MutableCounter extends Counter {
|
|
|
181
200
|
*/
|
|
182
201
|
increment(amount: number): void;
|
|
183
202
|
/** @internal */
|
|
184
|
-
constructor();
|
|
203
|
+
protected constructor();
|
|
185
204
|
}
|
|
186
205
|
|
|
187
206
|
/**
|
|
@@ -301,7 +320,7 @@ declare class Logger {
|
|
|
301
320
|
* Registers a file path where logs will be written to, whenever Ditto wants
|
|
302
321
|
* to issue a log (on _top_ of emitting the log to the console).
|
|
303
322
|
*/
|
|
304
|
-
static
|
|
323
|
+
static get logFile(): string | undefined;
|
|
305
324
|
/**
|
|
306
325
|
* On Node, registers a file path where logs will be written to, whenever
|
|
307
326
|
* Ditto wants to issue a log (on _top_ of emitting the log to the console).
|
|
@@ -350,7 +369,7 @@ declare class Logger {
|
|
|
350
369
|
* {@link setCustomLogCallback | setCustomLogCallback()} for a detailed
|
|
351
370
|
* description.
|
|
352
371
|
*/
|
|
353
|
-
static
|
|
372
|
+
static get customLogCallback(): CustomLogCallback | undefined;
|
|
354
373
|
/**
|
|
355
374
|
* Registers a custom callback that will be called to report each log entry.
|
|
356
375
|
*
|
|
@@ -394,6 +413,8 @@ declare class Logger {
|
|
|
394
413
|
* {@link LogLevel} `Verbose`.
|
|
395
414
|
*/
|
|
396
415
|
static verbose(message: string): void;
|
|
416
|
+
private static _logFile?;
|
|
417
|
+
private static _customLogCallback?;
|
|
397
418
|
private constructor();
|
|
398
419
|
}
|
|
399
420
|
|
|
@@ -805,6 +826,9 @@ interface TransportConfigPeerToPeer {
|
|
|
805
826
|
interface TransportConfigLan {
|
|
806
827
|
isEnabled: boolean;
|
|
807
828
|
isMdnsEnabled: boolean;
|
|
829
|
+
/**
|
|
830
|
+
* @deprecated Multicast is deprecated. Please use mDNS instead.
|
|
831
|
+
*/
|
|
808
832
|
isMulticastEnabled: boolean;
|
|
809
833
|
}
|
|
810
834
|
/**
|
|
@@ -915,7 +939,7 @@ declare class TransportConfig {
|
|
|
915
939
|
* Returns `true` if the transport configuration is frozen, otherwise
|
|
916
940
|
* returns `false`.
|
|
917
941
|
*/
|
|
918
|
-
|
|
942
|
+
get isFrozen(): boolean;
|
|
919
943
|
/**
|
|
920
944
|
* (Deep) freezes the receiver such that it can't be modified anymore.
|
|
921
945
|
*/
|
|
@@ -934,6 +958,7 @@ declare class TransportConfig {
|
|
|
934
958
|
* returns `false`.
|
|
935
959
|
*/
|
|
936
960
|
static areListenHTTPsEqual(left: TransportConfigListenHTTP, right: TransportConfigListenHTTP): boolean;
|
|
961
|
+
private _isFrozen;
|
|
937
962
|
}
|
|
938
963
|
|
|
939
964
|
/**
|
|
@@ -997,7 +1022,7 @@ declare class Authenticator {
|
|
|
997
1022
|
/**
|
|
998
1023
|
Returns the current authentication status.
|
|
999
1024
|
*/
|
|
1000
|
-
|
|
1025
|
+
get status(): AuthenticationStatus;
|
|
1001
1026
|
/**
|
|
1002
1027
|
* Log in to Ditto with a third-party token. Throws if authentication is not
|
|
1003
1028
|
* available, which can be checked with {@link loginSupported}.
|
|
@@ -1027,7 +1052,7 @@ declare class Authenticator {
|
|
|
1027
1052
|
* [Ditto] instance as the sole argument that allows you to perform any
|
|
1028
1053
|
* required cleanup of the store as part of the logout process.
|
|
1029
1054
|
*/
|
|
1030
|
-
logout(cleanupFn?: (
|
|
1055
|
+
logout(cleanupFn?: (ditto: Ditto) => void): Promise<void>;
|
|
1031
1056
|
observeStatus(callback: (authenticationStatus: AuthenticationStatus) => void): Observer;
|
|
1032
1057
|
/** @internal */
|
|
1033
1058
|
constructor(keepAlive: KeepAlive);
|
|
@@ -1041,12 +1066,15 @@ declare class Authenticator {
|
|
|
1041
1066
|
protected keepAlive: KeepAlive;
|
|
1042
1067
|
/** @internal */
|
|
1043
1068
|
protected observerManager: ObserverManager;
|
|
1069
|
+
/** @internal */
|
|
1070
|
+
protected _status: AuthenticationStatus;
|
|
1044
1071
|
}
|
|
1045
1072
|
/** @internal */
|
|
1046
1073
|
declare class OnlineAuthenticator extends Authenticator {
|
|
1074
|
+
readonly loginSupported: boolean;
|
|
1047
1075
|
loginWithToken(token: string, provider: string): Promise<void>;
|
|
1048
1076
|
loginWithUsernameAndPassword(username: string, password: string, provider: string): Promise<void>;
|
|
1049
|
-
logout(cleanupFn?: (
|
|
1077
|
+
logout(cleanupFn?: (ditto: Ditto) => void): Promise<void>;
|
|
1050
1078
|
readonly authenticationHandler: AuthenticationHandler;
|
|
1051
1079
|
private ditto;
|
|
1052
1080
|
constructor(keepAlive: KeepAlive, ditto: Ditto, authenticationHandler: AuthenticationHandler);
|
|
@@ -1056,11 +1084,11 @@ declare class OnlineAuthenticator extends Authenticator {
|
|
|
1056
1084
|
}
|
|
1057
1085
|
/** @internal */
|
|
1058
1086
|
declare class NotAvailableAuthenticator extends Authenticator {
|
|
1059
|
-
loginWithToken(token: string, provider: string): Promise<
|
|
1060
|
-
loginWithUsernameAndPassword(username: string, password: string, provider: string): Promise<
|
|
1061
|
-
logout(cleanupFn?: (
|
|
1062
|
-
'@ditto.authenticationExpiring'(secondsRemaining:
|
|
1063
|
-
'@ditto.authClientValidityChanged'(isWebValid: boolean, isX509Valid: boolean):
|
|
1087
|
+
loginWithToken(token: string, provider: string): Promise<never>;
|
|
1088
|
+
loginWithUsernameAndPassword(username: string, password: string, provider: string): Promise<never>;
|
|
1089
|
+
logout(cleanupFn?: (ditto: Ditto) => void): Promise<never>;
|
|
1090
|
+
'@ditto.authenticationExpiring'(secondsRemaining: number): never;
|
|
1091
|
+
'@ditto.authClientValidityChanged'(isWebValid: boolean, isX509Valid: boolean): never;
|
|
1064
1092
|
}
|
|
1065
1093
|
|
|
1066
1094
|
/**
|
|
@@ -1400,7 +1428,7 @@ declare class Subscription {
|
|
|
1400
1428
|
* Returns `true` if subscription has been explicitly cancelled, `false`
|
|
1401
1429
|
* otherwise.
|
|
1402
1430
|
*/
|
|
1403
|
-
|
|
1431
|
+
get isCancelled(): boolean;
|
|
1404
1432
|
/**
|
|
1405
1433
|
* The name of the collection that the subscription is based on.
|
|
1406
1434
|
*/
|
|
@@ -1416,8 +1444,6 @@ declare class Subscription {
|
|
|
1416
1444
|
* @internal Because not exposed in any of the other SDKs (yet?).
|
|
1417
1445
|
*/
|
|
1418
1446
|
readonly collection: Collection;
|
|
1419
|
-
/** @internal */
|
|
1420
|
-
private readonly manager;
|
|
1421
1447
|
/**
|
|
1422
1448
|
* The corresponding named arguments for {@link query}, if any.
|
|
1423
1449
|
* @internal Because not exposed in any of the other SDKs (yet?).
|
|
@@ -1425,6 +1451,8 @@ declare class Subscription {
|
|
|
1425
1451
|
readonly queryArgsCBOR: Uint8Array | null;
|
|
1426
1452
|
/** @internal */
|
|
1427
1453
|
readonly contextInfo: SubscriptionContextInfo;
|
|
1454
|
+
private readonly manager;
|
|
1455
|
+
private _isCancelled;
|
|
1428
1456
|
}
|
|
1429
1457
|
|
|
1430
1458
|
/**
|
|
@@ -1711,14 +1739,19 @@ declare class LiveQuery {
|
|
|
1711
1739
|
readonly collection: Collection;
|
|
1712
1740
|
/** @internal */
|
|
1713
1741
|
readonly handler: QueryObservationHandler;
|
|
1714
|
-
/**
|
|
1742
|
+
/**
|
|
1743
|
+
* This field is only populated while a live query is active and set to null
|
|
1744
|
+
* when the live query is stopped.
|
|
1745
|
+
*
|
|
1746
|
+
* @internal
|
|
1747
|
+
*/
|
|
1715
1748
|
liveQueryManager: LiveQueryManager | null;
|
|
1716
|
-
|
|
1717
|
-
readonly liveQueryID: number;
|
|
1749
|
+
get liveQueryID(): number;
|
|
1718
1750
|
/** @internal */
|
|
1719
1751
|
constructor(query: string, queryArgs: QueryArguments | null, queryArgsCBOR: Uint8Array | null, orderBys: OrderBy[], limit: number, offset: number, collection: Collection, handler: QueryObservationHandler);
|
|
1720
1752
|
/** @internal */
|
|
1721
1753
|
signalNext(): Promise<void>;
|
|
1754
|
+
private _liveQueryID;
|
|
1722
1755
|
}
|
|
1723
1756
|
|
|
1724
1757
|
/** @internal */
|
|
@@ -1942,18 +1975,18 @@ declare class Ditto {
|
|
|
1942
1975
|
*
|
|
1943
1976
|
* @see {@link setOfflineOnlyLicenseToken | setOfflineOnlyLicenseToken()}
|
|
1944
1977
|
*/
|
|
1945
|
-
|
|
1978
|
+
get isActivated(): boolean;
|
|
1946
1979
|
/**
|
|
1947
1980
|
* `true` once {@link close | Ditto.close()} has been called, otherwise
|
|
1948
1981
|
* `false`.
|
|
1949
1982
|
*/
|
|
1950
|
-
|
|
1983
|
+
get isClosed(): boolean;
|
|
1951
1984
|
/**
|
|
1952
1985
|
* Returns `true` if sync is active, otherwise returns `false`. Use
|
|
1953
1986
|
* {@link startSync | startSync()} to activate and
|
|
1954
1987
|
* {@link stopSync | stopSync()} to deactivate sync.
|
|
1955
1988
|
*/
|
|
1956
|
-
|
|
1989
|
+
get isSyncActive(): boolean;
|
|
1957
1990
|
/**
|
|
1958
1991
|
* Application ID associated with the {@link Identity | identity} used by this
|
|
1959
1992
|
* Ditto instance.
|
|
@@ -2054,7 +2087,7 @@ declare class Ditto {
|
|
|
2054
2087
|
* @see {@link setTransportConfig | setTransportConfig()}
|
|
2055
2088
|
* @see {@link updateTransportConfig | updateTransportConfig()}
|
|
2056
2089
|
*/
|
|
2057
|
-
|
|
2090
|
+
get transportConfig(): TransportConfig;
|
|
2058
2091
|
/**
|
|
2059
2092
|
* Assigns a new transports configuration. By default peer-to-peer transports
|
|
2060
2093
|
* (Bluetooth, WiFi, and AWDL) are enabled. You may use this method to alter
|
|
@@ -2201,6 +2234,10 @@ declare class Ditto {
|
|
|
2201
2234
|
private isX509Valid;
|
|
2202
2235
|
private presenceManager;
|
|
2203
2236
|
private transportConditionsManager;
|
|
2237
|
+
private _isActivated;
|
|
2238
|
+
private _isSyncActive;
|
|
2239
|
+
private _isClosed;
|
|
2240
|
+
private _transportConfig;
|
|
2204
2241
|
/** Set of pending operations that need to complete before the Ditto instance can be closed in a safe manner. */
|
|
2205
2242
|
private pendingOperations;
|
|
2206
2243
|
private authClientValidityChanged;
|
|
@@ -2216,7 +2253,7 @@ declare class Ditto {
|
|
|
2216
2253
|
* @returns `true` iff all required APIs exist on `global`.
|
|
2217
2254
|
* @internal
|
|
2218
2255
|
*/
|
|
2219
|
-
declare const checkAPIs: (_globalObject?:
|
|
2256
|
+
declare const checkAPIs: (_globalObject?: typeof globalThis) => boolean;
|
|
2220
2257
|
/**
|
|
2221
2258
|
* Disable deadlock timeout when Node.js is running with `--inspect` parameter.
|
|
2222
2259
|
*
|
|
@@ -2741,9 +2778,9 @@ declare class ExperimentalChangeListener {
|
|
|
2741
2778
|
/**
|
|
2742
2779
|
* The arguments to this listener's query.
|
|
2743
2780
|
*/
|
|
2744
|
-
readonly queryArgs?:
|
|
2781
|
+
readonly queryArgs?: DQLQueryArguments;
|
|
2745
2782
|
/** @internal */
|
|
2746
|
-
constructor(store: ExperimentalStore, query: string, queryArgs:
|
|
2783
|
+
constructor(store: ExperimentalStore, query: string, queryArgs: DQLQueryArguments | null, onChange: ChangeHandler | ChangeHandlerWithSignalNext, onError?: ErrorHandler, withSignalNext?: boolean);
|
|
2747
2784
|
/**
|
|
2748
2785
|
* A change listener starts out in the `active` state and can be stopped by
|
|
2749
2786
|
* calling {@link ExperimentalChangeListener.stop | `stop()`} or letting it go
|
|
@@ -2908,7 +2945,7 @@ declare class ExperimentalReplicationSubscription {
|
|
|
2908
2945
|
* `true` when {@link cancel | cancel()} has been called or the Ditto instance
|
|
2909
2946
|
* managing this replication subscription has been closed.
|
|
2910
2947
|
*/
|
|
2911
|
-
|
|
2948
|
+
get isCancelled(): boolean;
|
|
2912
2949
|
/**
|
|
2913
2950
|
* Cancels a replication subscription and releases all associated resources.
|
|
2914
2951
|
*/
|
|
@@ -2923,10 +2960,55 @@ declare class ExperimentalReplicationSubscription {
|
|
|
2923
2960
|
* @internal
|
|
2924
2961
|
*/
|
|
2925
2962
|
readonly queryArgsCBOR: Uint8Array | null;
|
|
2926
|
-
|
|
2963
|
+
private _isCancelled;
|
|
2927
2964
|
private manager;
|
|
2928
2965
|
}
|
|
2929
2966
|
|
|
2967
|
+
/**
|
|
2968
|
+
* Represents single result object.
|
|
2969
|
+
* This API needs to be completed to navigate in the result object.
|
|
2970
|
+
* The result object is retrieved via FFI.dqlResultCBOR(Pointer<FFIDqlResult>).
|
|
2971
|
+
*
|
|
2972
|
+
* Currently experimental.
|
|
2973
|
+
*
|
|
2974
|
+
* @internal
|
|
2975
|
+
*/
|
|
2976
|
+
declare class ExperimentalDqlResult {
|
|
2977
|
+
get value(): any;
|
|
2978
|
+
/** @internal */
|
|
2979
|
+
storedValue: any;
|
|
2980
|
+
/**
|
|
2981
|
+
* FIXME: warn users who try to instantiate this class themselves
|
|
2982
|
+
*
|
|
2983
|
+
* @internal
|
|
2984
|
+
*/
|
|
2985
|
+
constructor();
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
/**
|
|
2989
|
+
* Represents the response from executing DQL statements.
|
|
2990
|
+
* Currently experimental.
|
|
2991
|
+
*
|
|
2992
|
+
* The memory management is quite complex. Every time when Rust is called
|
|
2993
|
+
* it will clone the result object. Rust mirror of DqlResponse contains
|
|
2994
|
+
* the collection of result objects. During the getting results call
|
|
2995
|
+
* Rust will copy DqlResult obejcts, thus JS here gets complete control
|
|
2996
|
+
* of their lifetimes.
|
|
2997
|
+
*
|
|
2998
|
+
* @internal
|
|
2999
|
+
*/
|
|
3000
|
+
declare class ExperimentalDqlResponse {
|
|
3001
|
+
get results(): ExperimentalDqlResult[];
|
|
3002
|
+
/** @internal */
|
|
3003
|
+
storedResults: ExperimentalDqlResult[] | undefined;
|
|
3004
|
+
/**
|
|
3005
|
+
* FIXME: warn users who try to instantiate this class themselves
|
|
3006
|
+
*
|
|
3007
|
+
* @internal
|
|
3008
|
+
*/
|
|
3009
|
+
constructor();
|
|
3010
|
+
}
|
|
3011
|
+
|
|
2930
3012
|
/**
|
|
2931
3013
|
* An addon for the Ditto store that contains experimental features. Accessible
|
|
2932
3014
|
* on `ditto.store.experimental`.
|
|
@@ -2964,7 +3046,7 @@ declare class ExperimentalStore {
|
|
|
2964
3046
|
*
|
|
2965
3047
|
* @internal
|
|
2966
3048
|
*/
|
|
2967
|
-
addChangeListener(query: string, onChange: ChangeHandler, onError?: ErrorHandler, queryArgs?:
|
|
3049
|
+
addChangeListener(query: string, onChange: ChangeHandler, onError?: ErrorHandler, queryArgs?: DQLQueryArguments): ExperimentalChangeListener;
|
|
2968
3050
|
/**
|
|
2969
3051
|
* Register a handler to be called whenever a query's results change in the
|
|
2970
3052
|
* local store and control when the next invocation of the change handler
|
|
@@ -2980,7 +3062,7 @@ declare class ExperimentalStore {
|
|
|
2980
3062
|
*
|
|
2981
3063
|
* @internal
|
|
2982
3064
|
*/
|
|
2983
|
-
addChangeListenerWithSignalNext(query: string, onChange: ChangeHandlerWithSignalNext, onError?: ErrorHandler, queryArgs?:
|
|
3065
|
+
addChangeListenerWithSignalNext(query: string, onChange: ChangeHandlerWithSignalNext, onError?: ErrorHandler, queryArgs?: DQLQueryArguments): ExperimentalChangeListener;
|
|
2984
3066
|
/**
|
|
2985
3067
|
* Registers a URL to be called whenever the given query observes changes.
|
|
2986
3068
|
*
|
|
@@ -2989,7 +3071,7 @@ declare class ExperimentalStore {
|
|
|
2989
3071
|
* @internal
|
|
2990
3072
|
* @returns a promise for a document id that acts as a webhook id
|
|
2991
3073
|
*/
|
|
2992
|
-
addChangeListenerWebhook(query: string, url: string, queryArgs?:
|
|
3074
|
+
addChangeListenerWebhook(query: string, url: string, queryArgs?: DQLQueryArguments): Promise<DocumentID>;
|
|
2993
3075
|
/**
|
|
2994
3076
|
* Run the provided query on the device of connected peers and send the
|
|
2995
3077
|
* results of the query back to the local peer's data store.
|
|
@@ -2997,29 +3079,44 @@ declare class ExperimentalStore {
|
|
|
2997
3079
|
* The returned {@link ExperimentalReplicationSubscription} object must be kept in scope
|
|
2998
3080
|
* for as long as you want to keep receiving updates.
|
|
2999
3081
|
*
|
|
3082
|
+
* Use placeholders to incorporate values from the optional `queryArguments`
|
|
3083
|
+
* parameter into the query. The keys of the `queryArguments` object must
|
|
3084
|
+
* match the placeholders used within the query. You can not use placeholders
|
|
3085
|
+
* in the `FROM` clause.
|
|
3086
|
+
*
|
|
3000
3087
|
* @internal
|
|
3001
3088
|
* @param query a Ditto Query Language query string of the form SELECT * FROM
|
|
3002
3089
|
* collection WHERE expression
|
|
3090
|
+
* @param queryArguments an object with values to be incorporated into a
|
|
3091
|
+
* query. The keys of the object must match the placeholders used within the
|
|
3092
|
+
* query.
|
|
3003
3093
|
* @returns {@link ExperimentalReplicationSubscription} object
|
|
3004
3094
|
*/
|
|
3005
|
-
addReplicationSubscription(query: string): ExperimentalReplicationSubscription;
|
|
3095
|
+
addReplicationSubscription(query: string, queryArguments?: DQLQueryArguments): ExperimentalReplicationSubscription;
|
|
3006
3096
|
/** @internal */
|
|
3007
3097
|
close(): void;
|
|
3008
3098
|
/**
|
|
3009
3099
|
* Executes the given query in the local store and returns the result.
|
|
3010
3100
|
*
|
|
3101
|
+
* Use placeholders to incorporate values from the optional `queryArguments`
|
|
3102
|
+
* parameter into the query. The keys of the `queryArguments` object must
|
|
3103
|
+
* match the placeholders used within the query. You can not use placeholders
|
|
3104
|
+
* in the `FROM` clause.
|
|
3105
|
+
*
|
|
3011
3106
|
* Limitations:
|
|
3012
3107
|
*
|
|
3013
3108
|
* - Supports `SELECT * FROM <collection name>` with optional `WHERE
|
|
3014
3109
|
* <expression>`
|
|
3015
|
-
* - No query parameters as function arguments yet
|
|
3016
3110
|
* - No transactions
|
|
3017
3111
|
*
|
|
3018
3112
|
* @internal
|
|
3019
3113
|
* @param query a Ditto Query Language query string
|
|
3114
|
+
* @param queryArguments an object with values to be incorporated into a
|
|
3115
|
+
* query. The keys of the object must match the placeholders used within the
|
|
3116
|
+
* query.
|
|
3020
3117
|
* @returns a promise for an array of Ditto documents matching the query
|
|
3021
3118
|
*/
|
|
3022
|
-
execute(query: string): Promise<
|
|
3119
|
+
execute(query: string, queryArguments?: DQLQueryArguments): Promise<ExperimentalDqlResponse>;
|
|
3023
3120
|
private replicationSubscriptionManager;
|
|
3024
3121
|
}
|
|
3025
3122
|
|
|
@@ -3421,5 +3518,5 @@ declare class CBOR {
|
|
|
3421
3518
|
static decode(data: Uint8Array): any;
|
|
3422
3519
|
}
|
|
3423
3520
|
|
|
3424
|
-
export { Address, Attachment, AttachmentFetchEvent, AttachmentFetchEventCompleted, AttachmentFetchEventDeleted, AttachmentFetchEventProgress, AttachmentFetchEventType, AttachmentFetcher, AttachmentToken, AuthenticationHandler, AuthenticationStatus, Authenticator, BasePendingCursorOperation, BasePendingIDSpecificOperation, CBOR, ChangeHandler, ChangeHandlerWithSignalNext, Collection, CollectionInterface, CollectionsEvent, CollectionsEventParams, CollectionsObservationHandler, ConditionSource, Connection, ConnectionType, Counter, CustomLogCallback, Ditto, Document, DocumentID, DocumentIDValue, DocumentPath, DocumentValue, ErrorHandler, ExperimentalChangeListener, ExperimentalChangeListenerManager, ExperimentalChangeListenerStatus, ExperimentalReplicationSubscription, ExperimentalReplicationSubscriptionContextInfo, ExperimentalReplicationSubscriptionManager, ExperimentalStore, Identity, IdentityManual, IdentityOfflinePlayground, IdentityOnlinePlayground, IdentityOnlineWithAuthentication, IdentitySharedKey, IdentityTypesRequiringOfflineLicenseToken, InitOptions, KeepAlive, LiveQuery, LiveQueryEvent, LiveQueryEventInitial, LiveQueryEventUpdate, LiveQueryEventUpdateParams, LiveQueryMove, LogLevel, Logger, MutableCounter, MutableDocument, MutableDocumentPath, MutableRegister, NotAvailableAuthenticator, Observer, ObserverOptions, OnlineAuthenticator, Peer, PendingCollectionsOperation, PendingCursorOperation, PendingIDSpecificOperation, Presence, PresenceConnectionType, PresenceGraph, QueryArguments, QueryObservationHandler, Register, RemotePeer, SingleDocumentLiveQueryEvent, SingleObservationHandler, SortDirection, Store, Subscription, TransportCondition, TransportConfig, TransportConfigConnect, TransportConfigGlobal, TransportConfigLan, TransportConfigListen, TransportConfigListenHTTP, TransportConfigListenTCP, TransportConfigPeerToPeer, UpdateResult, UpdateResultType, UpdateResultsMap, UpsertOptions, Value, WebAssemblyModule, WriteStrategy, WriteTransaction, WriteTransactionCollection, WriteTransactionPendingCursorOperation, WriteTransactionPendingIDSpecificOperation, WriteTransactionResult, addressToString, checkAPIs, disableDeadlockTimeoutWhenDebugging, getBridgeLoad, init, transportConfigFromDeserializable, transportConfigToSerializable, validateDocumentIDCBOR, validateDocumentIDValue };
|
|
3521
|
+
export { Address, Attachment, AttachmentFetchEvent, AttachmentFetchEventCompleted, AttachmentFetchEventDeleted, AttachmentFetchEventProgress, AttachmentFetchEventType, AttachmentFetcher, AttachmentToken, AuthenticationHandler, AuthenticationStatus, Authenticator, BasePendingCursorOperation, BasePendingIDSpecificOperation, CBOR, ChangeHandler, ChangeHandlerWithSignalNext, Collection, CollectionInterface, CollectionsEvent, CollectionsEventParams, CollectionsObservationHandler, ConditionSource, Connection, ConnectionType, Counter, CustomLogCallback, DQLQueryArgumentValue, DQLQueryArguments, Ditto, Document, DocumentID, DocumentIDValue, DocumentPath, DocumentValue, ErrorHandler, ExperimentalChangeListener, ExperimentalChangeListenerManager, ExperimentalChangeListenerStatus, ExperimentalReplicationSubscription, ExperimentalReplicationSubscriptionContextInfo, ExperimentalReplicationSubscriptionManager, ExperimentalStore, Identity, IdentityManual, IdentityOfflinePlayground, IdentityOnlinePlayground, IdentityOnlineWithAuthentication, IdentitySharedKey, IdentityTypesRequiringOfflineLicenseToken, InitOptions, KeepAlive, LiveQuery, LiveQueryEvent, LiveQueryEventInitial, LiveQueryEventUpdate, LiveQueryEventUpdateParams, LiveQueryMove, LogLevel, Logger, MutableCounter, MutableDocument, MutableDocumentPath, MutableRegister, NotAvailableAuthenticator, Observer, ObserverOptions, OnlineAuthenticator, Peer, PendingCollectionsOperation, PendingCursorOperation, PendingIDSpecificOperation, Presence, PresenceConnectionType, PresenceGraph, QueryArguments, QueryObservationHandler, Register, RemotePeer, SingleDocumentLiveQueryEvent, SingleObservationHandler, SortDirection, Store, Subscription, TransportCondition, TransportConfig, TransportConfigConnect, TransportConfigGlobal, TransportConfigLan, TransportConfigListen, TransportConfigListenHTTP, TransportConfigListenTCP, TransportConfigPeerToPeer, UpdateResult, UpdateResultType, UpdateResultsMap, UpsertOptions, Value, WebAssemblyModule, WriteStrategy, WriteTransaction, WriteTransactionCollection, WriteTransactionPendingCursorOperation, WriteTransactionPendingIDSpecificOperation, WriteTransactionResult, addressToString, checkAPIs, disableDeadlockTimeoutWhenDebugging, getBridgeLoad, init, transportConfigFromDeserializable, transportConfigToSerializable, validateDocumentIDCBOR, validateDocumentIDValue };
|
|
3425
3522
|
//# sourceMappingURL=ditto.d.ts.map
|