0.0.6 • Published 5 months ago
@sstdev/lib_data-sync-client v0.0.6
Data Sync Client
A lightweight TypeScript client for sending data to silo_data-sync via RabbitMQ.
Usage
import dataSyncClient from '@sstdev/lib_data-sync-client';
import logging from '@sstdev/lib_logging';
// Example user context
const userContext = {
verb: 'create',
namespace: 'example',
relation: 'resource',
tenantId: 'tenant-123',
correlation: {
id: 'correlation-123'
}
};
// Example data to sync
const syncData = {
// TODO: Find out what this should look like
};
try {
await dataSyncClient.sendDataSyncData(syncData, userContext);
} catch (error) {
logging.error('Failed to send dataSync data to RabbitMQ:', error);
}API
sendDataSyncData(data: object, context: UserContext): Promise<void>
Sends data to the silo_data-sync service.
Parameters
data(object): The data to be synced.context(UserContext): User context object containing metadata. Must include:verb(string): Action verb (e.g., 'create', 'update')namespace(string): Namespace for the datarelation(string): Relation/type of the datatenantId(string): Tenant identifiercorrelation(object, optional): Correlation information includingid
Development
This package is part of the silo_data-sync monorepo. See the root README for more information.
0.0.6
5 months ago
0.0.6-beta.11
5 months ago
0.0.5
5 months ago
0.0.5-beta.7
5 months ago
0.0.4
5 months ago
0.0.4-beta.5
6 months ago
0.0.4-beta.4
6 months ago
0.0.4-beta.3
6 months ago
0.0.4-beta.2
6 months ago
0.0.4-beta.1
6 months ago
0.0.3
6 months ago
0.0.2
6 months ago
0.0.1
6 months ago