@dittolive/ditto 4.8.0-rc.1 → 4.8.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/README.md +2 -2
- package/node/ditto.cjs.js +31 -18
- 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-arm64.node +0 -0
- package/node/ditto.linux-x64.node +0 -0
- package/node/ditto.win32-x64.node +0 -0
- package/package.json +1 -1
- package/react-native/ditto.es6.js +1 -1
- package/types/ditto.d.ts +27 -17
- 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.8.0
|
|
6
|
+
Version: **4.8.0**
|
|
7
7
|
|
|
8
8
|
For more information please visit [ditto.live](https://ditto.live), as well as the
|
|
9
|
-
[API Reference](https://software.ditto.live/js/Ditto/4.8.0
|
|
9
|
+
[API Reference](https://software.ditto.live/js/Ditto/4.8.0/api-reference/) for this particular version.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
package/node/ditto.cjs.js
CHANGED
|
@@ -2233,7 +2233,7 @@ class AttachmentToken {
|
|
|
2233
2233
|
|
|
2234
2234
|
// NOTE: this is patched up with the actual build version by Jake task
|
|
2235
2235
|
// build:package and has to be a valid semantic version as defined here: https://semver.org.
|
|
2236
|
-
const fullBuildVersionString = '4.8.0
|
|
2236
|
+
const fullBuildVersionString = '4.8.0';
|
|
2237
2237
|
|
|
2238
2238
|
//
|
|
2239
2239
|
// Copyright © 2021 DittoLive Incorporated. All rights reserved.
|
|
@@ -2318,7 +2318,13 @@ class Logger {
|
|
|
2318
2318
|
var _a;
|
|
2319
2319
|
this.setLogFile((_a = url === null || url === void 0 ? void 0 : url.pathname) !== null && _a !== void 0 ? _a : null);
|
|
2320
2320
|
}
|
|
2321
|
-
/**
|
|
2321
|
+
/**
|
|
2322
|
+
* Whether the logger is currently enabled.
|
|
2323
|
+
*
|
|
2324
|
+
* Logs exported through {@link exportToFile | exportToFile()} are not
|
|
2325
|
+
* affected by this setting and will also include logs emitted while
|
|
2326
|
+
* {@link enabled} is `false`.
|
|
2327
|
+
*/
|
|
2322
2328
|
static get enabled() {
|
|
2323
2329
|
return loggerEnabledGet();
|
|
2324
2330
|
}
|
|
@@ -2345,6 +2351,9 @@ class Logger {
|
|
|
2345
2351
|
*
|
|
2346
2352
|
* For example if this is set to `Warning`, then only logs that are logged
|
|
2347
2353
|
* with the `Warning` or `Error` log levels will be shown.
|
|
2354
|
+
*
|
|
2355
|
+
* Logs exported through {@link exportToFile | exportToFile()} are not
|
|
2356
|
+
* affected by this setting and include all logs at `Debug` level and above.
|
|
2348
2357
|
*/
|
|
2349
2358
|
static get minimumLogLevel() {
|
|
2350
2359
|
return loggerMinimumLogLevelGet();
|
|
@@ -2373,10 +2382,14 @@ class Logger {
|
|
|
2373
2382
|
* unregister any previous callback and stop reporting log entries through
|
|
2374
2383
|
* callbacks.
|
|
2375
2384
|
*
|
|
2385
|
+
* @throws {TypeError} if `callback` is not a function or `undefined`.
|
|
2376
2386
|
* @throws {Error} if called in a React Native environment.
|
|
2377
2387
|
*/
|
|
2378
2388
|
static async setCustomLogCallback(callback) {
|
|
2379
|
-
if (callback) {
|
|
2389
|
+
if (callback != null && typeof callback !== 'function') {
|
|
2390
|
+
throw new TypeError(`Expected parameter 'callback' to be a function or undefined, but got ${typeof callback}.`);
|
|
2391
|
+
}
|
|
2392
|
+
if (callback != null) {
|
|
2380
2393
|
await loggerSetCustomLogCb(callback);
|
|
2381
2394
|
this._customLogCallback = callback;
|
|
2382
2395
|
}
|
|
@@ -2389,25 +2402,25 @@ class Logger {
|
|
|
2389
2402
|
* Exports collected logs to a compressed and JSON-encoded file on the local
|
|
2390
2403
|
* file system.
|
|
2391
2404
|
*
|
|
2392
|
-
* Ditto's logger locally collects
|
|
2393
|
-
* periodically discarding older logs
|
|
2394
|
-
*
|
|
2395
|
-
*
|
|
2396
|
-
*
|
|
2405
|
+
* Ditto's logger locally collects a limited amount of logs at `Debug` level
|
|
2406
|
+
* and above, periodically discarding older logs. This internal logger is
|
|
2407
|
+
* always enabled and works independently of the {@link Logger.enabled}
|
|
2408
|
+
* setting and the configured {@link Logger.minimumLogLevel}. Its logs can be
|
|
2409
|
+
* requested and downloaded from any peer that is active in a Ditto app using
|
|
2410
|
+
* the portal's device dashboard. This method provides an alternative way of
|
|
2411
|
+
* accessing those logs by exporting them to the local file system.
|
|
2397
2412
|
*
|
|
2398
|
-
* The logs will be written as a gzip compressed file at the path specified
|
|
2399
|
-
*
|
|
2400
|
-
*
|
|
2413
|
+
* The logs will be written as a gzip compressed file at the path specified by
|
|
2414
|
+
* the `path` parameter. When uncompressed, the file contains one JSON value
|
|
2415
|
+
* per line with the oldest entry on the first line (JSON lines format).
|
|
2401
2416
|
*
|
|
2402
|
-
*
|
|
2403
|
-
*
|
|
2404
|
-
*
|
|
2405
|
-
* on disk to a maximum of 15 MB, so setting a lower verbosity level can
|
|
2406
|
-
* extend the time period covered by the exported logs up to a maximum of
|
|
2407
|
-
* three days.
|
|
2417
|
+
* Ditto limits the amount of logs it retains on disk to 15 MB and a maximum
|
|
2418
|
+
* age of three days. Older logs are periodically discarded once one of these
|
|
2419
|
+
* limits is reached.
|
|
2408
2420
|
*
|
|
2409
2421
|
* This method currently only exports logs from the most recently created
|
|
2410
|
-
* Ditto instance, even when multiple instances are running in the same
|
|
2422
|
+
* Ditto instance, even when multiple instances are running in the same
|
|
2423
|
+
* process.
|
|
2411
2424
|
*
|
|
2412
2425
|
* Not supported in browser environments.
|
|
2413
2426
|
*
|
|
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.8.0
|
|
3
|
+
"version": "4.8.0",
|
|
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",
|