### Setup Synclets Repository Source: https://synclets.org/guides/agents-guide Commands to clone the repository and install dependencies. ```bash git clone https://github.com/tinyplex/synclets.git cd synclets npm install ``` -------------------------------- ### start() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/lifecycle/start Starts the Synclet and begins synchronization. ```APIDOC ## start() ### Description The `start` method starts the `Synclet` and begins synchronization. ### Signature `start(): Promise` ### Returns - **Promise** - A promise that resolves when the start operation is complete. ### Since v0.0.0 ``` -------------------------------- ### start() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/lifecycle Starts the Synclet and initiates the synchronization process. ```APIDOC ## start() ### Description The `start` method starts the `Synclet` and begins synchronization. ``` -------------------------------- ### Initialize DurableObjectSqliteDataConnector Source: https://synclets.org/api/durable-object/type-aliases/type/durableobjectsqlitedataconnectoroptions Example usage of creating a data connector with the required options. ```javascript const dataConnector = createDurableObjectSqliteDataConnector({ depth: 3, sqlStorage: this.ctx.storage.sql, dataTable: 'data', addressColumn: 'address', atomColumn: 'atom', }); ``` -------------------------------- ### BrokerOnlyDurableObject start method signature Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/lifecycle/start The start method returns a promise that resolves when the Synclet has successfully started. ```typescript start(): Promise ``` -------------------------------- ### Compose and Start Synclet Source: https://synclets.org/ Integrates the data connector, meta connector, and transport to initialize and start the synchronization process. ```typescript import {createSynclet} from 'synclets'; const synclet = await createSynclet({ dataConnector, metaConnector, transport, }); await synclet.start(); // ... await synclet.destroy(); ``` -------------------------------- ### Create a Durable Object Broker Transport Source: https://synclets.org/api/durable-object/type-aliases/type/durableobjectbrokertransportoptions Example of initializing a broker transport with specific path and routing constraints. ```javascript const transport = createDurableObjectBrokerTransport({ durableObject: this, path: null, // Broker-only mode brokerPaths: /room[0-9]+/, // Only broker paths matching this pattern }); ``` -------------------------------- ### Run Documentation Tests Source: https://synclets.org/guides/agents-guide Execute the automated test suite to validate all inline code examples across the project. ```bash npx vitest run ./test/unit/documentation.test.ts --retry=0 ``` -------------------------------- ### Initialize DurableObjectSqliteMetaConnector Source: https://synclets.org/api/durable-object/type-aliases/type/durableobjectsqlitemetaconnectoroptions Example usage of creating a meta connector using the specified options within a Durable Object context. ```javascript const metaConnector = createDurableObjectSqliteMetaConnector({ depth: 3, sqlStorage: this.ctx.storage.sql, metaTable: 'meta', addressColumn: 'address', timestampColumn: 'timestamp', }); ``` -------------------------------- ### Wrangler configuration for Durable Objects Source: https://synclets.org/api/durable-object/functions/creation/getsyncletdurableobjectfetch Example configuration required in wrangler.toml to bind a Durable Object class to a namespace. ```toml [[durable_objects.bindings]] name = "MyDurableObjects" class_name = "MyDurableObject" ``` -------------------------------- ### isStarted method signature Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/accessor/isstarted Returns a boolean value indicating the current started status of the Synclet. ```typescript isStarted(): boolean ``` -------------------------------- ### isStarted() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/accessor/isstarted Returns a boolean value indicating if the Synclet is currently started. ```APIDOC ## isStarted() ### Description The `isStarted` method returns whether the `Synclet` is currently started. ### Signature `isStarted(): boolean` ### Returns - **boolean** - True if started, false otherwise. ### Since v0.0.0 ``` -------------------------------- ### The Essentials Source: https://synclets.org/api Core factory functions for initializing Synclets, connectors, and transport layers. ```APIDOC ## createSynclet ## createDataConnector ## createMetaConnector ## createTransport ### Description These essential functions serve as the primary entry points for initializing the Synclets framework components. ``` -------------------------------- ### Common Development Commands Source: https://synclets.org/guides/agents-guide Standard npm scripts for testing, linting, and documentation generation. ```bash npm run compileAndTestUnit # Compile and run unit tests npm run testUnitFast # Quick test iteration npm run lint # Run ESLint npm run spell # Spell check npm run preCommit # Full pre-commit check npm run compileDocs # Generate API documentation npm run serveDocs # Preview documentation locally ``` -------------------------------- ### getCreateOptions() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation/getcreateoptions Retrieves additional configuration options for the Synclet. ```APIDOC ## getCreateOptions() ### Description The `getCreateOptions` method can optionally be implemented to provide additional options for the `Synclet`, such as logging configuration. ### Signature `getCreateOptions(): SyncletOptions` ### Returns - **SyncletOptions** - A `SyncletOptions` object with additional configuration. ### Since v0.0.0 ``` -------------------------------- ### Project Directory Structure Source: https://synclets.org/guides/agents-guide Overview of the Synclets repository file organization. ```text synclets/ ├── src/ # Source code │ ├── @types/ # TypeScript declarations │ ├── browser/ # Browser storage and transport (LocalStorage, SessionStorage, BroadcastChannel) │ ├── core/ # Core synclet implementation │ ├── database/ # Shared SQL utilities │ ├── durable-object/ # Cloudflare Durable Object transport │ ├── fs/ # File system connectors │ ├── memory/ # Memory connectors and transport │ ├── pglite/ # PGlite database connectors │ ├── server/ # Server utilities │ ├── sqlite3/ # SQLite3 database connectors │ ├── tinybase/ # TinyBase connectors │ ├── ws/ # WebSocket transport and broker │ ├── utils/ # Shared utilities │ ├── common/ # Common code │ └── index.ts # Main entry point ├── test/ # Tests │ ├── unit/ # Unit tests │ ├── perf/ # Performance tests │ ├── e2e/ # End-to-end tests │ └── prod/ # Production build tests ├── docs/ # Generated documentation ├── dist/ # Build output ├── site/ # Documentation site source ├── servers/ # Example servers ├── gulpfile.mjs # Build configuration ├── vitest.config.ts # Test configuration ├── eslint.config.js # Linting rules └── tsconfig.json # TypeScript config ``` -------------------------------- ### Synchronize PGlite and SQLite via WebSockets Source: https://synclets.org/guides/releases Demonstrates initializing two Synclets with different storage backends and connecting them over a WebSocket transport. ```typescript import {PGlite} from '@electric-sql/pglite'; import {Database} from 'sqlite3'; import {createSynclet} from 'synclets'; import {getUniqueId} from 'synclets/utils'; import { createPgliteDataConnector, createPgliteMetaConnector, } from 'synclets/pglite'; import { createSqlite3DataConnector, createSqlite3MetaConnector, } from 'synclets/sqlite3'; import {createWsClientTransport} from 'synclets/ws'; import {WebSocket} from 'ws'; const SERVER = 'wss://demo.synclets.org/' + getUniqueId(); // Synclet 1 (PGlite) const pglite = await PGlite.create(); const synclet1 = await createSynclet({ dataConnector: createPgliteDataConnector({depth: 1, pglite}), metaConnector: createPgliteMetaConnector({depth: 1, pglite}), transport: createWsClientTransport({webSocket: new WebSocket(SERVER)}), }); await synclet1.start(); // Synclet 2 (SQLite) const database = new Database(':memory:'); const synclet2 = await createSynclet({ dataConnector: createSqlite3DataConnector({depth: 1, database}), metaConnector: createSqlite3MetaConnector({depth: 1, database}), transport: createWsClientTransport({webSocket: new WebSocket(SERVER)}), }); await synclet2.start(); // Set some data on Synclet 1 await synclet1.setAtom(['foo'], 'bar'); console.log(await synclet1.getData()); // -> {foo: 'bar'} // ... wait a moment for synchronization to Synclet 2 console.log(await synclet2.getData()); // -> {foo: 'bar'} await synclet1.destroy(); await synclet2.destroy(); ``` -------------------------------- ### getCreateOptions Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation Provides additional options for the Synclet. ```APIDOC ## getCreateOptions ### Description This method can optionally be implemented to provide additional options for the Synclet, such as logging configuration. ``` -------------------------------- ### getStore() Source: https://synclets.org/api/tinybase/interfaces/connector/tinybasedataconnector/methods/accessor/getstore Retrieves the wrapped TinyBase Store instance. ```APIDOC ## getStore() ### Description The `getStore` method returns the wrapped TinyBase Store instance associated with the connector. ### Signature `getStore(): Store` ### Returns - **Store** - The TinyBase Store instance. ### Since v0.0.0 ``` -------------------------------- ### createSynclet Source: https://synclets.org/api/synclets/functions Initializes a fully configured Synclet instance by wiring together components, implementations, and options. ```APIDOC ## createSynclet ### Description The `createSynclet` function wires the provided components, implementations, and options into a fully configured `Synclet` instance. ``` -------------------------------- ### createLocalStorageSynclet(options: LocalStorageSyncletOptions) Source: https://synclets.org/api/browser/functions/synclet/createlocalstoragesynclet Creates a complete Synclet with localStorage-backed data and meta connectors in a single call. ```APIDOC ## createLocalStorageSynclet ### Description The `createLocalStorageSynclet` function creates a complete `Synclet` with localStorage-backed data and meta connectors in a single call. This is the most convenient way to create a browser-based `Synclet`, handling connector creation and synclet setup with a single options object. Both data and metadata persist across browser sessions. ### Signature `createLocalStorageSynclet(options: LocalStorageSyncletOptions): Promise>` ### Parameters - **options** (`LocalStorageSyncletOptions`) - Required - Configuration options including storage names, depth, transport, and other synclet settings. ### Returns - **Promise>** - A Promise that resolves to a fully configured `Synclet` instance. ### Since v0.0.0 ``` -------------------------------- ### LocalStorageMetaConnectorOptions Source: https://synclets.org/api/browser/type-aliases/type/localstoragemetaconnectoroptions Configuration options for creating a localStorage-backed MetaConnector. ```APIDOC ## LocalStorageMetaConnectorOptions ### Description The `LocalStorageMetaConnectorOptions` type describes the configuration options for creating a localStorage-backed `MetaConnector`. ### Definition `( {metaStorageName: string} & MetaConnectorOptions )` ### Properties - **metaStorageName** (string) - The localStorage key used for metadata storage. ``` -------------------------------- ### createFileSynclet(options: FileSyncletOptions): Promise> Source: https://synclets.org/api/fs/functions/connector/createfilesynclet Creates a file-backed Synclet with both data and metadata persistence in a single call. ```APIDOC ## createFileSynclet ### Description The `createFileSynclet` function creates a file-backed `Synclet` with both data and metadata persistence in a single call. This is the recommended approach for file-based persistence in Node.js. ### Signature `createFileSynclet(options: FileSyncletOptions): Promise>` ### Parameters - **options** (`FileSyncletOptions`) - Required - Configuration object specifying file paths, transport, and other `Synclet` options. ### Returns - **Promise>** - A Promise resolving to the configured `Synclet` instance. ### Since v0.0.0 ``` -------------------------------- ### createWsClientTransport(options: WsClientTransportOptions): WsClientTransport Source: https://synclets.org/api/ws/functions/transport/createwsclienttransport Initializes a WebSocket client transport for real-time communication and synchronization. ```APIDOC ## createWsClientTransport ### Description The `createWsClientTransport` function wraps a WebSocket in a `WsClientTransport` implementation. It enables real-time synchronization over network connections, handling automatic reconnection, packet fragmentation, and bidirectional communication. ### Signature `createWsClientTransport(options: WsClientTransportOptions): WsClientTransport` ### Parameters - **options** (`WsClientTransportOptions`) - Required - Configuration options for the transport. ### Returns - `WsClientTransport` - A `WsClientTransport` instance for WebSocket communication. ### Usage Notes - Suitable for browser environments (using Web API WebSocket) and Node.js (using the 'ws' package). - Connects to servers running `WsBrokerTransport` or compatible server synclets. ### Since v0.0.0 ``` -------------------------------- ### createTinyBaseSynclet Source: https://synclets.org/api/tinybase/functions Creates a Synclet with a TinyBase Store for data storage and in-memory metadata storage. ```APIDOC ## createTinyBaseSynclet ### Description The `createTinyBaseSynclet` function creates a `Synclet` with a TinyBase Store for data storage and in-memory metadata storage. ``` -------------------------------- ### getCreateOptions Method Signature Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation/getcreateoptions Defines the method signature for retrieving Synclet configuration options. ```typescript getCreateOptions(): SyncletOptions ``` -------------------------------- ### getStore Source: https://synclets.org/api/tinybase/interfaces/connector/tinybasedataconnector/methods/accessor The getStore method returns the wrapped TinyBase Store. ```APIDOC ## getStore ### Description The `getStore` method returns the wrapped TinyBase Store instance associated with the connector. ### Signature `getStore(): Store` ``` -------------------------------- ### createDirectorySynclet Source: https://synclets.org/api/fs/functions Creates a directory-backed Synclet with both data and metadata persistence in a single call. ```APIDOC ## createDirectorySynclet ### Description The `createDirectorySynclet` function creates a directory-backed `Synclet` with both data and metadata persistence in a single call. ``` -------------------------------- ### Configure PGlite Metadata Connector Source: https://synclets.org/ Sets up a metadata connector using PGlite to track synchronization timestamps. ```typescript import {createPgliteMetaConnector} from 'synclets/pglite'; const metaConnector = createPgliteMetaConnector({ depth: 1, pglite, }); ``` -------------------------------- ### createSqlite3Synclet Source: https://synclets.org/api/sqlite3/functions/connector Creates a Synclet with SQLite3-backed connectors. ```APIDOC ## createSqlite3Synclet ### Description The `createSqlite3Synclet` function creates a `Synclet` with SQLite3-backed connectors. ``` -------------------------------- ### createFileSynclet Source: https://synclets.org/api/fs/functions Creates a file-backed Synclet with both data and metadata persistence in a single call. ```APIDOC ## createFileSynclet ### Description The `createFileSynclet` function creates a file-backed `Synclet` with both data and metadata persistence in a single call. ``` -------------------------------- ### createWsBrokerTransport(options: WsBrokerTransportOptions): WsBrokerTransport Source: https://synclets.org/api/ws/functions/transport/createwsbrokertransport Initializes a WsBrokerTransport instance for server-side WebSocket communication. ```APIDOC ## createWsBrokerTransport ### Description The `createWsBrokerTransport` function wraps a WebSocketServer in a `WsBrokerTransport` implementation. It enables a `Synclet` running on a server to communicate with multiple client Synclets over WebSocket connections, handling packet fragmentation, connection management, and bidirectional communication. ### Signature `createWsBrokerTransport(options: WsBrokerTransportOptions): WsBrokerTransport` ### Parameters - **options** (`WsBrokerTransportOptions`) - Required - Configuration options for the transport. ### Returns - **WsBrokerTransport** - A `WsBrokerTransport` instance for server-side WebSocket communication. ### Notes - This transport is only available in Node.js environments. - It automatically broadcasts packets to all connected clients. ### Since v0.0.0 ``` -------------------------------- ### getCreateImplementations Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation Provides custom implementations for Synclet lifecycle hooks and behaviors. ```APIDOC ## getCreateImplementations ### Description This method can optionally be implemented to provide custom implementations for Synclet lifecycle hooks, conflict resolution, and other behaviors. ``` -------------------------------- ### TinyBaseDataConnectorOptions configuration object Source: https://synclets.org/api/tinybase/type-aliases/type/tinybasedataconnectoroptions The configuration object requires a store property of type Store. ```typescript {store: Store} ``` -------------------------------- ### getDirectory Method Signature Source: https://synclets.org/api/fs/interfaces/connector/directorymetaconnector/methods/accessor/getdirectory Returns the directory path as a string. Available since version 0.0.0. ```typescript getDirectory(): string ``` -------------------------------- ### getCreateImplementations() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation/getcreateimplementations Retrieves custom implementations for Synclet lifecycle hooks and behaviors. ```APIDOC ## getCreateImplementations() ### Description The `getCreateImplementations` method can optionally be implemented to provide custom implementations for `Synclet` lifecycle hooks, conflict resolution, and other behaviors. ### Signature `getCreateImplementations(): SyncletImplementations` ### Returns - **SyncletImplementations** - A `SyncletImplementations` object with custom implementations. ### Since v0.0.0 ``` -------------------------------- ### createLocalStorageSynclet Source: https://synclets.org/api/browser/functions/synclet Creates a complete Synclet with localStorage-backed data and meta connectors. ```APIDOC ## createLocalStorageSynclet ### Description The `createLocalStorageSynclet` function creates a complete `Synclet` with localStorage-backed data and meta connectors in a single call. ``` -------------------------------- ### createDirectorySynclet(options: DirectorySyncletOptions): Promise> Source: https://synclets.org/api/fs/functions/connector/createdirectorysynclet Creates a directory-backed Synclet with both data and metadata persistence in a single call. ```APIDOC ## createDirectorySynclet ### Description The `createDirectorySynclet` function creates a directory-backed `Synclet` with both data and metadata persistence in a single call. It is the recommended approach for directory-based persistence in Node.js, particularly for large datasets that benefit from granular file storage. ### Signature `createDirectorySynclet(options: DirectorySyncletOptions): Promise>` ### Parameters - **options** (`DirectorySyncletOptions`) - Required - Configuration object specifying directory paths, transport, and other `Synclet` options. ### Returns - **Promise>** - A Promise resolving to the configured `Synclet` instance. ### Since v0.0.0 ``` -------------------------------- ### log(message: string, level?: keyof Logger): void Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/logging/log Logs a message at the specified level. ```APIDOC ## log(message: string, level?: keyof Logger): void ### Description The `log` method logs a message at the specified level. ### Parameters - **message** (string) - Required - The message to log. - **level** (keyof Logger) - Optional - The log level (default: 'info'). ### Returns - **void** - This has no return value. ### Since v0.0.0 ``` -------------------------------- ### sql Source: https://synclets.org/api/database/functions The sql template tag constructs a Sql object from a template string. ```APIDOC ## sql ### Description The `sql` template tag constructs a `Sql` object from a template string. ``` -------------------------------- ### getCreateImplementations() Source: https://synclets.org/api/durable-object/classes/class/syncletdurableobject/methods/creation/getcreateimplementations Retrieves custom implementations for Synclet lifecycle hooks and conflict resolution. ```APIDOC ## getCreateImplementations() ### Description The `getCreateImplementations` method can optionally be implemented to provide custom implementations for `Synclet` lifecycle hooks, conflict resolution, and other behaviors. ### Signature `getCreateImplementations(): SyncletImplementations` ### Returns - **SyncletImplementations** - A `SyncletImplementations` object with custom implementations. ### Since v0.0.0 ``` -------------------------------- ### createTinyBaseDataConnector Source: https://synclets.org/api/tinybase/functions Creates a TinyBaseDataConnector from an existing Store. ```APIDOC ## createTinyBaseDataConnector ### Description The `createTinyBaseDataConnector` function creates a `TinyBaseDataConnector` from an existing Store. ``` -------------------------------- ### sync() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/sync Triggers synchronization at the specified address. ```APIDOC ## sync() ### Description The `sync` method triggers synchronization at the specified address. ``` -------------------------------- ### getCreateMetaConnector Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation Provides a meta connector for the Synclet. ```APIDOC ## getCreateMetaConnector ### Description This method can optionally be implemented to provide a meta connector for the Synclet. ``` -------------------------------- ### createPgliteSynclet Source: https://synclets.org/api/pglite/functions/connector Creates a Synclet with PGlite-backed connectors. ```APIDOC ## createPgliteSynclet ### Description The `createPgliteSynclet` function creates a `Synclet` with PGlite-backed connectors. ``` -------------------------------- ### getDirectory Source: https://synclets.org/api/fs/interfaces/connector/directorymetaconnector/methods/accessor Retrieves the directory containing metadata files. ```APIDOC ## getDirectory ### Description The `getDirectory` method returns the directory containing metadata files. ``` -------------------------------- ### LocalStorageMetaConnector Methods Source: https://synclets.org/api/browser/interfaces/connector/localstoragemetaconnector Methods available on the LocalStorageMetaConnector interface. ```APIDOC ## Methods ### getStorageName() Returns the name of the storage being used. ### log(message: string) Logs a message using the connector's logging mechanism. ``` -------------------------------- ### fetch(request) Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/lifecycle Handles incoming requests to the Durable Object, with automatic initialization if required. ```APIDOC ## fetch(request) ### Description The `fetch` method handles incoming requests to the Durable Object. The `Synclet` is automatically initialized on first request if not already initialized. Override this method to implement custom request handling. ``` -------------------------------- ### createSqlite3Synclet(options: Sqlite3SyncletOptions): Promise> Source: https://synclets.org/api/sqlite3/functions/connector/createsqlite3synclet Creates a Synclet with SQLite3-backed connectors. This function automatically handles the creation of both DataConnector and MetaConnector using the provided database instance. ```APIDOC ## createSqlite3Synclet ### Description Creates a `Synclet` with SQLite3-backed connectors. This is the recommended approach for initializing a SQLite3 `Synclet`, as it manages both the `DataConnector` and `MetaConnector` internally using the same database instance. ### Signature `createSqlite3Synclet(options: Sqlite3SyncletOptions): Promise>` ### Parameters - **options** (`Sqlite3SyncletOptions`) - Required - Configuration object including depth, database instance, and optional table/column names. If not provided, defaults are used: data table 'data' (columns 'address', 'atom') and meta table 'meta' (columns 'address', 'timestamp'). ### Returns - **Promise>** - A Promise that resolves to the initialized `Synclet` instance. ### Since v0.0.0 ``` -------------------------------- ### Connector Functions Source: https://synclets.org/api/browser/functions Functions for creating data and meta connectors for browser storage. ```APIDOC ## Connector Functions - `createLocalStorageDataConnector` - `createSessionStorageDataConnector` - `createLocalStorageMetaConnector` - `createSessionStorageMetaConnector` ``` -------------------------------- ### sql(templateStrings, expressions) Source: https://synclets.org/api/database/functions/function/sql Constructs a Sql object from a template string to safely build parameterized SQL queries. ```APIDOC ## sql(templateStrings, expressions) ### Description The sql template tag constructs a `Sql` object from a template string. It provides a convenient syntax for building parameterized SQL queries, automatically handling parameter substitution and escaping to prevent SQL injection. ### Signature `sql(templateStrings: TemplateStringsArray, expressions: any[]): Sql` ### Parameters - **templateStrings** (TemplateStringsArray) - Required - The template strings array from the tagged template literal. - **expressions** (any[]) - Required - The expressions interpolated into the template string. ### Returns - **Sql** - A `Sql` object representing the constructed query. ### Example ```javascript sql`SELECT * FROM ${table} WHERE id = ${id}`; ``` ``` -------------------------------- ### getStore Method Signature Source: https://synclets.org/api/tinybase/interfaces/connector/tinybasedataconnector/methods/accessor/getstore Returns the wrapped TinyBase Store instance. ```typescript getStore(): Store ``` -------------------------------- ### sync(address?: Address): Promise Source: https://synclets.org/api/synclets/interfaces/core/synclet/methods/sync/sync Manually triggers synchronization for the specified address, sending the current state to all connected peers via the configured transports. ```APIDOC ## sync(address?: Address): Promise ### Description The `sync` method manually triggers synchronization for the specified address, sending the current state to all connected peers via the configured transports. This method invokes the optional onSync implementation callback if provided. Synchronization also occurs automatically after setAtom and delAtom calls when the sync parameter is true. ### Parameters - **address** (Address) - Optional - The address to synchronize. ### Returns - **Promise** - A promise that resolves when the synchronization process is complete. ### Since v0.0.0 ``` -------------------------------- ### Connector functions Source: https://synclets.org/api/sqlite3/functions Functions used to initialize sqlite3 synclets and data/meta connectors. ```APIDOC ## Connector functions - `createSqlite3Synclet` - `createSqlite3DataConnector` - `createSqlite3MetaConnector` ``` -------------------------------- ### Connector Interfaces Source: https://synclets.org/api/browser/interfaces Interfaces for connecting to browser-based storage mechanisms. ```APIDOC ## LocalStorageDataConnector ### Description Connector interface for managing data persistence using LocalStorage. ## SessionStorageDataConnector ### Description Connector interface for managing data persistence using SessionStorage. ## LocalStorageMetaConnector ### Description Connector interface for managing metadata using LocalStorage. ## SessionStorageMetaConnector ### Description Connector interface for managing metadata using SessionStorage. ``` -------------------------------- ### sync(address: Address): Promise Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/sync/sync Triggers synchronization at the specified address. ```APIDOC ## sync(address: Address): Promise ### Description The `sync` method triggers synchronization at the specified address. ### Signature `sync(address: Address): Promise` ### Parameters - **address** (Address) - Required - The address to synchronize. ### Returns - **Promise** - A promise that resolves when the synchronization is complete. ### Since v0.0.0 ``` -------------------------------- ### getFile Source: https://synclets.org/api/fs/interfaces/connector/filedataconnector/methods/accessor The getFile method returns the path to the backing data file. ```APIDOC ## getFile ### Description The `getFile` method returns the path to the backing data file. ``` -------------------------------- ### createPgliteSynclet(options: PgliteSyncletOptions): Promise> Source: https://synclets.org/api/pglite/functions/connector/createpglitesynclet Creates a Synclet with PGlite-backed connectors using the provided configuration options. ```APIDOC ## createPgliteSynclet ### Description The `createPgliteSynclet` function creates a `Synclet` with PGlite-backed connectors. This is the recommended approach for creating a PGlite `Synclet`, providing a simplified API that creates both the `DataConnector` and `MetaConnector` internally. ### Signature `createPgliteSynclet(options: PgliteSyncletOptions): Promise>` ### Parameters - **options** (`PgliteSyncletOptions`) - Required - Configuration including depth, pglite instance, and optional table/column names. ### Returns - **Promise>** - A Promise that resolves to the `Synclet`. ### Details The function uses the same PGlite database instance for both connectors and allows customization of all table and column names. When table/column options are not provided, the connectors use defaults: data table 'data' with columns 'address' and 'atom', and meta table 'meta' with columns 'address' and 'timestamp'. All table structures are created automatically on first use. ``` -------------------------------- ### getWebSocketServer() Source: https://synclets.org/api/ws/interfaces/transport/wsbrokertransport/methods/accessor/getwebsocketserver Returns the wrapped WebSocketServer instance. ```APIDOC ## getWebSocketServer() ### Description The `getWebSocketServer` method returns the wrapped WebSocketServer instance. ### Signature `getWebSocketServer(): WebSocketServer` ### Returns - **WebSocketServer** - The underlying WebSocketServer instance. ### Since v0.0.0 ``` -------------------------------- ### TinyBaseSyncletOptions Source: https://synclets.org/api/tinybase/type-aliases/connector/tinybasesyncletoptions The TinyBaseSyncletOptions type specifies configuration for creating a TinyBase Synclet, combining data connector options with transport and implementation settings. ```APIDOC ## TinyBaseSyncletOptions ### Description The `TinyBaseSyncletOptions` type specifies configuration for creating a TinyBase `Synclet`. It extends `TinyBaseDataConnectorOptions` and `SyncletOptions`. ### Definition ```typescript (TinyBaseDataConnectorOptions & { transport?: Transport | Transport[]; implementations?: SyncletImplementations<3>; } & SyncletOptions) ``` ### Properties - **transport** (Transport | Transport[]) - Optional - The transport property specifies the `Transport` or Transports to use. - **implementations** (SyncletImplementations<3>) - Optional - The implementations property specifies custom `Synclet` implementations. ### Since v0.0.0 ``` -------------------------------- ### Connect to PGlite Data Store Source: https://synclets.org/ Initializes a PGlite data connector for use within a Synclet instance. ```typescript import {PGlite} from '@electric-sql/pglite'; import {createPgliteDataConnector} from 'synclets/pglite'; const pglite = await PGlite.create(); const dataConnector = createPgliteDataConnector({ depth: 1, pglite, }); ``` -------------------------------- ### log Source: https://synclets.org/api/browser/interfaces/connector/localstoragemetaconnector/methods Logs information related to the local storage connector. ```APIDOC ## log ### Description Performs a logging operation for the LocalStorageMetaConnector, typically used for debugging or tracking storage events. ``` -------------------------------- ### createMemorySynclet Source: https://synclets.org/api/memory/functions/connector Creates an in-memory Synclet with both data and metadata storage. ```APIDOC ## createMemorySynclet ### Description The `createMemorySynclet` function creates an in-memory `Synclet` with both data and metadata storage in a single call. ``` -------------------------------- ### getCreateMetaConnector() Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation/getcreatemetaconnector Retrieves a MetaConnector instance for the Synclet. ```APIDOC ## getCreateMetaConnector() ### Description The `getCreateMetaConnector` method can optionally be implemented to provide a meta connector for the `Synclet`. ### Signature `getCreateMetaConnector(): MetaConnector` ### Returns - **MetaConnector** - A `MetaConnector` instance. ### Since v0.0.0 ``` -------------------------------- ### LocalStorageSyncletOptions Source: https://synclets.org/api/browser/type-aliases/type/localstoragesyncletoptions The LocalStorageSyncletOptions type combines data and meta connector options with optional transport and implementation configurations. ```APIDOC ## LocalStorageSyncletOptions ### Description The `LocalStorageSyncletOptions` type describes the configuration options for creating a complete `Synclet` with localStorage-backed data and meta connectors. ### Definition ```typescript ( LocalStorageDataConnectorOptions & LocalStorageMetaConnectorOptions & { transport?: Transport | Transport[]; implementations?: SyncletImplementations; } & SyncletOptions ) ``` ### Properties - **transport** (Transport | Transport[]) - Optional - The transport property specifies the transport or transports to use. - **implementations** (SyncletImplementations) - Optional - The implementations property specifies custom synclet implementations. ### Since v0.0.0 ``` -------------------------------- ### getFile Source: https://synclets.org/api/fs/interfaces/connector/filemetaconnector/methods/accessor The getFile method returns the path to the backing metadata file. ```APIDOC ## getFile ### Description The `getFile` method returns the path to the backing metadata file. ``` -------------------------------- ### Initialize BrokerOnlyDurableObject Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/constructors/constructor/constructor Use this constructor to instantiate a BrokerOnlyDurableObject with the provided state and environment. ```typescript new BrokerOnlyDurableObject( ctx: DurableObjectState, env: Env, ): BrokerOnlyDurableObject ``` -------------------------------- ### Retrieve File Path with getFile Source: https://synclets.org/api/fs/interfaces/connector/filedataconnector/methods/accessor/getfile Returns the string path to the backing data file. ```typescript getFile(): string ``` -------------------------------- ### utils Source: https://synclets.org/api Shared helper functions for data processing, hashing, and packet management. ```APIDOC ## utils ### Description The utils module provides essential helper functions for JSON serialization, hashing, and packet encoding/decoding. ### Functions - getHash - getPacketFromParts - getPartsFromPacket - getUniqueId - isAtom - isTimestamp - jsonParse - jsonString ``` -------------------------------- ### createSessionStorageSynclet(options: SessionStorageSyncletOptions): Promise> Source: https://synclets.org/api/browser/functions/synclet/createsessionstoragesynclet Creates a complete Synclet with sessionStorage-backed data and meta connectors in a single call. Data and metadata are cleared when the tab closes. ```APIDOC ## createSessionStorageSynclet ### Description The `createSessionStorageSynclet` function creates a complete `Synclet` with sessionStorage-backed data and meta connectors in a single call. This is the most convenient way to create a browser-based `Synclet` with ephemeral, tab-scoped storage. ### Signature `createSessionStorageSynclet(options: SessionStorageSyncletOptions): Promise>` ### Parameters - **options** (`SessionStorageSyncletOptions`) - Required - Configuration options including storage names, depth, transport, and other synclet settings. ### Returns - **Promise>** - A Promise that resolves to a fully configured `Synclet` instance. ### Since v0.0.0 ``` -------------------------------- ### getWebSocketServer Source: https://synclets.org/api/ws/interfaces/transport/wsbrokertransport/methods/accessor Returns the wrapped WebSocketServer instance. ```APIDOC ## getWebSocketServer ### Description Returns the wrapped WebSocketServer instance. ``` -------------------------------- ### createTinyBaseSynclet function signature Source: https://synclets.org/api/tinybase/functions/connector/createtinybasesynclet The function signature for initializing a TinyBase-based Synclet. ```typescript createTinyBaseSynclet(options: TinyBaseSyncletOptions): Promise ``` -------------------------------- ### createDurableObjectSqliteMetaConnector Source: https://synclets.org/api/durable-object/functions/function/createdurableobjectsqlitemetaconnector Creates a meta connector that uses Cloudflare Durable Object's built-in SQLite storage. ```APIDOC ## createDurableObjectSqliteMetaConnector(options: DurableObjectSqliteMetaConnectorOptions) ### Description Creates a meta connector that uses Cloudflare Durable Object's built-in SQLite storage. The connector automatically creates tables and indexes as needed, and metadata is persisted automatically across the Durable Object's lifecycle. ### Parameters - **options** (DurableObjectSqliteMetaConnectorOptions) - Required - The connector options. ### Returns - **DurableObjectSqliteMetaConnector** - A meta connector. ### Example ```typescript class MySyncletDurableObject extends SyncletDurableObject { getCreateMetaConnector() { return createDurableObjectSqliteMetaConnector({ depth: 3, sqlStorage: this.ctx.storage.sql, }); } } ``` ``` -------------------------------- ### getQuery Source: https://synclets.org/api/database/functions The getQuery function constructs a string and args pair for retrieving data. ```APIDOC ## getQuery ### Description The `getQuery` function constructs a string and args pair for retrieving data. ``` -------------------------------- ### SessionStorageSyncletOptions Source: https://synclets.org/api/browser/type-aliases/type/sessionstoragesyncletoptions The SessionStorageSyncletOptions type describes the configuration options for creating a complete Synclet with sessionStorage-backed data and meta connectors. ```APIDOC ## SessionStorageSyncletOptions ### Description The `SessionStorageSyncletOptions` type describes the configuration options for creating a complete `Synclet` with sessionStorage-backed data and meta connectors. This type combines the options for both `DataConnector` and `MetaConnector`, along with optional transport, implementations, and other synclet configuration. ### Definition ```typescript (SessionStorageDataConnectorOptions & SessionStorageMetaConnectorOptions & { transport?: Transport | Transport[]; implementations?: SyncletImplementations; } & SyncletOptions) ``` ### Properties - **transport** (Transport | Transport[]) - Optional - The transport property specifies the transport or transports to use. - **implementations** (SyncletImplementations) - Optional - The implementations property specifies custom synclet implementations. ### Since v0.0.0 ``` -------------------------------- ### createSessionStorageSynclet Source: https://synclets.org/api/browser/functions/synclet Creates a complete Synclet with sessionStorage-backed data and meta connectors. ```APIDOC ## createSessionStorageSynclet ### Description The `createSessionStorageSynclet` function creates a complete `Synclet` with sessionStorage-backed data and meta connectors in a single call. ``` -------------------------------- ### getDatabase Source: https://synclets.org/api/sqlite3/interfaces/connector/sqlite3metaconnector/methods Retrieves the database instance associated with the connector. ```APIDOC ## getDatabase ### Description Retrieves the database instance associated with the Sqlite3MetaConnector. ``` -------------------------------- ### createDurableObjectSqliteMetaConnector Source: https://synclets.org/api/durable-object/functions/function Creates a meta connector that utilizes Cloudflare Durable Object's built-in SQLite storage. ```APIDOC ## createDurableObjectSqliteMetaConnector ### Description The `createDurableObjectSqliteMetaConnector` function creates a meta connector that uses Cloudflare Durable Object's built-in SQLite storage. ``` -------------------------------- ### createWsBrokerTransport Source: https://synclets.org/api/ws Creates a new WebSocket broker transport instance. ```APIDOC ## createWsBrokerTransport ### Description Creates a new WebSocket broker transport for managing connections. ### Since v0.0.0 ``` -------------------------------- ### log(level, message) Source: https://synclets.org/api/synclets/interfaces/core/synclet/methods/logging The log method allows developers to write log entries for a synclet at a specified level. ```APIDOC ## log ### Description The `log` method writes synclet log entries at the requested level. ### Signature `log(level: string, message: string): void` ### Parameters - **level** (string) - The severity level of the log entry. - **message** (string) - The content of the log entry. ``` -------------------------------- ### createWsBrokerTransport Source: https://synclets.org/api/ws/functions The createWsBrokerTransport function wraps a WebSocketServer in a WsBrokerTransport implementation. ```APIDOC ## createWsBrokerTransport ### Description The `createWsBrokerTransport` function wraps a WebSocketServer in a `WsBrokerTransport` implementation. ``` -------------------------------- ### SessionStorageDataConnectorOptions Source: https://synclets.org/api/browser/type-aliases/type/sessionstoragedataconnectoroptions Configuration options for creating a sessionStorage-backed DataConnector. ```APIDOC ## SessionStorageDataConnectorOptions ### Description The `SessionStorageDataConnectorOptions` type describes the configuration options for creating a sessionStorage-backed `DataConnector`. ### Definition ```typescript ( { dataStorageName: string } & DataConnectorOptions ) ``` ### Properties - **dataStorageName** (string) - The sessionStorage key used for data storage. ``` -------------------------------- ### createFileMetaConnector(options: FileMetaConnectorOptions): FileMetaConnector Source: https://synclets.org/api/fs/functions/connector/createfilemetaconnector Creates a MetaConnector that persists Timestamp metadata in a single JSON file on the file system. The metadata tree is stored as a JSON object mirroring the data tree structure, read on initialization and written atomically after each timestamp change. ```APIDOC ## createFileMetaConnector ### Description Creates a `MetaConnector` that persists `Timestamp` metadata in a single JSON file on the file system. The metadata tree is stored as a JSON object mirroring the data tree structure but containing HLC timestamps instead of `Atom` values. ### Signature `createFileMetaConnector(options: FileMetaConnectorOptions): FileMetaConnector` ### Parameters - **options** (`FileMetaConnectorOptions`) - Required - Depth and file path for metadata storage. ### Returns - `FileMetaConnector` - A connector instance for file-based metadata persistence. ### Since v0.0.0 ``` -------------------------------- ### createMemorySynclet(options: MemorySyncletOptions): Promise> Source: https://synclets.org/api/memory/functions/connector/creatememorysynclet Creates an in-memory Synclet with both data and metadata storage in a single call. ```APIDOC ## createMemorySynclet ### Description The `createMemorySynclet` function creates an in-memory `Synclet` with both data and metadata storage in a single call. It is designed for testing, prototyping, or scenarios where data persistence is not required. ### Signature `createMemorySynclet(options: MemorySyncletOptions): Promise>` ### Parameters - **options** (`MemorySyncletOptions`) - Required - Configuration object specifying transport and other `Synclet` options. ### Returns - **Promise>** - A Promise resolving to the configured `Synclet` instance. ### Since v0.0.0 ``` -------------------------------- ### Sqlite3SyncletOptions Source: https://synclets.org/api/sqlite3/type-aliases/connector/sqlite3syncletoptions The Sqlite3SyncletOptions type specifies configuration for creating a SQLite3 Synclet. ```APIDOC ## Sqlite3SyncletOptions ### Description The `Sqlite3SyncletOptions` type specifies configuration for creating a SQLite3 `Synclet`. It extends `Sqlite3DataConnectorOptions`, `Sqlite3MetaConnectorOptions`, and `SyncletOptions`. ### Properties - **transport** (Transport | Transport[]) - Optional - The transport property specifies the `Transport` or Transports to use. - **implementations** (SyncletImplementations) - Optional - The implementations property specifies custom `Synclet` implementations. ### Since v0.0.0 ``` -------------------------------- ### Accessing the depth property Source: https://synclets.org/api/browser/interfaces/connector/sessionstoragedataconnector/properties/structure/depth Returns the address depth supported by the connector. ```text Depth ``` -------------------------------- ### Retrieve LocalStorage Namespace Source: https://synclets.org/api/browser/interfaces/connector/localstoragemetaconnector/methods/accessor/getstoragename Returns the string representing the localStorage key namespace. ```typescript getStorageName(): string ``` -------------------------------- ### createLocalStorageMetaConnector(options: LocalStorageMetaConnectorOptions): LocalStorageMetaConnector Source: https://synclets.org/api/browser/functions/connector/createlocalstoragemetaconnector Creates a MetaConnector instance that persists metadata in the browser's localStorage API. ```APIDOC ## createLocalStorageMetaConnector ### Description The `createLocalStorageMetaConnector` function creates a `MetaConnector` that persists `Timestamp` metadata in the browser's localStorage API. Metadata is stored as JSON under the specified storage key, mirroring the data tree with HLC timestamps for conflict resolution. ### Signature `createLocalStorageMetaConnector(options: LocalStorageMetaConnectorOptions): LocalStorageMetaConnector` ### Parameters - **options** (`LocalStorageMetaConnectorOptions`) - Required - Configuration options for the LocalStorage meta connector. ### Returns - **LocalStorageMetaConnector** - A `LocalStorageMetaConnector` instance. ### Since v0.0.0 ``` -------------------------------- ### getCreateImplementations Method Signature Source: https://synclets.org/api/durable-object/classes/class/syncletdurableobject/methods/creation/getcreateimplementations Defines the method signature for providing custom Synclet implementations. ```typescript getCreateImplementations(): SyncletImplementations ``` -------------------------------- ### TinyBaseDataConnectorOptions Source: https://synclets.org/api/tinybase/type-aliases/type The TinyBaseDataConnectorOptions type describes the configuration options for creating a TinyBase-backed DataConnector. ```APIDOC ## TinyBaseDataConnectorOptions ### Description The `TinyBaseDataConnectorOptions` type describes the configuration options for creating a TinyBase-backed `DataConnector`. ``` -------------------------------- ### TinyBaseDataConnectorOptions Source: https://synclets.org/api/tinybase/type-aliases/type/tinybasedataconnectoroptions The TinyBaseDataConnectorOptions type describes the configuration options for creating a TinyBase-backed DataConnector. ```APIDOC ## TinyBaseDataConnectorOptions ### Description The `TinyBaseDataConnectorOptions` type describes the configuration options for creating a TinyBase-backed `DataConnector`. ### Definition ```typescript {store: Store} ``` ### Properties - **store** (Store) - The store property specifies the TinyBase Store to wrap. ### Since v0.0.0 ``` -------------------------------- ### getCreateImplementations Method Signature Source: https://synclets.org/api/durable-object/classes/class/brokeronlydurableobject/methods/creation/getcreateimplementations Defines the method signature for retrieving custom Synclet implementations. ```typescript getCreateImplementations(): SyncletImplementations ``` -------------------------------- ### Utility functions Source: https://synclets.org/api/sqlite3/functions Utility functions for interacting with sqlite3 databases. ```APIDOC ## Utility functions - `getTableSchema` ``` -------------------------------- ### Initialize WebSocket Transport Source: https://synclets.org/ Creates a transport layer using WebSockets for remote data synchronization. ```typescript import {createWsClientTransport} from 'synclets/ws'; import {WebSocket} from 'ws'; const transport = createWsClientTransport({ webSocket: new WebSocket( 'wss://demo.synclets.org/room1', ), }); ``` -------------------------------- ### createDirectoryMetaConnector(options: DirectoryMetaConnectorOptions): DirectoryMetaConnector Source: https://synclets.org/api/fs/functions/connector/createdirectorymetaconnector Creates a MetaConnector that persists Timestamp metadata across multiple individual files within a directory. Each leaf address in the metadata tree is stored as a separate file, mirroring the data tree structure. ```APIDOC ## createDirectoryMetaConnector ### Description The `createDirectoryMetaConnector` function creates a `MetaConnector` that persists `Timestamp` metadata across multiple individual files within a directory. This approach provides better scalability for large datasets compared to storing all timestamps in a single file. ### Signature `createDirectoryMetaConnector(options: DirectoryMetaConnectorOptions): DirectoryMetaConnector` ### Parameters - **options** (`DirectoryMetaConnectorOptions`) - Required - Depth and directory path for metadata storage. ### Returns - `DirectoryMetaConnector` - A connector instance for managing metadata in the specified directory. ### Notes - The directory structure is created automatically. - Designed for Node.js environments and requires file system access. - Since: v0.0.0 ``` -------------------------------- ### getDatabase() Source: https://synclets.org/api/sqlite3/interfaces/connector/sqlite3dataconnector/methods/accessor Retrieves the wrapped sqlite3 Database instance from the Sqlite3DataConnector. ```APIDOC ## getDatabase() ### Description The `getDatabase` method returns the wrapped sqlite3 Database instance associated with the current connector. ### Signature `getDatabase(): Database` ``` -------------------------------- ### getDatabase() Source: https://synclets.org/api/sqlite3/interfaces/connector/sqlite3dataconnector/methods/accessor/getdatabase Retrieves the wrapped sqlite3 Database instance from the Sqlite3DataConnector. ```APIDOC ## getDatabase() ### Description The `getDatabase` method returns the wrapped sqlite3 Database instance. ### Signature `getDatabase(): Database` ### Returns - **Database** - The underlying sqlite3 Database instance. ### Since v0.0.0 ``` -------------------------------- ### createMemoryMetaConnector Source: https://synclets.org/api/memory/functions Creates a memory-based metadata connector. ```APIDOC ## createMemoryMetaConnector ### Description Initializes a connector for handling metadata operations in memory. ### Signature `createMemoryMetaConnector()` ``` -------------------------------- ### getPartsFromPacket function signature Source: https://synclets.org/api/utils/functions/utility/getpartsfrompacket Defines the input packet string and the returned tuple structure. ```typescript getPartsFromPacket(packet: string): [toOrFrom: string, body: string] ``` -------------------------------- ### Create a Durable Object SQLite Meta Connector Source: https://synclets.org/api/durable-object/functions/function/createdurableobjectsqlitemetaconnector Use this function within a SyncletDurableObject to provide a meta connector with specified depth and SQL storage context. ```typescript class MySyncletDurableObject extends SyncletDurableObject { getCreateMetaConnector() { return createDurableObjectSqliteMetaConnector({ depth: 3, sqlStorage: this.ctx.storage.sql, }); } } ``` -------------------------------- ### Define SyncletOptions structure Source: https://synclets.org/api/synclets/type-aliases/option/syncletoptions The configuration object for a Synclet instance, supporting optional identifier and logger properties. ```typescript { id?: string; logger?: Logger; } ``` -------------------------------- ### log Source: https://synclets.org/api/browser/interfaces/connector/sessionstoragemetaconnector/methods Logs diagnostic information related to the session storage meta connector. ```APIDOC ## log ### Description Logs messages or state information for the session storage meta connector to assist in debugging or monitoring. ### Signature `log(message: string): void` ``` -------------------------------- ### DirectorySyncletOptions Type Definition Source: https://synclets.org/api/fs/type-aliases/connector/directorysyncletoptions Defines the structure for directory-backed Synclet configuration, combining data and meta connector options with transport and implementation settings. ```typescript ( DirectoryDataConnectorOptions & DirectoryMetaConnectorOptions & { transport: Transport; implementations?: SyncletImplementations; } & SyncletOptions ) ``` -------------------------------- ### createFileMetaConnector Source: https://synclets.org/api/fs/functions Creates a MetaConnector that persists Timestamp metadata in a single JSON file on the file system. ```APIDOC ## createFileMetaConnector ### Description The `createFileMetaConnector` function creates a `MetaConnector` that persists `Timestamp` metadata in a single JSON file on the file system. ``` -------------------------------- ### Synclet Functions Source: https://synclets.org/api/browser/functions Functions for creating synclets that interface with browser storage mechanisms. ```APIDOC ## Synclet Functions - `createLocalStorageSynclet` - `createSessionStorageSynclet` ``` -------------------------------- ### sql Template Literal Usage Source: https://synclets.org/api/database/functions/function/sql Basic usage of the sql template tag for building a parameterized query. ```sql sql`SELECT * FROM ${table} WHERE id = ${id}` ``` -------------------------------- ### log Source: https://synclets.org/api/tinybase/interfaces/connector/tinybasedataconnector/methods Logs diagnostic information related to the TinyBaseDataConnector. ```APIDOC ## log ### Description Logs diagnostic information or events related to the operation of the TinyBaseDataConnector. ### Signature `log(message: string): void` ```