@dittolive/ditto 4.4.2 → 4.4.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/README.md +2 -2
- package/node/ditto.cjs.js +102 -1
- 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 +62 -1
- package/web/ditto.es6.js +1 -1
- package/web/ditto.umd.js +1 -1
- package/web/ditto.wasm +0 -0
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*Ditto is a cross platform SDK that allows mobile, web, and IoT apps to sync
|
|
4
4
|
with and even without connectivity.*
|
|
5
5
|
|
|
6
|
-
Version: **4.4.
|
|
6
|
+
Version: **4.4.4**
|
|
7
7
|
|
|
8
8
|
Please visit [ditto.live](https://ditto.live) for more info as well as the
|
|
9
|
-
[API Reference](https://software.ditto.live/js/Ditto/4.4.
|
|
9
|
+
[API Reference](https://software.ditto.live/js/Ditto/4.4.4/api-reference/) for this particular version.
|
|
10
10
|
|
|
11
11
|
--------------------------------------------------------------------------------
|
|
12
12
|
|
package/node/ditto.cjs.js
CHANGED
|
@@ -376,6 +376,10 @@ function ditto_set_static_tcp_clients(...args) { return ditto.ditto_set_static_t
|
|
|
376
376
|
function ditto_set_static_websocket_clients(...args) { return ditto.ditto_set_static_websocket_clients(...args) }
|
|
377
377
|
function ditto_set_sync_group(...args) { return ditto.ditto_set_sync_group(...args) }
|
|
378
378
|
function ditto_shutdown(...args) { return ditto.ditto_shutdown(...args) }
|
|
379
|
+
function ditto_small_peer_info_get_is_enabled(...args) { return ditto.ditto_small_peer_info_get_is_enabled(...args) }
|
|
380
|
+
function ditto_small_peer_info_get_sync_scope(...args) { return ditto.ditto_small_peer_info_get_sync_scope(...args) }
|
|
381
|
+
function ditto_small_peer_info_set_enabled(...args) { return ditto.ditto_small_peer_info_set_enabled(...args) }
|
|
382
|
+
function ditto_small_peer_info_set_sync_scope(...args) { return ditto.ditto_small_peer_info_set_sync_scope(...args) }
|
|
379
383
|
function ditto_small_peer_info_set_transport_config_data(...args) { return ditto.ditto_small_peer_info_set_transport_config_data(...args) }
|
|
380
384
|
function ditto_start_http_server(...args) { return ditto.ditto_start_http_server(...args) }
|
|
381
385
|
function ditto_start_tcp_server(...args) { return ditto.ditto_start_tcp_server(...args) }
|
|
@@ -1035,6 +1039,26 @@ async function dittoClearPresenceV3Callback(self) {
|
|
|
1035
1039
|
ditto_clear_presence_v3_callback(self);
|
|
1036
1040
|
}
|
|
1037
1041
|
/** @internal */
|
|
1042
|
+
function dittoSmallPeerInfoGetIsEnabled(dittoPointer) {
|
|
1043
|
+
ensureInitialized();
|
|
1044
|
+
return ditto_small_peer_info_get_is_enabled(dittoPointer);
|
|
1045
|
+
}
|
|
1046
|
+
/** @internal */
|
|
1047
|
+
async function dittoSmallPeerInfoSetEnabled(dittoPointer, isEnabled) {
|
|
1048
|
+
ensureInitialized();
|
|
1049
|
+
ditto_small_peer_info_set_enabled(dittoPointer, isEnabled);
|
|
1050
|
+
}
|
|
1051
|
+
/** @internal */
|
|
1052
|
+
async function dittoSmallPeerInfoGetSyncScope(dittoPointer) {
|
|
1053
|
+
ensureInitialized();
|
|
1054
|
+
return ditto_small_peer_info_get_sync_scope(dittoPointer);
|
|
1055
|
+
}
|
|
1056
|
+
/** @internal */
|
|
1057
|
+
async function dittoSmallPeerInfoSetSyncScope(dittoPointer, syncScope) {
|
|
1058
|
+
ensureInitialized();
|
|
1059
|
+
return ditto_small_peer_info_set_sync_scope(dittoPointer, syncScope);
|
|
1060
|
+
}
|
|
1061
|
+
/** @internal */
|
|
1038
1062
|
async function dittoSmallPeerInfoCollectionSetTransportConfigData(self, transportConfigData) {
|
|
1039
1063
|
ensureInitialized();
|
|
1040
1064
|
ditto_small_peer_info_set_transport_config_data(self, transportConfigData);
|
|
@@ -1521,7 +1545,7 @@ function awdlDestroy(awdl) {
|
|
|
1521
1545
|
|
|
1522
1546
|
// NOTE: this is patched up with the actual build version by Jake task
|
|
1523
1547
|
// build:package and has to be a valid semantic version as defined here: https://semver.org.
|
|
1524
|
-
const fullBuildVersionString = '4.4.
|
|
1548
|
+
const fullBuildVersionString = '4.4.4';
|
|
1525
1549
|
|
|
1526
1550
|
//
|
|
1527
1551
|
// Copyright © 2021 DittoLive Incorporated. All rights reserved.
|
|
@@ -7868,6 +7892,81 @@ class AttachmentFetcherManager {
|
|
|
7868
7892
|
}
|
|
7869
7893
|
}
|
|
7870
7894
|
|
|
7895
|
+
//
|
|
7896
|
+
// Copyright © 2023 DittoLive Incorporated. All rights reserved.
|
|
7897
|
+
//
|
|
7898
|
+
/**
|
|
7899
|
+
* The entrypoint for small peer user info collection. Small peer info consists of information
|
|
7900
|
+
* gathered into a system collection on a regular interval and optionally synced to the Big Peer
|
|
7901
|
+
* for device dashboard and debugging purposes.
|
|
7902
|
+
*
|
|
7903
|
+
* You don't create this class directly, but can access it from a particular `Ditto`
|
|
7904
|
+
* instance via its {@link Ditto.smallPeerInfo | `smallPeerInfo`} property.
|
|
7905
|
+
*/
|
|
7906
|
+
class SmallPeerInfo {
|
|
7907
|
+
/**
|
|
7908
|
+
* Indicates whether small peer info collection is currently enabled, defaults
|
|
7909
|
+
* to `false`.
|
|
7910
|
+
*
|
|
7911
|
+
* Note: whether the background ingestion process is enabled or not is a
|
|
7912
|
+
* separate decision to whether this information is allowed to sync to other
|
|
7913
|
+
* peers (including the big peer). This is controlled by
|
|
7914
|
+
* {@link getSyncScope | getSyncScope()} and
|
|
7915
|
+
* {@link setSyncScope | setSyncScope()}.
|
|
7916
|
+
*/
|
|
7917
|
+
get isEnabled() {
|
|
7918
|
+
const dittoHandle = Bridge.ditto.handleFor(this.ditto);
|
|
7919
|
+
return this.ditto.deferClose(() => {
|
|
7920
|
+
return dittoSmallPeerInfoGetIsEnabled(dittoHandle.deref());
|
|
7921
|
+
});
|
|
7922
|
+
}
|
|
7923
|
+
/**
|
|
7924
|
+
* Set whether small peer info collection is enabled.
|
|
7925
|
+
*
|
|
7926
|
+
* @throws when set to a non-boolean value.
|
|
7927
|
+
*/
|
|
7928
|
+
set isEnabled(newValue) {
|
|
7929
|
+
if (typeof newValue !== 'boolean') {
|
|
7930
|
+
throw new TypeError(`Expected boolean, got ${typeof newValue}`);
|
|
7931
|
+
}
|
|
7932
|
+
const dittoHandle = Bridge.ditto.handleFor(this.ditto);
|
|
7933
|
+
this.ditto.deferClose(() => {
|
|
7934
|
+
dittoSmallPeerInfoSetEnabled(dittoHandle.deref(), newValue);
|
|
7935
|
+
});
|
|
7936
|
+
}
|
|
7937
|
+
/**
|
|
7938
|
+
* Determines which "kind" of peers the small peer info will be
|
|
7939
|
+
* replicated to.
|
|
7940
|
+
*
|
|
7941
|
+
* Defaults to `LocalPeerOnly`, which means no replication. Set this to
|
|
7942
|
+
* `BigPeerOnly` to replicate collected info to the Big Peer.
|
|
7943
|
+
*/
|
|
7944
|
+
async getSyncScope() {
|
|
7945
|
+
const dittoHandle = Bridge.ditto.handleFor(this.ditto);
|
|
7946
|
+
return this.ditto.deferCloseAsync(async () => {
|
|
7947
|
+
return dittoSmallPeerInfoGetSyncScope(dittoHandle.deref());
|
|
7948
|
+
});
|
|
7949
|
+
}
|
|
7950
|
+
/**
|
|
7951
|
+
* Set the sync scope.
|
|
7952
|
+
*
|
|
7953
|
+
* See {@link getSyncScope} for more information.
|
|
7954
|
+
*
|
|
7955
|
+
* @param syncScope the new sync scope.
|
|
7956
|
+
* @throws when set to a value other than `BigPeerOnly` or `LocalPeerOnly`.
|
|
7957
|
+
*/
|
|
7958
|
+
async setSyncScope(syncScope) {
|
|
7959
|
+
const dittoHandle = Bridge.ditto.handleFor(this.ditto);
|
|
7960
|
+
return this.ditto.deferCloseAsync(async () => {
|
|
7961
|
+
return dittoSmallPeerInfoSetSyncScope(dittoHandle.deref(), syncScope);
|
|
7962
|
+
});
|
|
7963
|
+
}
|
|
7964
|
+
/** @internal */
|
|
7965
|
+
constructor(ditto) {
|
|
7966
|
+
this.ditto = ditto;
|
|
7967
|
+
}
|
|
7968
|
+
}
|
|
7969
|
+
|
|
7871
7970
|
//
|
|
7872
7971
|
// Copyright © 2021 DittoLive Incorporated. All rights reserved.
|
|
7873
7972
|
//
|
|
@@ -8045,6 +8144,7 @@ class Ditto {
|
|
|
8045
8144
|
// mark the instance as activated from the get-go in that case.
|
|
8046
8145
|
this.isActivated = !IdentityTypesRequiringOfflineLicenseToken.includes(validIdentity.type);
|
|
8047
8146
|
this.store = new Store(this);
|
|
8147
|
+
this.smallPeerInfo = new SmallPeerInfo(this);
|
|
8048
8148
|
this.presence = new Presence(this);
|
|
8049
8149
|
this.presenceManager = new PresenceManager(this);
|
|
8050
8150
|
this.liveQueryManager = new LiveQueryManager(this, this.keepAlive);
|
|
@@ -8709,6 +8809,7 @@ exports.PendingIDSpecificOperation = PendingIDSpecificOperation;
|
|
|
8709
8809
|
exports.Presence = Presence;
|
|
8710
8810
|
exports.Register = Register;
|
|
8711
8811
|
exports.SingleDocumentLiveQueryEvent = SingleDocumentLiveQueryEvent;
|
|
8812
|
+
exports.SmallPeerInfo = SmallPeerInfo;
|
|
8712
8813
|
exports.Store = Store;
|
|
8713
8814
|
exports.Subscription = Subscription;
|
|
8714
8815
|
exports.TransportConfig = TransportConfig;
|
|
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.4",
|
|
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
|
@@ -1866,6 +1866,63 @@ declare class AttachmentFetcherManager {
|
|
|
1866
1866
|
private stopWithContextInfo;
|
|
1867
1867
|
}
|
|
1868
1868
|
|
|
1869
|
+
/**
|
|
1870
|
+
* Specifies which peers to replicate the small peer info to when enabled.
|
|
1871
|
+
*
|
|
1872
|
+
* Possible values are:
|
|
1873
|
+
*
|
|
1874
|
+
* - `LocalPeerOnly`: no replication (default)
|
|
1875
|
+
* - `BigPeerOnly`: replicate to the Big Peer
|
|
1876
|
+
*/
|
|
1877
|
+
type SmallPeerInfoSyncScope = 'LocalPeerOnly' | 'BigPeerOnly';
|
|
1878
|
+
/**
|
|
1879
|
+
* The entrypoint for small peer user info collection. Small peer info consists of information
|
|
1880
|
+
* gathered into a system collection on a regular interval and optionally synced to the Big Peer
|
|
1881
|
+
* for device dashboard and debugging purposes.
|
|
1882
|
+
*
|
|
1883
|
+
* You don't create this class directly, but can access it from a particular `Ditto`
|
|
1884
|
+
* instance via its {@link Ditto.smallPeerInfo | `smallPeerInfo`} property.
|
|
1885
|
+
*/
|
|
1886
|
+
declare class SmallPeerInfo {
|
|
1887
|
+
/**
|
|
1888
|
+
* Indicates whether small peer info collection is currently enabled, defaults
|
|
1889
|
+
* to `false`.
|
|
1890
|
+
*
|
|
1891
|
+
* Note: whether the background ingestion process is enabled or not is a
|
|
1892
|
+
* separate decision to whether this information is allowed to sync to other
|
|
1893
|
+
* peers (including the big peer). This is controlled by
|
|
1894
|
+
* {@link getSyncScope | getSyncScope()} and
|
|
1895
|
+
* {@link setSyncScope | setSyncScope()}.
|
|
1896
|
+
*/
|
|
1897
|
+
get isEnabled(): boolean;
|
|
1898
|
+
/**
|
|
1899
|
+
* Set whether small peer info collection is enabled.
|
|
1900
|
+
*
|
|
1901
|
+
* @throws when set to a non-boolean value.
|
|
1902
|
+
*/
|
|
1903
|
+
set isEnabled(newValue: boolean);
|
|
1904
|
+
/**
|
|
1905
|
+
* Determines which "kind" of peers the small peer info will be
|
|
1906
|
+
* replicated to.
|
|
1907
|
+
*
|
|
1908
|
+
* Defaults to `LocalPeerOnly`, which means no replication. Set this to
|
|
1909
|
+
* `BigPeerOnly` to replicate collected info to the Big Peer.
|
|
1910
|
+
*/
|
|
1911
|
+
getSyncScope(): Promise<SmallPeerInfoSyncScope>;
|
|
1912
|
+
/**
|
|
1913
|
+
* Set the sync scope.
|
|
1914
|
+
*
|
|
1915
|
+
* See {@link getSyncScope} for more information.
|
|
1916
|
+
*
|
|
1917
|
+
* @param syncScope the new sync scope.
|
|
1918
|
+
* @throws when set to a value other than `BigPeerOnly` or `LocalPeerOnly`.
|
|
1919
|
+
*/
|
|
1920
|
+
setSyncScope(syncScope: SmallPeerInfoSyncScope): Promise<void>;
|
|
1921
|
+
private ditto;
|
|
1922
|
+
/** @internal */
|
|
1923
|
+
constructor(ditto: Ditto);
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1869
1926
|
/** Types of connections that can be established between two peers. */
|
|
1870
1927
|
type TransportCondition = 'Unknown' | 'OK' | 'GenericFailure' | 'AppInBackground' | 'MDNSFailure' | 'TCPListenFailure' | 'NoBLECentralPermission' | 'NoBLEPeripheralPermission' | 'CannotEstablishConnection' | 'BLEDisabled' | 'NoBLEHardware' | 'WiFiDisabled' | 'TemporarilyUnavailable';
|
|
1871
1928
|
/** The source for a transport condition. */
|
|
@@ -1937,6 +1994,10 @@ declare class Ditto {
|
|
|
1937
1994
|
* The site ID that the instance of `Ditto` is using as part of its identity.
|
|
1938
1995
|
*/
|
|
1939
1996
|
readonly siteID: number | BigInt;
|
|
1997
|
+
/**
|
|
1998
|
+
* Provides access to the SDK's small peer info functionality.
|
|
1999
|
+
*/
|
|
2000
|
+
readonly smallPeerInfo: SmallPeerInfo;
|
|
1940
2001
|
/**
|
|
1941
2002
|
* Returns `true` if an offline license token has been set, otherwise returns `false`.
|
|
1942
2003
|
*
|
|
@@ -3421,5 +3482,5 @@ declare class CBOR {
|
|
|
3421
3482
|
static decode(data: Uint8Array): any;
|
|
3422
3483
|
}
|
|
3423
3484
|
|
|
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 };
|
|
3485
|
+
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, SmallPeerInfo, SmallPeerInfoSyncScope, 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
3486
|
//# sourceMappingURL=ditto.d.ts.map
|