mysterium-vpn-js
Version:
Javascript SDK for Mysterium node
94 lines (93 loc) • 2.32 kB
TypeScript
/**
* Copyright (c) 2020 BlockDev AG
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Pageable, PaginationQuery } from '../common/pageable';
/**
* @deprecated use ProviderAPI
*/
export declare enum SessionStatus {
NEW = "New",
COMPLETED = "Completed"
}
/**
* @deprecated use ProviderAPI
*/
export declare enum SessionDirection {
CONSUMED = "Consumed",
PROVIDED = "Provided"
}
/**
* @deprecated use ProviderAPI
*/
export interface Session {
id: string;
direction: SessionDirection;
consumerId: string;
hermesId: string;
providerId: string;
serviceType: string;
providerCountry: string;
consumerCountry: string;
createdAt: string;
duration: number;
bytesReceived: number;
bytesSent: number;
tokens: number;
status: SessionStatus;
}
export declare function parseSession(data: any): Session;
/**
* @deprecated use ProviderAPI
*/
export interface SessionStats {
count: number;
countConsumers: number;
sumBytesReceived: number;
sumBytesSent: number;
sumDuration: number;
sumTokens: number;
}
export declare function parseSessionStats(data: any): SessionStats;
/**
* @deprecated use ProviderAPI
*/
export interface SessionQuery {
dateFrom?: string;
dateTo?: string;
direction?: SessionDirection;
consumerId?: string;
hermesId?: string;
providerId?: string;
serviceType?: string;
status?: SessionStatus;
}
/**
* @deprecated use ProviderAPI
*/
export interface SessionListQuery extends PaginationQuery, SessionQuery {
}
/**
* @deprecated use ProviderAPI
*/
export declare type SessionListResponse = Pageable<Session>;
export declare function parseSessionListResponse(responseData: any): SessionListResponse;
/**
* @deprecated use ProviderAPI
*/
export interface SessionStatsAggregatedResponse {
stats: SessionStats;
}
export declare function parseSessionStatsAggregatedResponse(data: any): SessionStatsAggregatedResponse;
/**
* @deprecated use ProviderAPI
*/
export interface SessionStatsDailyResponse {
items: {
[date: string]: SessionStats;
};
stats: SessionStats;
}
export declare function parseSessionStatsDailyResponse(data: any): SessionStatsDailyResponse;