Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/host/src/lib/csi-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
STHRestAPI,
STHConfiguration,
InstanceLimits,
InstanceStatus,
MonitoringMessageData,
InstanceStats,
OpResponse,
Expand All @@ -33,7 +32,7 @@ import {
MessageUtilities,
InstanceAdapterError,
} from "@scramjet/model";
import { CommunicationChannel as CC, RunnerExitCode, RunnerMessageCode } from "@scramjet/symbols";
import { CommunicationChannel as CC, InstanceStatus, RunnerExitCode, RunnerMessageCode } from "@scramjet/symbols";
import { Duplex, PassThrough, Readable } from "stream";
import { development } from "@scramjet/sth-config";

Expand Down
3 changes: 2 additions & 1 deletion packages/host/src/lib/serviceDiscovery/topic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { TransformOptions, Readable, Transform } from "stream";
import { ContentType, WorkState, ReadableState, WritableState, StreamType, StreamOrigin, TopicHandler, TopicOptions, TopicState, ParsedMessage } from "@scramjet/types";
import { ContentType, StreamOrigin, TopicHandler, TopicOptions, TopicState, ParsedMessage } from "@scramjet/types";
import TopicId from "./topicId";
import { ReadableState, StreamType, WorkState, WritableState } from "@scramjet/symbols";

export enum TopicEvent {
StateChanged = "stateChanged",
Expand Down
3 changes: 2 additions & 1 deletion packages/host/test/serviceDiscovery/topic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { PassThrough, Readable, Stream, Writable } from "stream";
import { ReadableState, StreamOrigin, WorkState } from "@scramjet/types";
import { StreamOrigin } from "@scramjet/types";
import { Topic, TopicEvent } from "../../src/lib/serviceDiscovery/topic";
import TopicId from "../../src/lib/serviceDiscovery/topicId";
import { ReadableState, WorkState } from "@scramjet/symbols";

let testTopic: Topic;
const testOrigin: StreamOrigin = { id: "TestEviroment", type: "hub" };
Expand Down
1 change: 0 additions & 1 deletion packages/sth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ COPY ./dist/pre-runner ./dist/pre-runner
COPY ./dist/python-runner ./dist/python-runner
COPY ./dist/sth ./dist/sth
COPY ./dist/symbols ./dist/symbols
COPY ./dist/types ./dist/types
COPY ./dist/load-check ./dist/load-check
COPY ./dist/utility ./dist/utility
COPY ./dist/verser ./dist/verser
Expand Down
2 changes: 2 additions & 0 deletions packages/symbols/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export { SequenceMessageCode } from "./sequence-status-code";
export { OpRecordCode } from "./op-record-code";
export { APIErrorCode } from "./api-error-codes";
export { DisconnectHubErrors } from "./disconnect-error-codes";
export { InstanceStatus } from "./instance-status";

export * from "./sd-stream-handler-state";
export * from "./headers";
10 changes: 10 additions & 0 deletions packages/symbols/src/instance-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

export const enum InstanceStatus {
INITIALIZING = "initializing",
STARTING = "starting",
RUNNING = "running",
STOPPING = "stopping",
KILLING = "killing",
COMPLETED = "completed",
ERRORED = "errored",
}
23 changes: 23 additions & 0 deletions packages/symbols/src/sd-stream-handler-state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export enum WorkState {
Flowing = "flowing",
Close = "close",
Error = "error"
}

export enum WritableState {
Finish = "finish",
Writable = "writable",
Drain = "drain"
}

export enum ReadableState {
Readable = "readable",
Pause = "pause",
End = "end"
}

export enum StreamType {
Instance = "instance",
Topic = "topic",
Api = "api"
}
3 changes: 2 additions & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export * from "./telemetry-config";
export * from "./host-proxy";
export * from "./api-client/host-client";
export * from "./sd-content-type";
export * from "./sd-stream-handler";
export * from "./sd-topic-handler";
export * from "./topic-router";

Expand All @@ -60,6 +59,8 @@ export * from "./dto/index";

export * from "./rest-api-error/rest-api-error";

export { StreamState, StreamOptions, OriginType, StreamHandler, StreamOrigin } from "./sd-stream-handler";

// system-observable.ts
declare global {
interface SymbolConstructor {
Expand Down
3 changes: 2 additions & 1 deletion packages/types/src/instance-store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { InstanceStatus } from "@scramjet/symbols";
import { AppConfig } from "./app-config";
import { InstanceArgs, InstanceId, InstanceStatus } from "./instance";
import { InstanceArgs, InstanceId } from "./instance";
import { SequenceInfoInstance } from "./sequence-adapter";

export type Instance = {
Expand Down
10 changes: 0 additions & 10 deletions packages/types/src/instance.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
export type InstanceId = string;

export type InstanceArgs = any[];

export const enum InstanceStatus {
INITIALIZING = "initializing",
STARTING = "starting",
RUNNING = "running",
STOPPING = "stopping",
KILLING = "killing",
COMPLETED ="completed",
ERRORED = "errored",
}
26 changes: 3 additions & 23 deletions packages/types/src/sd-stream-handler.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
export enum WorkState {
Flowing = "flowing",
Close = "close",
Error = "error"
}

export enum WritableState {
Finish = "finish",
Writable = "writable",
Drain = "drain"
}

export enum ReadableState {
Readable = "readable",
Pause = "pause",
End = "end"
}
import { WorkState, WritableState, ReadableState, StreamType } from "@scramjet/symbols";

export type StreamState = WorkState | WritableState | ReadableState;

export enum StreamType {
Instance = "instance",
Topic = "topic",
Api = "api"
}

export type StreamOptions = Record<string, any>;

export type OriginType = "space" | "hub"
Expand All @@ -40,3 +18,5 @@ export interface StreamHandler {
options(): StreamOptions
origin(): StreamOrigin
}

export { WorkState, WritableState, ReadableState, StreamType };