feat: update XtlsApi constructor to use XtlsApiOptions interface and bump package version to 0.10.0

This commit is contained in:
kastov 2026-01-29 02:38:47 +03:00
parent eedd88f407
commit 8777df7097
No known key found for this signature in database
GPG key ID: 1B27BE29057F4C90
2 changed files with 11 additions and 9 deletions

View file

@ -4,18 +4,20 @@ import { HandlerService } from './src/handler/handler.service';
import { RouterService } from './src/router/router.service';
import { StatsService } from './src/stats/stats.service';
export interface XtlsApiOptions {
connectionUrl: string;
options?: ChannelOptions;
credentials?: ChannelCredentials;
}
export class XtlsApi {
public readonly channel: Channel;
public readonly stats: StatsService;
public readonly handler: HandlerService;
public readonly router: RouterService;
constructor(
ip: string,
port: string,
options?: ChannelOptions,
credentials?: ChannelCredentials,
) {
this.channel = createChannel(`${ip}:${port}`, credentials, {
constructor({ connectionUrl, options, credentials }: XtlsApiOptions) {
this.channel = createChannel(connectionUrl, credentials, {
...options,
});
this.stats = new StatsService(this.channel);

View file

@ -1,6 +1,6 @@
{
"name": "@remnawave/xtls-sdk",
"version": "0.9.0",
"version": "0.10.0",
"description": "A Typescript SDK for XRAY (XTLS) Core GRPC Api",
"main": "build/index.js",
"types": "build/index.d.ts",
@ -61,4 +61,4 @@
"tsconfig-paths": "^4.2.0",
"typescript-eslint": "^8.49.0"
}
}
}