An open API service indexing awesome lists of open source software.

https://github.com/proxima-one/stream-schemas

TS schemas reused across streaming applications
https://github.com/proxima-one/stream-schemas

library

Last synced: 5 months ago
JSON representation

TS schemas reused across streaming applications

Awesome Lists containing this project

README

          

# Stream Schema

Stream processes are defined as in the following schema.

## Schema

### Stream Process

- id: unique stream identifier
- name: descriptive stream name
- version: string that describes current version of stream
- input_streams: list of input stream ids
- output_streams: list of output stream ids
- container_id: identitifier for stream process
- build: string location for build files

```typescript
interface EventStreamProcess {
id: string;
name: string;
owner: string;
version: string;
input_streams: Array;
output_streams: Array;
container_id: string;
build: string;
}
```

### Event Stream

- id: unique stream identifier
- process_id: unique identifier for process that creates the stream
- name: descriptive stream name
- version: string that describes current version of stream
- serdes: serialization of the current stream
- type: represents an enum for StreamType [SOURCE, STATELESS, STATEFUL, QUERY]

```typescript
interface EventStream {
id: string;
process_id: string;
name: string;
type: StreamType;
schema_uri: string;
}
```

### Schema URI

```typescript
interface SchemaMeta {
type: string;
name: string;
uri: string;
version: string;
}
```

### Event Stream Schema

- name: descriptive stream name
- version: string that describes current version of schema
- serdes: serialization of the current stream

```typescript
interface Schema {
name: string;
version: string;
serdes: Serdes;
}
```

### Example

```typescript
export type FungibleTokenDiscoveryStreamEvent =
| events.NewToken & {
ref?: BlockchainReference
};

export const fungibleTokenDiscovery: EventStreamSchema = {
name: "fungible-token-discovery.streams.proxima.one",
serdes: serializers.json(),
version: "0.1.0",
}