@huddle01/observer-client-sdk
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -6,5 +6,5 @@ import { DashboardDataStreamNotification } from '../protocols/DashboardMessageProtocol'; | ||
export type DataFrameEvents<T> = { | ||
close: () => void; | ||
newrow: (row: T) => void; | ||
error: (error: string) => void; | ||
close: []; | ||
newrow: [row: T]; | ||
error: [error: string]; | ||
}; | ||
@@ -14,2 +14,8 @@ export type DataFrameConfig = { | ||
}; | ||
export declare interface DataFrame<T> { | ||
on<U extends keyof DataFrameEvents<T>>(event: U, listener: (...args: DataFrameEvents<T>[U]) => void): this; | ||
off<U extends keyof DataFrameEvents<T>>(event: U, listener: (...args: DataFrameEvents<T>[U]) => void): this; | ||
once<U extends keyof DataFrameEvents<T>>(event: U, listener: (...args: DataFrameEvents<T>[U]) => void): this; | ||
emit<U extends keyof DataFrameEvents<T>>(event: U, ...args: DataFrameEvents<T>[U]): boolean; | ||
} | ||
export declare class DataFrame<T> extends EventEmitter implements DataStream<T> { | ||
@@ -16,0 +22,0 @@ readonly config: DataFrameConfig; |
import { DashboardDataStreamNotification } from '../protocols/DashboardMessageProtocol'; | ||
export type ObserverDataStreamEvents<T> = { | ||
close: () => void; | ||
newrow: (row: T) => void; | ||
error: (error: string) => void; | ||
close: []; | ||
newrow: [row: T]; | ||
error: [error: string]; | ||
}; | ||
export interface ObserverDataStream<T = unknown> { | ||
on<K extends keyof ObserverDataStreamEvents<T>>(event: K, listener: ObserverDataStreamEvents<T>[K]): this; | ||
once<K extends keyof ObserverDataStreamEvents<T>>(event: K, listener: ObserverDataStreamEvents<T>[K]): this; | ||
off<K extends keyof ObserverDataStreamEvents<T>>(event: K, listener: ObserverDataStreamEvents<T>[K]): this; | ||
on<U extends keyof ObserverDataStreamEvents<T>>(event: U, listener: (...args: ObserverDataStreamEvents<T>[U]) => void): this; | ||
off<U extends keyof ObserverDataStreamEvents<T>>(event: U, listener: (...args: ObserverDataStreamEvents<T>[U]) => void): this; | ||
once<U extends keyof ObserverDataStreamEvents<T>>(event: U, listener: (...args: ObserverDataStreamEvents<T>[U]) => void): this; | ||
readonly id: string; | ||
@@ -12,0 +12,0 @@ readonly closed: boolean; |
@@ -6,3 +6,6 @@ export { ObserverClient, ObserverClientConfig, ObserverClientEventMap, } from './ObserverClient'; | ||
export { DataFrame, DataFrameConfig, DataFrameEvents, } from './datastreams/DataFrame'; | ||
export { ObserverAdminClient } from './ObserverAdminClient'; | ||
export * as DashboardProtocol from './protocols/DashboardMessageProtocol'; | ||
export * as CallSnapshotSchema from './protocols/CallSnapshotSchema'; | ||
export { DataStream } from './datastreams/DataStream'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DataFrame = exports.WebSocketConnector = exports.ObserverClient = void 0; | ||
exports.CallSnapshotSchema = exports.DashboardProtocol = exports.ObserverAdminClient = exports.DataFrame = exports.WebSocketConnector = exports.ObserverClient = void 0; | ||
var ObserverClient_1 = require("./ObserverClient"); | ||
@@ -10,1 +33,5 @@ Object.defineProperty(exports, "ObserverClient", { enumerable: true, get: function () { return ObserverClient_1.ObserverClient; } }); | ||
Object.defineProperty(exports, "DataFrame", { enumerable: true, get: function () { return DataFrame_1.DataFrame; } }); | ||
var ObserverAdminClient_1 = require("./ObserverAdminClient"); | ||
Object.defineProperty(exports, "ObserverAdminClient", { enumerable: true, get: function () { return ObserverAdminClient_1.ObserverAdminClient; } }); | ||
exports.DashboardProtocol = __importStar(require("./protocols/DashboardMessageProtocol")); | ||
exports.CallSnapshotSchema = __importStar(require("./protocols/CallSnapshotSchema")); |
import { DataFrame } from './datastreams/DataFrame'; | ||
import { DataStream, ObserverDataStream } from './datastreams/DataStream'; | ||
import { DatabaseFrameSchema, DatabaseFrameConditions } from './datastreams/DatabaseFrame'; | ||
import { DashboardQueryOperations, FindCallsResponsePayload, GetSummaryResponsePayload, OngoingCallsResponsePayload } from './protocols/DashboardMessageProtocol'; | ||
import { DashboardDataStreamOperations, DashboardMessage, DashboardQueryOperations, FindCallsResponsePayload, GetSummaryResponsePayload, OngoingCallsResponsePayload } from './protocols/DashboardMessageProtocol'; | ||
import { WebSocketConnector, WebSocketConnectorConfig } from './WebSocketConnector'; | ||
@@ -13,2 +14,5 @@ import { EventEmitter } from 'events'; | ||
}; | ||
type CreateDataStreamOptions = DashboardDataStreamOperations['create'] & { | ||
create: (dataStreamId: string) => DataStream<any>; | ||
}; | ||
export declare interface ObserverClient { | ||
@@ -38,5 +42,6 @@ on<U extends keyof ObserverClientEventMap>(event: U, listener: (...args: ObserverClientEventMap[U]) => void): this; | ||
}): Promise<DataFrame<ClientSnapshot>>; | ||
private _createDataStream; | ||
private _receive; | ||
protected _createDataStream(options: CreateDataStreamOptions, updateOnCreate: boolean): Promise<ObserverDataStream>; | ||
protected _receive(message: DashboardMessage): void; | ||
} | ||
export {}; | ||
//# sourceMappingURL=ObserverClient.d.ts.map |
@@ -116,3 +116,3 @@ "use strict"; | ||
const result = await this._createDataStream({ | ||
dataStreamId: callId, | ||
dataStreamId: clientId, | ||
resourceId: DashboardMessageProtocol_1.protocolMeta.dataStreams.clientSnapshotResourceId, | ||
@@ -119,0 +119,0 @@ create, |
@@ -42,2 +42,24 @@ import { CallSnapshot } from "./CallSnapshotSchema"; | ||
}; | ||
export type ObserverWorkerState = { | ||
peerId: string; | ||
version: string; | ||
env?: string; | ||
leader?: boolean; | ||
uptimeInSec: number; | ||
ongoingCallIds: string[]; | ||
ongoingJobIds: string[]; | ||
consumerGroupId: string; | ||
maxParallelJobs: number; | ||
jobRouterDescription: string; | ||
consumers: string[]; | ||
}; | ||
export type ObserverServerState = { | ||
peerId: string; | ||
version: string; | ||
env?: string; | ||
leader?: boolean; | ||
uptimeInSec: number; | ||
activeObservedClientIds: string[]; | ||
activeDashboardClientIds: string[]; | ||
}; | ||
export type DashboardClientConnectionContext = { | ||
@@ -70,2 +92,4 @@ role: 'admin' | 'customer'; | ||
export type GetSummaryResponsePayload = SummaryStats[]; | ||
export type GetWorkerStatesResponsePayload = ObserverWorkerState[]; | ||
export type GetServerStatesResponsePayload = ObserverServerState[]; | ||
export type DashboardQueryOperations = { | ||
@@ -81,2 +105,3 @@ findCalls: { | ||
ongoingCals: undefined; | ||
ongoingCalls: undefined; | ||
getSummaryStats: { | ||
@@ -86,2 +111,4 @@ startDate: number; | ||
}; | ||
getWorkerStates: undefined; | ||
getServerStates: undefined; | ||
}; | ||
@@ -88,0 +115,0 @@ export declare class DashboardQueryRequest { |
@@ -165,3 +165,3 @@ "use strict"; | ||
const message = this._codec.decode(event.data); | ||
logger.debug('received message', message); | ||
// logger.debug('received message', message); | ||
if (message.type === 'DashboardResponse') { | ||
@@ -168,0 +168,0 @@ const request = this._pendingRequests.get(message.requestId); |
{ | ||
"name": "@huddle01/observer-client-sdk", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "ObserverClient SDK", | ||
@@ -22,3 +22,3 @@ "main": "lib/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/balazskreith/webrtc-sfu-transcriber.git" | ||
"url": "git+https://github.com/huddle01/observer-service.git" | ||
}, | ||
@@ -29,8 +29,7 @@ "keywords": [ | ||
], | ||
"author": "Balazs Kreith", | ||
"license": "Apache-2.0", | ||
"author": "Huddle01", | ||
"bugs": { | ||
"url": "https://github.com/balazskreith/webrtc-sfu-transcriber/issues" | ||
"url": "https://github.com/huddle01/observer-service.git#issues" | ||
}, | ||
"homepage": "https://github.com/balazskreith/webrtc-sfu-transcriber#readme", | ||
"homepage": "https://github.com/huddle01/observer-service.git#readme", | ||
"dependencies": { | ||
@@ -37,0 +36,0 @@ "events": "^3.3.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
165529
3589