@huddle01/observer-client-sdk
Advanced tools
Comparing version 0.11.1-3a441ee.0 to 0.11.1-44256a3.0
@@ -5,7 +5,6 @@ export { ObserverDashboardClient, ObserverDashboardClientConfig, ObserverDashboardClientEventMap, } from './ObserverDashboardClient'; | ||
export { DatabaseFrameSchema, DatabaseFrameConditions, } from './datastreams/DatabaseFrame'; | ||
export { DataFrame, DataFrameConfig, DataFrameEvents, } from './datastreams/DataFrame'; | ||
export { ObserverDashboardDataStream, ObserverDashboardDataStreamConfig as DataFrameConfig, ObserverDashboardDataStreamEventsMap, } from './ObservedDashboardDataStream'; | ||
export { ObserverDashboardAdminClient } from './ObserverDashboardAdminClient'; | ||
export * as DashboardProtocol from './protocols/DashboardMessageProtocol'; | ||
export { DashboardQueryRequest, DashboardNotification, DashboardMessage, } from './protocols/DashboardMessageProtocol'; | ||
export * as CallSnapshotSchema from './protocols/CallSnapshotSchema'; | ||
export { DataStream } from './datastreams/DataStream'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CallSnapshotSchema = exports.DashboardProtocol = exports.ObserverDashboardAdminClient = exports.DataFrame = exports.WebSocketConnector = exports.ObserverDashboardClient = void 0; | ||
exports.CallSnapshotSchema = exports.DashboardQueryRequest = exports.ObserverDashboardAdminClient = exports.ObserverDashboardDataStream = exports.WebSocketConnector = exports.ObserverDashboardClient = void 0; | ||
var ObserverDashboardClient_1 = require("./ObserverDashboardClient"); | ||
@@ -32,7 +32,8 @@ Object.defineProperty(exports, "ObserverDashboardClient", { enumerable: true, get: function () { return ObserverDashboardClient_1.ObserverDashboardClient; } }); | ||
Object.defineProperty(exports, "WebSocketConnector", { enumerable: true, get: function () { return WebSocketConnector_1.WebSocketConnector; } }); | ||
var DataFrame_1 = require("./datastreams/DataFrame"); | ||
Object.defineProperty(exports, "DataFrame", { enumerable: true, get: function () { return DataFrame_1.DataFrame; } }); | ||
var ObservedDashboardDataStream_1 = require("./ObservedDashboardDataStream"); | ||
Object.defineProperty(exports, "ObserverDashboardDataStream", { enumerable: true, get: function () { return ObservedDashboardDataStream_1.ObserverDashboardDataStream; } }); | ||
var ObserverDashboardAdminClient_1 = require("./ObserverDashboardAdminClient"); | ||
Object.defineProperty(exports, "ObserverDashboardAdminClient", { enumerable: true, get: function () { return ObserverDashboardAdminClient_1.ObserverDashboardAdminClient; } }); | ||
exports.DashboardProtocol = __importStar(require("./protocols/DashboardMessageProtocol")); | ||
var DashboardMessageProtocol_1 = require("./protocols/DashboardMessageProtocol"); | ||
Object.defineProperty(exports, "DashboardQueryRequest", { enumerable: true, get: function () { return DashboardMessageProtocol_1.DashboardQueryRequest; } }); | ||
exports.CallSnapshotSchema = __importStar(require("./protocols/CallSnapshotSchema")); |
@@ -1,3 +0,2 @@ | ||
import { DataFrame } from './datastreams/DataFrame'; | ||
import { DataStream, ObserverDataStream } from './datastreams/DataStream'; | ||
import { ObserverDashboardDataStream } from './ObservedDashboardDataStream'; | ||
import { DatabaseFrameSchema, DatabaseFrameConditions } from './datastreams/DatabaseFrame'; | ||
@@ -15,3 +14,3 @@ import { DashboardDataStreamOperations, DashboardMessage, DashboardQueryOperations, FindCallsResponsePayload, GetSummaryResponsePayload, OngoingCallsResponsePayload } from './protocols/DashboardMessageProtocol'; | ||
type CreateDataStreamOptions = DashboardDataStreamOperations['create'] & { | ||
create: (dataStreamId: string) => DataStream<any>; | ||
create: (dataStreamId: string) => ObserverDashboardDataStream<any>; | ||
}; | ||
@@ -36,9 +35,9 @@ export declare interface ObserverDashboardClient { | ||
getSummaryStats(params: DashboardQueryOperations['getSummaryStats']): Promise<GetSummaryResponsePayload>; | ||
createDatabaseFrame<K extends keyof DatabaseFrameSchema>(resourceId: K, conditions: DatabaseFrameConditions<DatabaseFrameSchema[K]>, updateOnCreate?: boolean): Promise<DataFrame<DatabaseFrameSchema[K]>>; | ||
createCallSnapshotsFrame(callId: string): Promise<DataFrame<CallSnapshot>>; | ||
createDatabaseFrame<K extends keyof DatabaseFrameSchema>(resourceId: K, conditions: DatabaseFrameConditions<DatabaseFrameSchema[K]>, updateOnCreate?: boolean): Promise<ObserverDashboardDataStream<DatabaseFrameSchema[K]>>; | ||
createCallSnapshotsFrame(callId: string): Promise<ObserverDashboardDataStream<CallSnapshot>>; | ||
createClientSnapshotsFrame(options: { | ||
callId: string; | ||
clientId: string; | ||
}): Promise<DataFrame<ClientSnapshot>>; | ||
protected _createDataStream(options: CreateDataStreamOptions, updateOnCreate: boolean): Promise<ObserverDataStream>; | ||
}): Promise<ObserverDashboardDataStream<ClientSnapshot>>; | ||
protected _createDataStream<T>(options: CreateDataStreamOptions, updateOnCreate: boolean): Promise<ObserverDashboardDataStream<T>>; | ||
protected _receive(message: DashboardMessage): void; | ||
@@ -45,0 +44,0 @@ } |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.ObserverDashboardClient = void 0; | ||
const DataFrame_1 = require("./datastreams/DataFrame"); | ||
const ObservedDashboardDataStream_1 = require("./ObservedDashboardDataStream"); | ||
const DashboardMessageProtocol_1 = require("./protocols/DashboardMessageProtocol"); | ||
@@ -70,13 +70,13 @@ const WebSocketConnector_1 = require("./WebSocketConnector"); | ||
async createDatabaseFrame(resourceId, conditions, updateOnCreate = true) { | ||
const dataFrameId = object_hash_1.default.sha1({ conditions, resourceId }); | ||
if (this._dataStreams.has(dataFrameId)) { | ||
const dataFramePromise = this._dataStreams.get(dataFrameId); | ||
const dataStreamId = object_hash_1.default.sha1({ connectionId: this.connection.id, conditions, resourceId }); | ||
if (this._dataStreams.has(dataStreamId)) { | ||
const dataFramePromise = this._dataStreams.get(dataStreamId); | ||
if (dataFramePromise) | ||
return dataFramePromise; | ||
} | ||
const create = () => new DataFrame_1.DataFrame({ | ||
dataFrameId, | ||
const create = () => new ObservedDashboardDataStream_1.ObserverDashboardDataStream({ | ||
dataStreamId, | ||
}, this.connection); | ||
const result = await this._createDataStream({ | ||
dataStreamId: dataFrameId, | ||
dataStreamId, | ||
resourceId, | ||
@@ -94,7 +94,8 @@ create, | ||
} | ||
const create = () => new DataFrame_1.DataFrame({ | ||
dataFrameId: callId, | ||
const dataStreamId = `${this.connection.id}-${callId}`; | ||
const create = () => new ObservedDashboardDataStream_1.ObserverDashboardDataStream({ | ||
dataStreamId, | ||
}, this.connection); | ||
const result = await this._createDataStream({ | ||
dataStreamId: callId, | ||
dataStreamId, | ||
resourceId: DashboardMessageProtocol_1.protocolMeta.dataStreams.callSnapshotResourceId, | ||
@@ -115,7 +116,8 @@ create, | ||
} | ||
const create = () => new DataFrame_1.DataFrame({ | ||
dataFrameId: clientId, | ||
const dataStreamId = `${this.connection.id}-${clientId}`; | ||
const create = () => new ObservedDashboardDataStream_1.ObserverDashboardDataStream({ | ||
dataStreamId, | ||
}, this.connection); | ||
const result = await this._createDataStream({ | ||
dataStreamId: clientId, | ||
dataStreamId, | ||
resourceId: DashboardMessageProtocol_1.protocolMeta.dataStreams.clientSnapshotResourceId, | ||
@@ -149,3 +151,3 @@ create, | ||
if (updateOnCreate) | ||
await dataStream.update(); | ||
await dataStream.open(); | ||
return dataStream; | ||
@@ -152,0 +154,0 @@ } |
@@ -52,8 +52,2 @@ import { CallSnapshot } from "./CallSnapshotSchema"; | ||
}[]; | ||
dataStreams: { | ||
streamType: string; | ||
streamId: string; | ||
instanceType: 'dataCollector' | 'dataSource'; | ||
collectedBytes: number; | ||
}[]; | ||
jobRouter: { | ||
@@ -66,2 +60,36 @@ createdAt: number; | ||
}; | ||
streamRouter: { | ||
emitter: { | ||
numberOfSubscriptions: number; | ||
numberOfSentEventInvocations: number; | ||
numberOfReceivedEventInvocations: number; | ||
}; | ||
sinks: { | ||
sinkId: string; | ||
streamId: string; | ||
state: string; | ||
streamProviderPeerId?: string; | ||
}[]; | ||
streamProviders: { | ||
streamType: string; | ||
bytesHighWaterMark: number; | ||
bytesLowWaterMark: number; | ||
totalBytes: number; | ||
collectors: { | ||
createdAt: number; | ||
streamId: string; | ||
numberOfFilesUploaded: number; | ||
numberOfSinks: number; | ||
collectedBytes: number; | ||
}[]; | ||
sources: { | ||
createdAt: number; | ||
streamId: string; | ||
numberOfFilesDownloaded: number; | ||
numberOfSinks: number; | ||
activeClosingTimer: boolean; | ||
collectedBytes: number; | ||
}[]; | ||
}[]; | ||
}; | ||
stats: { | ||
@@ -166,3 +194,3 @@ consumedSamples: number; | ||
data: unknown; | ||
error: string; | ||
streamerror: string; | ||
close: undefined; | ||
@@ -169,0 +197,0 @@ }; |
@@ -20,2 +20,3 @@ import EventEmitter from 'events'; | ||
export type WebSocketConnectorConfig = { | ||
id?: string; | ||
url: string; | ||
@@ -35,2 +36,3 @@ getAccessToken?: () => Promise<string | undefined>; | ||
constructor(config: WebSocketConnectorConfig); | ||
get id(): string | undefined; | ||
get accessToken(): string | undefined; | ||
@@ -37,0 +39,0 @@ get state(): WebSocketConnectorState; |
@@ -12,2 +12,3 @@ "use strict"; | ||
const logger_1 = require("./common/logger"); | ||
const uuid_1 = require("uuid"); | ||
const logger = (0, logger_1.createLogger)('WebSocketConnector'); | ||
@@ -29,3 +30,9 @@ const MAX_CONNECTION_TIMEOUT_IN_SEC = 15; | ||
this.config = config; | ||
if (!this.config.id) { | ||
this.config.id = (0, uuid_1.v4)(); | ||
} | ||
} | ||
get id() { | ||
return this.config.id; | ||
} | ||
get accessToken() { | ||
@@ -156,3 +163,3 @@ return this._accessToken; | ||
} | ||
console.warn('sending request', pendingRequest.request); | ||
// console.warn('sending request', pendingRequest.request); | ||
this._pendingRequests.set(pendingRequest.request.requestId, pendingRequest); | ||
@@ -159,0 +166,0 @@ this._socket?.send(this._codec.encode(pendingRequest.request)); |
{ | ||
"name": "@huddle01/observer-client-sdk", | ||
"version": "0.11.1-3a441ee.0", | ||
"version": "0.11.1-44256a3.0", | ||
"description": "ObserverDashboardClient SDK", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
175542
3635
42