@blocks-network/sdk 0.1.61 → 0.1.63
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.
- package/README.md +50 -43
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/runtime/agent-instance.d.ts +1 -1
- package/dist/runtime/agent-instance.js +1 -1
- package/dist/runtime/agent-registry.d.ts +16 -16
- package/dist/runtime/agent-registry.js +1 -1
- package/dist/runtime/auth-provider.d.ts +30 -0
- package/dist/runtime/auth-provider.js +1 -1
- package/dist/runtime/channel-manager.d.ts +9 -9
- package/dist/runtime/channel-manager.js +1 -1
- package/dist/runtime/consumer-auth.d.ts +18 -0
- package/dist/runtime/consumer-auth.js +1 -1
- package/dist/runtime/file-upload.js +1 -1
- package/dist/runtime/logger.d.ts +14 -12
- package/dist/runtime/logger.js +1 -1
- package/dist/runtime/pubnub-client.d.ts +35 -12
- package/dist/runtime/pubnub-client.js +1 -1
- package/dist/runtime/rpc-client.js +1 -1
- package/dist/runtime/task-client.js +1 -1
- package/dist/runtime/task-session.js +1 -1
- package/dist/runtime/transport-categories.d.ts +60 -0
- package/dist/runtime/transport-categories.js +1 -0
- package/dist/stream/index.d.ts +1 -1
- package/dist/stream/stream-client.d.ts +17 -22
- package/dist/stream/stream-client.js +1 -1
- package/dist/stream/types.d.ts +43 -4
- package/package.json +1 -1
package/dist/stream/types.d.ts
CHANGED
|
@@ -64,12 +64,51 @@ export interface StreamClientFromDescriptorOptions {
|
|
|
64
64
|
gating?: boolean;
|
|
65
65
|
/** Reorder buffer timeout in ms. Default: 750. Set to 0 to disable. */
|
|
66
66
|
reorderTimeoutMs?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Consumer's user ID. When set, used as the publisher-identity prefix in
|
|
69
|
+
* the StreamClient UUID so that consumer-side publishes carry an identity
|
|
70
|
+
* derived from the consumer rather than the provider's agentName. Required
|
|
71
|
+
* for correct self-echo filtering on bidirectional streams where the
|
|
72
|
+
* consumer and provider share the same agentName. Omitting it falls back
|
|
73
|
+
* to descriptor.agentName (legacy behavior — safe only for unidirectional
|
|
74
|
+
* streams).
|
|
75
|
+
*/
|
|
76
|
+
consumerUserId?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Normalized inbound message yielded by the inbound async iterator.
|
|
80
|
+
*
|
|
81
|
+
* Discriminated by `format`. `data` shape:
|
|
82
|
+
* - `format: 'bytes'` → `string[]` (chunks; `encoding` is `'utf8'` or `'base64'`)
|
|
83
|
+
* - `format: 'events'` → `unknown[]` (one or more events from a single producer flush)
|
|
84
|
+
* - `format: 'raw'` → `Record<string, unknown>` (passthrough for unknown message types)
|
|
85
|
+
*
|
|
86
|
+
* Note: the array-vs-single shape is the SDK's own producer-side bundler
|
|
87
|
+
* (`stream-bundle.ts`) coalescing writes by size/latency — NOT PubNub transport
|
|
88
|
+
* batching. A single producer `write()` already yields a 1-element array on
|
|
89
|
+
* the wire. Application code should prefer `bytes()` / `events()` which
|
|
90
|
+
* flatten on the consumer's behalf; reach for `inbound` only when you
|
|
91
|
+
* need raw envelope metadata.
|
|
92
|
+
*/
|
|
93
|
+
export type InboundMessage = InboundBytesMessage | InboundEventsMessage | InboundRawMessage;
|
|
94
|
+
export interface InboundBytesMessage {
|
|
95
|
+
format: 'bytes';
|
|
96
|
+
data: string[];
|
|
97
|
+
seq: number;
|
|
98
|
+
ts: number;
|
|
99
|
+
encoding: string;
|
|
100
|
+
}
|
|
101
|
+
export interface InboundEventsMessage {
|
|
102
|
+
format: 'events';
|
|
103
|
+
data: unknown[];
|
|
104
|
+
seq: number;
|
|
105
|
+
ts: number;
|
|
106
|
+
encoding: string;
|
|
67
107
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
data: unknown
|
|
108
|
+
export interface InboundRawMessage {
|
|
109
|
+
format: 'raw';
|
|
110
|
+
data: Record<string, unknown>;
|
|
71
111
|
seq: number;
|
|
72
112
|
ts: number;
|
|
73
|
-
format: 'bytes' | 'events' | 'raw';
|
|
74
113
|
encoding: string;
|
|
75
114
|
}
|