New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

logdb-client

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logdb-client - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dist/index.cjs

50

dist/index.d.ts

@@ -1,1 +0,49 @@

export { LogDB } from './logdb.ts';
import * as axios from 'axios';
interface ClientOptions {
url: string;
token: string;
listen: string[];
}
interface EventObject {
id: number;
type: string;
payload: string;
timestamp: number;
}
interface EventContext {
id: number;
type: string;
payload: string;
createdAt: number;
processed: boolean;
}
type Events = EventContext[];
type EventHandlerFn = (event: EventContext) => Promise<void> | void;
type EventsReceivedHandlerFn = (events: Events) => Promise<void> | void;
type FailEventHandlerFn = (error: Error, event: EventContext) => Promise<void> | void;
interface MessageHandlerInternalMap {
event: EventHandlerFn;
fail: FailEventHandlerFn;
response: EventsReceivedHandlerFn;
}
type EventHandlerName = keyof MessageHandlerInternalMap;
type EventHandler<K extends EventHandlerName> = MessageHandlerInternalMap[K];
declare class LogDB {
private handlers;
private options;
private logDB;
lastEventId: number;
constructor(options: ClientOptions);
private createApiClient;
private registerHandler;
on<Type extends EventHandlerName>(type: Type, handler: EventHandler<Type>): void;
fetchEvents(limit?: number): Promise<axios.AxiosResponse<EventObject[], any> | undefined>;
ack(eventId: number): Promise<boolean>;
nack(): Promise<boolean>;
private eventReceiver;
listen(): Promise<void>;
}
export { LogDB };

23

package.json
{
"name": "logdb-client",
"version": "0.0.3",
"module": "index.ts",
"version": "0.0.4",
"type": "module",
"scripts": {
"build": "bun build ./lib/index.ts --outfile=dist/index.js && bun run build:declaration",
"build": "tsup",
"build:declaration": "tsc --emitDeclarationOnly --project tsconfig.types.json"
},
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/*.js",
"dist/*.d.ts"
],
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": ["dist"],
"author": "azabroflovski",
"devDependencies": {
"@types/bun": "latest"
"@types/bun": "latest",
"tsup": "^8.2.4"
},

@@ -20,0 +25,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc