@orpc/experimental-publisher 1.10.4 → 1.11.1

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.
@@ -1,14 +1,8 @@
1
- import { StandardRPCJsonSerializerOptions, StandardRPCJsonSerializer, StandardRPCJsonSerializedMetaItem } from '@orpc/client/standard';
2
- import { ThrowableError } from '@orpc/shared';
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
3
2
  import Redis from 'ioredis';
4
3
  import { PublisherOptions, Publisher, PublisherSubscribeListenerOptions } from '../index.mjs';
5
- import { getEventMeta } from '@orpc/standard-server';
4
+ import '@orpc/shared';
6
5
 
7
- type SerializedPayload = {
8
- json: object;
9
- meta: StandardRPCJsonSerializedMetaItem[];
10
- eventMeta: ReturnType<typeof getEventMeta>;
11
- };
12
6
  interface IORedisPublisherOptions extends PublisherOptions, StandardRPCJsonSerializerOptions {
13
7
  /**
14
8
  * Redis commander instance (used for execute short-lived commands)
@@ -41,19 +35,16 @@ interface IORedisPublisherOptions extends PublisherOptions, StandardRPCJsonSeria
41
35
  prefix?: string;
42
36
  }
43
37
  declare class IORedisPublisher<T extends Record<string, object>> extends Publisher<T> {
44
- protected readonly commander: Redis;
45
- protected readonly listener: Redis;
46
- protected readonly prefix: string;
47
- protected readonly serializer: StandardRPCJsonSerializer;
48
- protected readonly retentionSeconds: number;
49
- protected readonly subscriptionPromiseMap: Map<string, Promise<any>>;
50
- protected readonly listenersMap: Map<string, ((payload: any) => void)[]>;
51
- protected readonly onErrorsMap: Map<string, ((error: ThrowableError) => void)[]>;
52
- protected redisListenerAndOnError: undefined | {
53
- listener: (channel: string, message: string) => void;
54
- onError: (error: ThrowableError) => void;
55
- };
56
- protected get isResumeEnabled(): boolean;
38
+ private readonly commander;
39
+ private readonly listener;
40
+ private readonly prefix;
41
+ private readonly serializer;
42
+ private readonly retentionSeconds;
43
+ private readonly subscriptionPromiseMap;
44
+ private readonly listenersMap;
45
+ private readonly onErrorsMap;
46
+ private redisListenerAndOnError;
47
+ private get isResumeEnabled();
57
48
  /**
58
49
  * The exactness of the `XTRIM` command.
59
50
  *
@@ -68,12 +59,12 @@ declare class IORedisPublisher<T extends Record<string, object>> extends Publish
68
59
  */
69
60
  get size(): number;
70
61
  constructor({ commander, listener, resumeRetentionSeconds, prefix, ...options }: IORedisPublisherOptions);
71
- protected lastCleanupTimeMap: Map<string, number>;
62
+ private lastCleanupTimeMap;
72
63
  publish<K extends keyof T & string>(event: K, payload: T[K]): Promise<void>;
73
64
  protected subscribeListener<K extends keyof T & string>(event: K, originalListener: (payload: T[K]) => void, { lastEventId, onError }?: PublisherSubscribeListenerOptions): Promise<() => Promise<void>>;
74
- protected prefixKey(key: string): string;
75
- protected serializePayload(payload: object): SerializedPayload;
76
- protected deserializePayload(id: string | undefined, { json, meta, eventMeta }: SerializedPayload): any;
65
+ private prefixKey;
66
+ private serializePayload;
67
+ private deserializePayload;
77
68
  }
78
69
 
79
70
  export { IORedisPublisher };
@@ -1,14 +1,8 @@
1
- import { StandardRPCJsonSerializerOptions, StandardRPCJsonSerializer, StandardRPCJsonSerializedMetaItem } from '@orpc/client/standard';
2
- import { ThrowableError } from '@orpc/shared';
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
3
2
  import Redis from 'ioredis';
4
3
  import { PublisherOptions, Publisher, PublisherSubscribeListenerOptions } from '../index.js';
5
- import { getEventMeta } from '@orpc/standard-server';
4
+ import '@orpc/shared';
6
5
 
7
- type SerializedPayload = {
8
- json: object;
9
- meta: StandardRPCJsonSerializedMetaItem[];
10
- eventMeta: ReturnType<typeof getEventMeta>;
11
- };
12
6
  interface IORedisPublisherOptions extends PublisherOptions, StandardRPCJsonSerializerOptions {
13
7
  /**
14
8
  * Redis commander instance (used for execute short-lived commands)
@@ -41,19 +35,16 @@ interface IORedisPublisherOptions extends PublisherOptions, StandardRPCJsonSeria
41
35
  prefix?: string;
42
36
  }
43
37
  declare class IORedisPublisher<T extends Record<string, object>> extends Publisher<T> {
44
- protected readonly commander: Redis;
45
- protected readonly listener: Redis;
46
- protected readonly prefix: string;
47
- protected readonly serializer: StandardRPCJsonSerializer;
48
- protected readonly retentionSeconds: number;
49
- protected readonly subscriptionPromiseMap: Map<string, Promise<any>>;
50
- protected readonly listenersMap: Map<string, ((payload: any) => void)[]>;
51
- protected readonly onErrorsMap: Map<string, ((error: ThrowableError) => void)[]>;
52
- protected redisListenerAndOnError: undefined | {
53
- listener: (channel: string, message: string) => void;
54
- onError: (error: ThrowableError) => void;
55
- };
56
- protected get isResumeEnabled(): boolean;
38
+ private readonly commander;
39
+ private readonly listener;
40
+ private readonly prefix;
41
+ private readonly serializer;
42
+ private readonly retentionSeconds;
43
+ private readonly subscriptionPromiseMap;
44
+ private readonly listenersMap;
45
+ private readonly onErrorsMap;
46
+ private redisListenerAndOnError;
47
+ private get isResumeEnabled();
57
48
  /**
58
49
  * The exactness of the `XTRIM` command.
59
50
  *
@@ -68,12 +59,12 @@ declare class IORedisPublisher<T extends Record<string, object>> extends Publish
68
59
  */
69
60
  get size(): number;
70
61
  constructor({ commander, listener, resumeRetentionSeconds, prefix, ...options }: IORedisPublisherOptions);
71
- protected lastCleanupTimeMap: Map<string, number>;
62
+ private lastCleanupTimeMap;
72
63
  publish<K extends keyof T & string>(event: K, payload: T[K]): Promise<void>;
73
64
  protected subscribeListener<K extends keyof T & string>(event: K, originalListener: (payload: T[K]) => void, { lastEventId, onError }?: PublisherSubscribeListenerOptions): Promise<() => Promise<void>>;
74
- protected prefixKey(key: string): string;
75
- protected serializePayload(payload: object): SerializedPayload;
76
- protected deserializePayload(id: string | undefined, { json, meta, eventMeta }: SerializedPayload): any;
65
+ private prefixKey;
66
+ private serializePayload;
67
+ private deserializePayload;
77
68
  }
78
69
 
79
70
  export { IORedisPublisher };
@@ -27,12 +27,12 @@ declare class MemoryPublisher<T extends Record<string, object>> extends Publishe
27
27
  *
28
28
  */
29
29
  get size(): number;
30
- protected get isResumeEnabled(): boolean;
30
+ private get isResumeEnabled();
31
31
  constructor({ resumeRetentionSeconds, ...options }?: MemoryPublisherOptions);
32
32
  publish<K extends keyof T & string>(event: K, payload: T[K]): Promise<void>;
33
33
  protected subscribeListener<K extends keyof T & string>(event: K, listener: (payload: T[K]) => void, options?: PublisherSubscribeListenerOptions): Promise<() => Promise<void>>;
34
- protected lastCleanupTime: number | null;
35
- protected cleanup(): void;
34
+ private lastCleanupTime;
35
+ private cleanup;
36
36
  }
37
37
 
38
38
  export { MemoryPublisher };
@@ -27,12 +27,12 @@ declare class MemoryPublisher<T extends Record<string, object>> extends Publishe
27
27
  *
28
28
  */
29
29
  get size(): number;
30
- protected get isResumeEnabled(): boolean;
30
+ private get isResumeEnabled();
31
31
  constructor({ resumeRetentionSeconds, ...options }?: MemoryPublisherOptions);
32
32
  publish<K extends keyof T & string>(event: K, payload: T[K]): Promise<void>;
33
33
  protected subscribeListener<K extends keyof T & string>(event: K, listener: (payload: T[K]) => void, options?: PublisherSubscribeListenerOptions): Promise<() => Promise<void>>;
34
- protected lastCleanupTime: number | null;
35
- protected cleanup(): void;
34
+ private lastCleanupTime;
35
+ private cleanup;
36
36
  }
37
37
 
38
38
  export { MemoryPublisher };
@@ -1,14 +1,8 @@
1
- import { StandardRPCJsonSerializerOptions, StandardRPCJsonSerializer, StandardRPCJsonSerializedMetaItem } from '@orpc/client/standard';
2
- import { ThrowableError } from '@orpc/shared';
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
3
2
  import { Redis } from '@upstash/redis';
4
3
  import { PublisherOptions, Publisher, PublisherSubscribeListenerOptions } from '../index.mjs';
5
- import { getEventMeta } from '@orpc/standard-server';
4
+ import '@orpc/shared';
6
5
 
7
- type SerializedPayload = {
8
- json: object;
9
- meta: StandardRPCJsonSerializedMetaItem[];
10
- eventMeta: ReturnType<typeof getEventMeta>;
11
- };
12
6
  interface UpstashRedisPublisherOptions extends PublisherOptions, StandardRPCJsonSerializerOptions {
13
7
  /**
14
8
  * How long (in seconds) to retain events for replay.
@@ -30,15 +24,15 @@ interface UpstashRedisPublisherOptions extends PublisherOptions, StandardRPCJson
30
24
  prefix?: string;
31
25
  }
32
26
  declare class UpstashRedisPublisher<T extends Record<string, object>> extends Publisher<T> {
33
- protected readonly redis: Redis;
34
- protected readonly prefix: string;
35
- protected readonly serializer: StandardRPCJsonSerializer;
36
- protected readonly retentionSeconds: number;
37
- protected readonly listenersMap: Map<string, ((payload: any) => void)[]>;
38
- protected readonly onErrorsMap: Map<string, ((error: ThrowableError) => void)[]>;
39
- protected readonly subscriptionPromiseMap: Map<string, Promise<void>>;
40
- protected readonly subscriptionsMap: Map<string, any>;
41
- protected get isResumeEnabled(): boolean;
27
+ private readonly redis;
28
+ private readonly prefix;
29
+ private readonly serializer;
30
+ private readonly retentionSeconds;
31
+ private readonly listenersMap;
32
+ private readonly onErrorsMap;
33
+ private readonly subscriptionPromiseMap;
34
+ private readonly subscriptionsMap;
35
+ private get isResumeEnabled();
42
36
  /**
43
37
  * The exactness of the `XTRIM` command.
44
38
  *
@@ -53,12 +47,12 @@ declare class UpstashRedisPublisher<T extends Record<string, object>> extends Pu
53
47
  */
54
48
  get size(): number;
55
49
  constructor(redis: Redis, { resumeRetentionSeconds, prefix, ...options }?: UpstashRedisPublisherOptions);
56
- protected lastCleanupTimeMap: Map<string, number>;
50
+ private lastCleanupTimeMap;
57
51
  publish<K extends keyof T & string>(event: K, payload: T[K]): Promise<void>;
58
52
  protected subscribeListener<K extends keyof T & string>(event: K, originalListener: (payload: T[K]) => void, { lastEventId, onError }?: PublisherSubscribeListenerOptions): Promise<() => Promise<void>>;
59
- protected prefixKey(key: string): string;
60
- protected serializePayload(payload: object): SerializedPayload;
61
- protected deserializePayload(id: string | undefined, { json, meta, eventMeta }: SerializedPayload): any;
53
+ private prefixKey;
54
+ private serializePayload;
55
+ private deserializePayload;
62
56
  }
63
57
 
64
58
  export { UpstashRedisPublisher };
@@ -1,14 +1,8 @@
1
- import { StandardRPCJsonSerializerOptions, StandardRPCJsonSerializer, StandardRPCJsonSerializedMetaItem } from '@orpc/client/standard';
2
- import { ThrowableError } from '@orpc/shared';
1
+ import { StandardRPCJsonSerializerOptions } from '@orpc/client/standard';
3
2
  import { Redis } from '@upstash/redis';
4
3
  import { PublisherOptions, Publisher, PublisherSubscribeListenerOptions } from '../index.js';
5
- import { getEventMeta } from '@orpc/standard-server';
4
+ import '@orpc/shared';
6
5
 
7
- type SerializedPayload = {
8
- json: object;
9
- meta: StandardRPCJsonSerializedMetaItem[];
10
- eventMeta: ReturnType<typeof getEventMeta>;
11
- };
12
6
  interface UpstashRedisPublisherOptions extends PublisherOptions, StandardRPCJsonSerializerOptions {
13
7
  /**
14
8
  * How long (in seconds) to retain events for replay.
@@ -30,15 +24,15 @@ interface UpstashRedisPublisherOptions extends PublisherOptions, StandardRPCJson
30
24
  prefix?: string;
31
25
  }
32
26
  declare class UpstashRedisPublisher<T extends Record<string, object>> extends Publisher<T> {
33
- protected readonly redis: Redis;
34
- protected readonly prefix: string;
35
- protected readonly serializer: StandardRPCJsonSerializer;
36
- protected readonly retentionSeconds: number;
37
- protected readonly listenersMap: Map<string, ((payload: any) => void)[]>;
38
- protected readonly onErrorsMap: Map<string, ((error: ThrowableError) => void)[]>;
39
- protected readonly subscriptionPromiseMap: Map<string, Promise<void>>;
40
- protected readonly subscriptionsMap: Map<string, any>;
41
- protected get isResumeEnabled(): boolean;
27
+ private readonly redis;
28
+ private readonly prefix;
29
+ private readonly serializer;
30
+ private readonly retentionSeconds;
31
+ private readonly listenersMap;
32
+ private readonly onErrorsMap;
33
+ private readonly subscriptionPromiseMap;
34
+ private readonly subscriptionsMap;
35
+ private get isResumeEnabled();
42
36
  /**
43
37
  * The exactness of the `XTRIM` command.
44
38
  *
@@ -53,12 +47,12 @@ declare class UpstashRedisPublisher<T extends Record<string, object>> extends Pu
53
47
  */
54
48
  get size(): number;
55
49
  constructor(redis: Redis, { resumeRetentionSeconds, prefix, ...options }?: UpstashRedisPublisherOptions);
56
- protected lastCleanupTimeMap: Map<string, number>;
50
+ private lastCleanupTimeMap;
57
51
  publish<K extends keyof T & string>(event: K, payload: T[K]): Promise<void>;
58
52
  protected subscribeListener<K extends keyof T & string>(event: K, originalListener: (payload: T[K]) => void, { lastEventId, onError }?: PublisherSubscribeListenerOptions): Promise<() => Promise<void>>;
59
- protected prefixKey(key: string): string;
60
- protected serializePayload(payload: object): SerializedPayload;
61
- protected deserializePayload(id: string | undefined, { json, meta, eventMeta }: SerializedPayload): any;
53
+ private prefixKey;
54
+ private serializePayload;
55
+ private deserializePayload;
62
56
  }
63
57
 
64
58
  export { UpstashRedisPublisher };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/experimental-publisher",
3
3
  "type": "module",
4
- "version": "1.10.4",
4
+ "version": "1.11.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -51,9 +51,9 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "@orpc/shared": "1.10.4",
55
- "@orpc/standard-server": "1.10.4",
56
- "@orpc/client": "1.10.4"
54
+ "@orpc/client": "1.11.1",
55
+ "@orpc/standard-server": "1.11.1",
56
+ "@orpc/shared": "1.11.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@upstash/redis": "^1.35.6",