@becomes/cms-cloud-client
Version:
SDK for accessing BCMS Cloud API
117 lines (116 loc) • 2.74 kB
TypeScript
import type { InstanceServerStats } from '@bcms-cloud/instance';
export type SocketEventType = 'update' | 'remove';
export interface SocketRedirectEvent {
uri: string;
}
export interface SocketInstanceAdditionalFileEvent {
/** Type */
t: SocketEventType;
/** Org ID */
o: string;
/** Instance ID */
i: string;
/** Additional file ID */
ai: string;
}
export interface SocketInstanceFJEEvent {
/** Type */
t: SocketEventType;
/** Org ID */
o: string;
/** Instance ID */
i: string;
/** FJE ID */
fi: string;
}
export interface SocketCheckoutCompleteEvent {
/** Checkout ID */
cid: string;
}
export interface SocketInvitationEvent {
/** Org ID */
o: string;
/** Instance ID */
i: string;
/** Invitation ID */
iv: string;
/** Type */
t: SocketEventType;
}
export interface SocketRewriteInstanceRouteEvent {
/** From name */
f: string;
/** To name */
t: string;
}
export interface SocketRewriteOrgRouteEvent {
/** From name */
f: string;
/** To name */
t: string;
}
export interface SocketRefreshAccessEvent {
/** Refresh */
r: boolean;
/** Rewrite org route */
rwo?: {
/** From name */
f: string;
/** To name */
t: string;
};
/** Rewrite instance route */
rwi?: {
/** From name */
f: string;
/** To name */
t: string;
};
}
export interface SocketUserEvent {
/** User ID */
u: string;
/** Type */
t: SocketEventType;
}
export interface SocketOrgEvent {
/** Org ID */
o: string;
/** Type */
t: SocketEventType;
}
export interface SocketInstanceEvent {
/** Org ID */
o: string;
/** Instance ID */
i: string;
/** Type */
t: SocketEventType;
}
export type SocketInstanceLogEventType = 'stdout' | 'stderr';
export interface SocketInstanceLogEvent {
/** Type */
t: SocketInstanceLogEventType;
/** Data chunk */
c: string;
/** Org ID */
o: string;
/** Instance ID */
i: string;
}
export interface SocketInstanceStatsEvent {
/** Org ID */
o: string;
/** Instance ID */
i: string;
stats: InstanceServerStats;
}
export interface SocketFeatureEvent {
f: string;
t: SocketEventType;
}
export interface SocketLimitEvent {
l: string;
t: SocketEventType;
}
export type SocketEventData = SocketOrgEvent | SocketRefreshAccessEvent | SocketInstanceEvent | SocketUserEvent | SocketInvitationEvent | SocketCheckoutCompleteEvent | SocketInstanceLogEvent | SocketInstanceStatsEvent | SocketFeatureEvent | SocketLimitEvent | SocketInstanceFJEEvent | SocketInstanceAdditionalFileEvent | SocketRedirectEvent;