@remnawave/xtls-sdk 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,166 +0,0 @@
1
- "use strict";
2
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
- // versions:
4
- // protoc-gen-ts_proto v2.2.7
5
- // protoc v5.28.3
6
- // source: app/observatory/command/command.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ObservatoryServiceDefinition = exports.Config = exports.GetOutboundStatusResponse = exports.GetOutboundStatusRequest = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const typeRegistry_1 = require("../../../typeRegistry");
12
- const config_1 = require("../config");
13
- exports.protobufPackage = "xray.core.app.observatory.command";
14
- function createBaseGetOutboundStatusRequest() {
15
- return { $type: "xray.core.app.observatory.command.GetOutboundStatusRequest" };
16
- }
17
- exports.GetOutboundStatusRequest = {
18
- $type: "xray.core.app.observatory.command.GetOutboundStatusRequest",
19
- encode(_, writer = new wire_1.BinaryWriter()) {
20
- return writer;
21
- },
22
- decode(input, length) {
23
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
24
- let end = length === undefined ? reader.len : reader.pos + length;
25
- const message = createBaseGetOutboundStatusRequest();
26
- while (reader.pos < end) {
27
- const tag = reader.uint32();
28
- switch (tag >>> 3) {
29
- }
30
- if ((tag & 7) === 4 || tag === 0) {
31
- break;
32
- }
33
- reader.skip(tag & 7);
34
- }
35
- return message;
36
- },
37
- fromJSON(_) {
38
- return { $type: exports.GetOutboundStatusRequest.$type };
39
- },
40
- toJSON(_) {
41
- const obj = {};
42
- return obj;
43
- },
44
- create(base) {
45
- return exports.GetOutboundStatusRequest.fromPartial(base ?? {});
46
- },
47
- fromPartial(_) {
48
- const message = createBaseGetOutboundStatusRequest();
49
- return message;
50
- },
51
- };
52
- typeRegistry_1.messageTypeRegistry.set(exports.GetOutboundStatusRequest.$type, exports.GetOutboundStatusRequest);
53
- function createBaseGetOutboundStatusResponse() {
54
- return { $type: "xray.core.app.observatory.command.GetOutboundStatusResponse", status: undefined };
55
- }
56
- exports.GetOutboundStatusResponse = {
57
- $type: "xray.core.app.observatory.command.GetOutboundStatusResponse",
58
- encode(message, writer = new wire_1.BinaryWriter()) {
59
- if (message.status !== undefined) {
60
- config_1.ObservationResult.encode(message.status, writer.uint32(10).fork()).join();
61
- }
62
- return writer;
63
- },
64
- decode(input, length) {
65
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
66
- let end = length === undefined ? reader.len : reader.pos + length;
67
- const message = createBaseGetOutboundStatusResponse();
68
- while (reader.pos < end) {
69
- const tag = reader.uint32();
70
- switch (tag >>> 3) {
71
- case 1: {
72
- if (tag !== 10) {
73
- break;
74
- }
75
- message.status = config_1.ObservationResult.decode(reader, reader.uint32());
76
- continue;
77
- }
78
- }
79
- if ((tag & 7) === 4 || tag === 0) {
80
- break;
81
- }
82
- reader.skip(tag & 7);
83
- }
84
- return message;
85
- },
86
- fromJSON(object) {
87
- return {
88
- $type: exports.GetOutboundStatusResponse.$type,
89
- status: isSet(object.status) ? config_1.ObservationResult.fromJSON(object.status) : undefined,
90
- };
91
- },
92
- toJSON(message) {
93
- const obj = {};
94
- if (message.status !== undefined) {
95
- obj.status = config_1.ObservationResult.toJSON(message.status);
96
- }
97
- return obj;
98
- },
99
- create(base) {
100
- return exports.GetOutboundStatusResponse.fromPartial(base ?? {});
101
- },
102
- fromPartial(object) {
103
- const message = createBaseGetOutboundStatusResponse();
104
- message.status = (object.status !== undefined && object.status !== null)
105
- ? config_1.ObservationResult.fromPartial(object.status)
106
- : undefined;
107
- return message;
108
- },
109
- };
110
- typeRegistry_1.messageTypeRegistry.set(exports.GetOutboundStatusResponse.$type, exports.GetOutboundStatusResponse);
111
- function createBaseConfig() {
112
- return { $type: "xray.core.app.observatory.command.Config" };
113
- }
114
- exports.Config = {
115
- $type: "xray.core.app.observatory.command.Config",
116
- encode(_, writer = new wire_1.BinaryWriter()) {
117
- return writer;
118
- },
119
- decode(input, length) {
120
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
121
- let end = length === undefined ? reader.len : reader.pos + length;
122
- const message = createBaseConfig();
123
- while (reader.pos < end) {
124
- const tag = reader.uint32();
125
- switch (tag >>> 3) {
126
- }
127
- if ((tag & 7) === 4 || tag === 0) {
128
- break;
129
- }
130
- reader.skip(tag & 7);
131
- }
132
- return message;
133
- },
134
- fromJSON(_) {
135
- return { $type: exports.Config.$type };
136
- },
137
- toJSON(_) {
138
- const obj = {};
139
- return obj;
140
- },
141
- create(base) {
142
- return exports.Config.fromPartial(base ?? {});
143
- },
144
- fromPartial(_) {
145
- const message = createBaseConfig();
146
- return message;
147
- },
148
- };
149
- typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
150
- exports.ObservatoryServiceDefinition = {
151
- name: "ObservatoryService",
152
- fullName: "xray.core.app.observatory.command.ObservatoryService",
153
- methods: {
154
- getOutboundStatus: {
155
- name: "GetOutboundStatus",
156
- requestType: exports.GetOutboundStatusRequest,
157
- requestStream: false,
158
- responseType: exports.GetOutboundStatusResponse,
159
- responseStream: false,
160
- options: {},
161
- },
162
- },
163
- };
164
- function isSet(value) {
165
- return value !== null && value !== undefined;
166
- }
@@ -1,106 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "xray.core.app.observatory";
3
- export interface ObservationResult {
4
- $type: "xray.core.app.observatory.ObservationResult";
5
- status: OutboundStatus[];
6
- }
7
- export interface HealthPingMeasurementResult {
8
- $type: "xray.core.app.observatory.HealthPingMeasurementResult";
9
- all: number;
10
- fail: number;
11
- deviation: number;
12
- average: number;
13
- max: number;
14
- min: number;
15
- }
16
- export interface OutboundStatus {
17
- $type: "xray.core.app.observatory.OutboundStatus";
18
- /**
19
- * @Document Whether this outbound is usable
20
- * @Restriction ReadOnlyForUser
21
- */
22
- alive: boolean;
23
- /**
24
- * @Document The time for probe request to finish.
25
- * @Type time.ms
26
- * @Restriction ReadOnlyForUser
27
- */
28
- delay: number;
29
- /**
30
- * @Document The last error caused this outbound failed to relay probe request
31
- * @Restriction NotMachineReadable
32
- */
33
- lastErrorReason: string;
34
- /**
35
- * @Document The outbound tag for this Server
36
- * @Type id.outboundTag
37
- */
38
- outboundTag: string;
39
- /**
40
- * @Document The time this outbound is known to be alive
41
- * @Type id.outboundTag
42
- */
43
- lastSeenTime: number;
44
- /**
45
- * @Document The time this outbound is tried
46
- * @Type id.outboundTag
47
- */
48
- lastTryTime: number;
49
- healthPing: HealthPingMeasurementResult | undefined;
50
- }
51
- export interface ProbeResult {
52
- $type: "xray.core.app.observatory.ProbeResult";
53
- /**
54
- * @Document Whether this outbound is usable
55
- * @Restriction ReadOnlyForUser
56
- */
57
- alive: boolean;
58
- /**
59
- * @Document The time for probe request to finish.
60
- * @Type time.ms
61
- * @Restriction ReadOnlyForUser
62
- */
63
- delay: number;
64
- /**
65
- * @Document The error caused this outbound failed to relay probe request
66
- * @Restriction NotMachineReadable
67
- */
68
- lastErrorReason: string;
69
- }
70
- export interface Intensity {
71
- $type: "xray.core.app.observatory.Intensity";
72
- /**
73
- * @Document The time interval for a probe request in ms.
74
- * @Type time.ms
75
- */
76
- probeInterval: number;
77
- }
78
- export interface Config {
79
- $type: "xray.core.app.observatory.Config";
80
- /** @Document The selectors for outbound under observation */
81
- subjectSelector: string[];
82
- probeUrl: string;
83
- probeInterval: number;
84
- enableConcurrency: boolean;
85
- }
86
- export declare const ObservationResult: MessageFns<ObservationResult, "xray.core.app.observatory.ObservationResult">;
87
- export declare const HealthPingMeasurementResult: MessageFns<HealthPingMeasurementResult, "xray.core.app.observatory.HealthPingMeasurementResult">;
88
- export declare const OutboundStatus: MessageFns<OutboundStatus, "xray.core.app.observatory.OutboundStatus">;
89
- export declare const ProbeResult: MessageFns<ProbeResult, "xray.core.app.observatory.ProbeResult">;
90
- export declare const Intensity: MessageFns<Intensity, "xray.core.app.observatory.Intensity">;
91
- export declare const Config: MessageFns<Config, "xray.core.app.observatory.Config">;
92
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
93
- export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
94
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
95
- } : Partial<T>;
96
- export interface MessageFns<T, V extends string> {
97
- readonly $type: V;
98
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
99
- decode(input: BinaryReader | Uint8Array, length?: number): T;
100
- fromJSON(object: any): T;
101
- toJSON(message: T): unknown;
102
- create(base?: DeepPartial<T>): T;
103
- fromPartial(object: DeepPartial<T>): T;
104
- }
105
- export {};
106
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/xray-protos/app/observatory/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,6CAA6C,CAAC;IACrD,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,uDAAuD,CAAC;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,0CAA0C,CAAC;IAClD;;;OAGG;IACH,KAAK,EAAE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