Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@luvio/command-sse

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@luvio/command-sse - npm Package Compare versions

Comparing version 5.7.1 to 5.8.0

dist/types/v1/sse-command.d.ts

30

dist/types/v1/index.d.ts
import { type ServiceDescriptor } from '@luvio/utils';
import { StreamingCommand } from '@luvio/command-streaming/v1';
import type { NamedFetchService } from '@luvio/service-fetch-network/v1';
export type SSEMessage = {
event: string;
data: string;
id: string;
retry?: number;
};
/**
* An implementation of StreamingCommand that handles SSE (Server-Sent Event) streams.
*/
export declare abstract class SSECommand<StreamedData = SSEMessage, ExtraServices extends Record<string, unknown> = {}> extends StreamingCommand<StreamedData, ExtraServices> {
protected services: NamedFetchService & ExtraServices;
constructor(services: NamedFetchService & ExtraServices);
/**
* Decodes the bytes returned by fetch into the correct shape.
*
* @param byteStream ReadableStream<Uint8Array> returned by fetch
* @returns ReadableStream<StreamedData> that will be the result of the Command
*/
decodeByteStream(byteStream: ReadableStream<Uint8Array>): ReadableStream<StreamedData>;
abstract decodeSSEStream(sseStream: ReadableStream<SSEMessage>): ReadableStream<StreamedData>;
}
import { SSECommand } from './sse-command';
export { SSEMessage } from './sse-command';
export type SSECommandServiceDescriptor = ServiceDescriptor<typeof SSECommand, 'SSECommandBaseClass', '1.0'>;
export declare function buildSSECommandBaseClassService(): SSECommandServiceDescriptor;
export declare class SSEParsingStream extends TransformStream<string, SSEMessage> {
constructor();
}
export declare function buildServiceDescriptor(): SSECommandServiceDescriptor;

@@ -30,9 +30,2 @@ /**

}
function buildSSECommandBaseClassService() {
return {
type: 'SSECommandBaseClass',
version: '1.0',
service: SSECommand,
};
}
const sseRegex = /^(?<field>[^:]*?)(: ?(?<value>.*?))?(?:\r\n?|\n)/;

@@ -118,2 +111,10 @@ // +-------v------++--------v--------++-----v----+

export { SSECommand, SSEParsingStream, buildSSECommandBaseClassService };
function buildServiceDescriptor() {
return {
type: 'SSECommandBaseClass',
version: '1.0',
service: SSECommand,
};
}
export { buildServiceDescriptor };
import { type ServiceDescriptor } from '@luvio/utils';
import { StreamingCommand } from '@luvio/command-streaming/v1';
import type { NamedFetchService } from '@luvio/service-fetch-network/v1';
export type SSEMessage = {
event: string;
data: string;
id: string;
retry?: number;
};
/**
* An implementation of StreamingCommand that handles SSE (Server-Sent Event) streams.
*/
export declare abstract class SSECommand<StreamedData = SSEMessage, ExtraServices extends Record<string, unknown> = {}> extends StreamingCommand<StreamedData, ExtraServices> {
protected services: NamedFetchService & ExtraServices;
constructor(services: NamedFetchService & ExtraServices);
/**
* Decodes the bytes returned by fetch into the correct shape.
*
* @param byteStream ReadableStream<Uint8Array> returned by fetch
* @returns ReadableStream<StreamedData> that will be the result of the Command
*/
decodeByteStream(byteStream: ReadableStream<Uint8Array>): ReadableStream<StreamedData>;
abstract decodeSSEStream(sseStream: ReadableStream<SSEMessage>): ReadableStream<StreamedData>;
}
import { SSECommand } from './sse-command';
export { SSEMessage } from './sse-command';
export type SSECommandServiceDescriptor = ServiceDescriptor<typeof SSECommand, 'SSECommandBaseClass', '1.0'>;
export declare function buildSSECommandBaseClassService(): SSECommandServiceDescriptor;
export declare class SSEParsingStream extends TransformStream<string, SSEMessage> {
constructor();
}
export declare function buildServiceDescriptor(): SSECommandServiceDescriptor;
{
"name": "@luvio/command-sse",
"version": "5.7.1",
"version": "5.8.0",
"private": false,

@@ -34,6 +34,6 @@ "description": "Luvio SSE Streaming Command",

"dependencies": {
"@luvio/command-base": "^5.7.1",
"@luvio/command-streaming": "^5.7.1",
"@luvio/service-fetch-network": "^5.7.1",
"@luvio/utils": "^5.7.1"
"@luvio/command-base": "^5.8.0",
"@luvio/command-streaming": "^5.8.0",
"@luvio/service-fetch-network": "^5.8.0",
"@luvio/utils": "^5.8.0"
},

@@ -40,0 +40,0 @@ "bundlesize": [

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