@gravito/stream 2.1.0 → 2.1.2

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.
@@ -111,7 +111,7 @@ export declare class BufferedPersistence implements PersistenceAdapter {
111
111
  search?: string;
112
112
  startTime?: Date;
113
113
  endTime?: Date;
114
- }): Promise<any[]>;
114
+ }): Promise<Record<string, unknown>[]>;
115
115
  /**
116
116
  * Delegates countLogs to the underlying adapter.
117
117
  */
@@ -131,7 +131,7 @@ export declare class BunBufferedPersistence implements PersistenceAdapter {
131
131
  search?: string;
132
132
  startTime?: Date;
133
133
  endTime?: Date;
134
- }): Promise<unknown[]>;
134
+ }): Promise<Record<string, unknown>[]>;
135
135
  countLogs(options?: {
136
136
  level?: string;
137
137
  workerId?: string;
@@ -100,7 +100,7 @@ export declare class MySQLPersistence implements PersistenceAdapter {
100
100
  search?: string;
101
101
  startTime?: Date;
102
102
  endTime?: Date;
103
- }): Promise<any[]>;
103
+ }): Promise<Record<string, unknown>[]>;
104
104
  /**
105
105
  * Count system logs in the archive.
106
106
  */
@@ -99,7 +99,7 @@ export declare class SQLitePersistence implements PersistenceAdapter {
99
99
  search?: string;
100
100
  startTime?: Date;
101
101
  endTime?: Date;
102
- }): Promise<any[]>;
102
+ }): Promise<Record<string, unknown>[]>;
103
103
  /**
104
104
  * Count system logs in the archive.
105
105
  */
@@ -35,4 +35,8 @@ export declare class CachedSerializer implements JobSerializer {
35
35
  * Caching is not applied here as deserialization always produces new instances.
36
36
  */
37
37
  deserialize(serialized: SerializedJob): Job;
38
+ /**
39
+ * Exposes the wrapped serializer for integrations that need serializer-specific behavior.
40
+ */
41
+ getDelegate(): JobSerializer;
38
42
  }
package/dist/types.d.ts CHANGED
@@ -1,3 +1,22 @@
1
+ import type { DatabaseService } from './drivers/DatabaseDriver';
2
+ export interface RedisLikeClient {
3
+ [key: string]: unknown;
4
+ }
5
+ export interface KafkaLikeClient {
6
+ [key: string]: unknown;
7
+ }
8
+ export interface SqsLikeClient {
9
+ [key: string]: unknown;
10
+ }
11
+ export interface RabbitMqLikeClient {
12
+ [key: string]: unknown;
13
+ }
14
+ export interface BullMqQueueLike {
15
+ [key: string]: unknown;
16
+ }
17
+ export interface BullMqWorkerLike {
18
+ [key: string]: unknown;
19
+ }
1
20
  /**
2
21
  * Represents a job that has been serialized for storage in a queue.
3
22
  *
@@ -219,7 +238,7 @@ export interface DatabaseDriverConfig {
219
238
  /** Driver type identifier */
220
239
  driver: 'database';
221
240
  /** Database service implementation for executing queries */
222
- dbService: any;
241
+ dbService: DatabaseService;
223
242
  /** Optional custom table name for storing jobs */
224
243
  table?: string;
225
244
  }
@@ -242,7 +261,7 @@ export interface RedisDriverConfig {
242
261
  /** Driver type identifier */
243
262
  driver: 'redis';
244
263
  /** Redis client instance (ioredis or node-redis compatible) */
245
- client: any;
264
+ client: RedisLikeClient;
246
265
  /** Optional key prefix for namespacing */
247
266
  prefix?: string;
248
267
  }
@@ -264,7 +283,7 @@ export interface KafkaDriverConfig {
264
283
  /** Driver type identifier */
265
284
  driver: 'kafka';
266
285
  /** Kafka client instance */
267
- client: any;
286
+ client: KafkaLikeClient;
268
287
  /** Consumer group ID for coordinating workers */
269
288
  consumerGroupId?: string;
270
289
  }
@@ -287,7 +306,7 @@ export interface SQSDriverConfig {
287
306
  /** Driver type identifier */
288
307
  driver: 'sqs';
289
308
  /** Amazon SQS client instance */
290
- client: any;
309
+ client: SqsLikeClient;
291
310
  /** Optional prefix for resolving queue names to URLs */
292
311
  queueUrlPrefix?: string;
293
312
  /** The duration (in seconds) that received messages are hidden from other consumers */
@@ -314,7 +333,7 @@ export interface RabbitMQDriverConfig {
314
333
  /** Driver type identifier */
315
334
  driver: 'rabbitmq';
316
335
  /** AMQP client instance */
317
- client: any;
336
+ client: RabbitMqLikeClient;
318
337
  /** Exchange name to publish to */
319
338
  exchange?: string;
320
339
  /** Type of exchange (direct, topic, fanout, headers) */
@@ -379,9 +398,9 @@ export interface BullMQDriverConfig {
379
398
  /** Driver type identifier */
380
399
  driver: 'bullmq';
381
400
  /** Bull Queue instance */
382
- queue: any;
401
+ queue: BullMqQueueLike;
383
402
  /** Optional Bull Worker instance */
384
- worker?: any;
403
+ worker?: BullMqWorkerLike;
385
404
  /** Key prefix for queue namespacing */
386
405
  prefix?: string;
387
406
  /** Enable debug logging */
@@ -606,7 +625,7 @@ export interface PersistenceAdapter {
606
625
  search?: string;
607
626
  startTime?: Date;
608
627
  endTime?: Date;
609
- }): Promise<any[]>;
628
+ }): Promise<Record<string, unknown>[]>;
610
629
  /**
611
630
  * Count system logs in the archive.
612
631
  *
@@ -34,7 +34,7 @@ export interface IWorkerFactory {
34
34
  * @param config - Configuration for the worker.
35
35
  * @returns A worker instance (BunWorker or SandboxedWorker).
36
36
  */
37
- create(config: WorkerConfig): BunWorker | SandboxedWorker;
37
+ create(config: WorkerConfig): Worker;
38
38
  /**
39
39
  * Get the detected runtime environment.
40
40
  *
@@ -99,7 +99,7 @@ export declare class RuntimeAwareWorkerFactory implements IWorkerFactory {
99
99
  * @param config - Configuration for the worker.
100
100
  * @returns A BunWorker if running on Bun, SandboxedWorker otherwise.
101
101
  */
102
- create(config: WorkerConfig): BunWorker | SandboxedWorker;
102
+ create(config: WorkerConfig): Worker;
103
103
  /**
104
104
  * Gets the detected runtime environment.
105
105
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gravito/stream",
3
3
  "sideEffects": false,
4
- "version": "2.1.0",
4
+ "version": "2.1.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -47,8 +47,8 @@
47
47
  "license": "MIT",
48
48
  "dependencies": {
49
49
  "@aws-sdk/client-sqs": "^3.955.0",
50
- "@gravito/atlas": "workspace:*",
51
- "@gravito/core": "workspace:*",
50
+ "@gravito/atlas": "^2.5.2",
51
+ "@gravito/core": "^2.0.6",
52
52
  "@grpc/grpc-js": "^1.14.3",
53
53
  "@grpc/proto-loader": "^0.8.0",
54
54
  "cborg": "^4.5.8",