@remnawave/xtls-sdk 0.0.5 → 0.0.6

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,30 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "xray.app.dns.fakedns";
3
- export interface FakeDnsPool {
4
- $type: "xray.app.dns.fakedns.FakeDnsPool";
5
- /** CIDR of IP pool used as fake DNS IP */
6
- ipPool: string;
7
- /** Size of Pool for remembering relationship between domain name and IP address */
8
- lruSize: number;
9
- }
10
- export interface FakeDnsPoolMulti {
11
- $type: "xray.app.dns.fakedns.FakeDnsPoolMulti";
12
- pools: FakeDnsPool[];
13
- }
14
- export declare const FakeDnsPool: MessageFns<FakeDnsPool, "xray.app.dns.fakedns.FakeDnsPool">;
15
- export declare const FakeDnsPoolMulti: MessageFns<FakeDnsPoolMulti, "xray.app.dns.fakedns.FakeDnsPoolMulti">;
16
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
17
- 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 {} ? {
18
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
19
- } : Partial<T>;
20
- export interface MessageFns<T, V extends string> {
21
- readonly $type: V;
22
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
23
- decode(input: BinaryReader | Uint8Array, length?: number): T;
24
- fromJSON(object: any): T;
25
- toJSON(message: T): unknown;
26
- create(base?: DeepPartial<T>): T;
27
- fromPartial(object: DeepPartial<T>): T;
28
- }
29
- export {};
30
- //# sourceMappingURL=fakedns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fakedns.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/app/dns/fakedns/fakedns.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,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AE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
@@ -1,152 +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/dns/fakedns/fakedns.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.FakeDnsPoolMulti = exports.FakeDnsPool = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const typeRegistry_1 = require("../../../typeRegistry");
12
- exports.protobufPackage = "xray.app.dns.fakedns";
13
- function createBaseFakeDnsPool() {
14
- return { $type: "xray.app.dns.fakedns.FakeDnsPool", ipPool: "", lruSize: 0 };
15
- }
16
- exports.FakeDnsPool = {
17
- $type: "xray.app.dns.fakedns.FakeDnsPool",
18
- encode(message, writer = new wire_1.BinaryWriter()) {
19
- if (message.ipPool !== "") {
20
- writer.uint32(10).string(message.ipPool);
21
- }
22
- if (message.lruSize !== 0) {
23
- writer.uint32(16).int64(message.lruSize);
24
- }
25
- return writer;
26
- },
27
- decode(input, length) {
28
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
29
- let end = length === undefined ? reader.len : reader.pos + length;
30
- const message = createBaseFakeDnsPool();
31
- while (reader.pos < end) {
32
- const tag = reader.uint32();
33
- switch (tag >>> 3) {
34
- case 1: {
35
- if (tag !== 10) {
36
- break;
37
- }
38
- message.ipPool = reader.string();
39
- continue;
40
- }
41
- case 2: {
42
- if (tag !== 16) {
43
- break;
44
- }
45
- message.lruSize = longToNumber(reader.int64());
46
- continue;
47
- }
48
- }
49
- if ((tag & 7) === 4 || tag === 0) {
50
- break;
51
- }
52
- reader.skip(tag & 7);
53
- }
54
- return message;
55
- },
56
- fromJSON(object) {
57
- return {
58
- $type: exports.FakeDnsPool.$type,
59
- ipPool: isSet(object.ipPool) ? globalThis.String(object.ipPool) : "",
60
- lruSize: isSet(object.lruSize) ? globalThis.Number(object.lruSize) : 0,
61
- };
62
- },
63
- toJSON(message) {
64
- const obj = {};
65
- if (message.ipPool !== "") {
66
- obj.ipPool = message.ipPool;
67
- }
68
- if (message.lruSize !== 0) {
69
- obj.lruSize = Math.round(message.lruSize);
70
- }
71
- return obj;
72
- },
73
- create(base) {
74
- return exports.FakeDnsPool.fromPartial(base ?? {});
75
- },
76
- fromPartial(object) {
77
- const message = createBaseFakeDnsPool();
78
- message.ipPool = object.ipPool ?? "";
79
- message.lruSize = object.lruSize ?? 0;
80
- return message;
81
- },
82
- };
83
- typeRegistry_1.messageTypeRegistry.set(exports.FakeDnsPool.$type, exports.FakeDnsPool);
84
- function createBaseFakeDnsPoolMulti() {
85
- return { $type: "xray.app.dns.fakedns.FakeDnsPoolMulti", pools: [] };
86
- }
87
- exports.FakeDnsPoolMulti = {
88
- $type: "xray.app.dns.fakedns.FakeDnsPoolMulti",
89
- encode(message, writer = new wire_1.BinaryWriter()) {
90
- for (const v of message.pools) {
91
- exports.FakeDnsPool.encode(v, writer.uint32(10).fork()).join();
92
- }
93
- return writer;
94
- },
95
- decode(input, length) {
96
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
97
- let end = length === undefined ? reader.len : reader.pos + length;
98
- const message = createBaseFakeDnsPoolMulti();
99
- while (reader.pos < end) {
100
- const tag = reader.uint32();
101
- switch (tag >>> 3) {
102
- case 1: {
103
- if (tag !== 10) {
104
- break;
105
- }
106
- message.pools.push(exports.FakeDnsPool.decode(reader, reader.uint32()));
107
- continue;
108
- }
109
- }
110
- if ((tag & 7) === 4 || tag === 0) {
111
- break;
112
- }
113
- reader.skip(tag & 7);
114
- }
115
- return message;
116
- },
117
- fromJSON(object) {
118
- return {
119
- $type: exports.FakeDnsPoolMulti.$type,
120
- pools: globalThis.Array.isArray(object?.pools) ? object.pools.map((e) => exports.FakeDnsPool.fromJSON(e)) : [],
121
- };
122
- },
123
- toJSON(message) {
124
- const obj = {};
125
- if (message.pools?.length) {
126
- obj.pools = message.pools.map((e) => exports.FakeDnsPool.toJSON(e));
127
- }
128
- return obj;
129
- },
130
- create(base) {
131
- return exports.FakeDnsPoolMulti.fromPartial(base ?? {});
132
- },
133
- fromPartial(object) {
134
- const message = createBaseFakeDnsPoolMulti();
135
- message.pools = object.pools?.map((e) => exports.FakeDnsPool.fromPartial(e)) || [];
136
- return message;
137
- },
138
- };
139
- typeRegistry_1.messageTypeRegistry.set(exports.FakeDnsPoolMulti.$type, exports.FakeDnsPoolMulti);
140
- function longToNumber(int64) {
141
- const num = globalThis.Number(int64.toString());
142
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
143
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
144
- }
145
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
146
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
147
- }
148
- return num;
149
- }
150
- function isSet(value) {
151
- return value !== null && value !== undefined;
152
- }
@@ -1,41 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "xray.core.app.observatory.burst";
3
- export interface Config {
4
- $type: "xray.core.app.observatory.burst.Config";
5
- /** @Document The selectors for outbound under observation */
6
- subjectSelector: string[];
7
- pingConfig: HealthPingConfig | undefined;
8
- }
9
- export interface HealthPingConfig {
10
- $type: "xray.core.app.observatory.burst.HealthPingConfig";
11
- /**
12
- * destination url, need 204 for success return
13
- * default https://connectivitycheck.gstatic.com/generate_204
14
- */
15
- destination: string;
16
- /** connectivity check url */
17
- connectivity: string;
18
- /** health check interval, int64 values of time.Duration */
19
- interval: number;
20
- /** sampling count is the amount of recent ping results which are kept for calculation */
21
- samplingCount: number;
22
- /** ping timeout, int64 values of time.Duration */
23
- timeout: number;
24
- }
25
- export declare const Config: MessageFns<Config, "xray.core.app.observatory.burst.Config">;
26
- export declare const HealthPingConfig: MessageFns<HealthPingConfig, "xray.core.app.observatory.burst.HealthPingConfig">;
27
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
28
- 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 {} ? {
29
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
30
- } : Partial<T>;
31
- export interface MessageFns<T, V extends string> {
32
- readonly $type: V;
33
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
34
- decode(input: BinaryReader | Uint8Array, length?: number): T;
35
- fromJSON(object: any): T;
36
- toJSON(message: T): unknown;
37
- create(base?: DeepPartial<T>): T;
38
- fromPartial(object: DeepPartial<T>): T;
39
- }
40
- export {};
41
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/app/observatory/burst/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGrE,eAAO,MAAM,eAAe,oCAAoC,CAAC;AAEjE,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,wCAAwC,CAAC;IAChD,6DAA6D;IAC7D,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC1C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C;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
@@ -1,223 +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/burst/config.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.HealthPingConfig = exports.Config = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const typeRegistry_1 = require("../../../typeRegistry");
12
- exports.protobufPackage = "xray.core.app.observatory.burst";
13
- function createBaseConfig() {
14
- return { $type: "xray.core.app.observatory.burst.Config", subjectSelector: [], pingConfig: undefined };
15
- }
16
- exports.Config = {
17
- $type: "xray.core.app.observatory.burst.Config",
18
- encode(message, writer = new wire_1.BinaryWriter()) {
19
- for (const v of message.subjectSelector) {
20
- writer.uint32(18).string(v);
21
- }
22
- if (message.pingConfig !== undefined) {
23
- exports.HealthPingConfig.encode(message.pingConfig, writer.uint32(26).fork()).join();
24
- }
25
- return writer;
26
- },
27
- decode(input, length) {
28
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
29
- let end = length === undefined ? reader.len : reader.pos + length;
30
- const message = createBaseConfig();
31
- while (reader.pos < end) {
32
- const tag = reader.uint32();
33
- switch (tag >>> 3) {
34
- case 2: {
35
- if (tag !== 18) {
36
- break;
37
- }
38
- message.subjectSelector.push(reader.string());
39
- continue;
40
- }
41
- case 3: {
42
- if (tag !== 26) {
43
- break;
44
- }
45
- message.pingConfig = exports.HealthPingConfig.decode(reader, reader.uint32());
46
- continue;
47
- }
48
- }
49
- if ((tag & 7) === 4 || tag === 0) {
50
- break;
51
- }
52
- reader.skip(tag & 7);
53
- }
54
- return message;
55
- },
56
- fromJSON(object) {
57
- return {
58
- $type: exports.Config.$type,
59
- subjectSelector: globalThis.Array.isArray(object?.subjectSelector)
60
- ? object.subjectSelector.map((e) => globalThis.String(e))
61
- : [],
62
- pingConfig: isSet(object.pingConfig) ? exports.HealthPingConfig.fromJSON(object.pingConfig) : undefined,
63
- };
64
- },
65
- toJSON(message) {
66
- const obj = {};
67
- if (message.subjectSelector?.length) {
68
- obj.subjectSelector = message.subjectSelector;
69
- }
70
- if (message.pingConfig !== undefined) {
71
- obj.pingConfig = exports.HealthPingConfig.toJSON(message.pingConfig);
72
- }
73
- return obj;
74
- },
75
- create(base) {
76
- return exports.Config.fromPartial(base ?? {});
77
- },
78
- fromPartial(object) {
79
- const message = createBaseConfig();
80
- message.subjectSelector = object.subjectSelector?.map((e) => e) || [];
81
- message.pingConfig = (object.pingConfig !== undefined && object.pingConfig !== null)
82
- ? exports.HealthPingConfig.fromPartial(object.pingConfig)
83
- : undefined;
84
- return message;
85
- },
86
- };
87
- typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
88
- function createBaseHealthPingConfig() {
89
- return {
90
- $type: "xray.core.app.observatory.burst.HealthPingConfig",
91
- destination: "",
92
- connectivity: "",
93
- interval: 0,
94
- samplingCount: 0,
95
- timeout: 0,
96
- };
97
- }
98
- exports.HealthPingConfig = {
99
- $type: "xray.core.app.observatory.burst.HealthPingConfig",
100
- encode(message, writer = new wire_1.BinaryWriter()) {
101
- if (message.destination !== "") {
102
- writer.uint32(10).string(message.destination);
103
- }
104
- if (message.connectivity !== "") {
105
- writer.uint32(18).string(message.connectivity);
106
- }
107
- if (message.interval !== 0) {
108
- writer.uint32(24).int64(message.interval);
109
- }
110
- if (message.samplingCount !== 0) {
111
- writer.uint32(32).int32(message.samplingCount);
112
- }
113
- if (message.timeout !== 0) {
114
- writer.uint32(40).int64(message.timeout);
115
- }
116
- return writer;
117
- },
118
- decode(input, length) {
119
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
120
- let end = length === undefined ? reader.len : reader.pos + length;
121
- const message = createBaseHealthPingConfig();
122
- while (reader.pos < end) {
123
- const tag = reader.uint32();
124
- switch (tag >>> 3) {
125
- case 1: {
126
- if (tag !== 10) {
127
- break;
128
- }
129
- message.destination = reader.string();
130
- continue;
131
- }
132
- case 2: {
133
- if (tag !== 18) {
134
- break;
135
- }
136
- message.connectivity = reader.string();
137
- continue;
138
- }
139
- case 3: {
140
- if (tag !== 24) {
141
- break;
142
- }
143
- message.interval = longToNumber(reader.int64());
144
- continue;
145
- }
146
- case 4: {
147
- if (tag !== 32) {
148
- break;
149
- }
150
- message.samplingCount = reader.int32();
151
- continue;
152
- }
153
- case 5: {
154
- if (tag !== 40) {
155
- break;
156
- }
157
- message.timeout = longToNumber(reader.int64());
158
- continue;
159
- }
160
- }
161
- if ((tag & 7) === 4 || tag === 0) {
162
- break;
163
- }
164
- reader.skip(tag & 7);
165
- }
166
- return message;
167
- },
168
- fromJSON(object) {
169
- return {
170
- $type: exports.HealthPingConfig.$type,
171
- destination: isSet(object.destination) ? globalThis.String(object.destination) : "",
172
- connectivity: isSet(object.connectivity) ? globalThis.String(object.connectivity) : "",
173
- interval: isSet(object.interval) ? globalThis.Number(object.interval) : 0,
174
- samplingCount: isSet(object.samplingCount) ? globalThis.Number(object.samplingCount) : 0,
175
- timeout: isSet(object.timeout) ? globalThis.Number(object.timeout) : 0,
176
- };
177
- },
178
- toJSON(message) {
179
- const obj = {};
180
- if (message.destination !== "") {
181
- obj.destination = message.destination;
182
- }
183
- if (message.connectivity !== "") {
184
- obj.connectivity = message.connectivity;
185
- }
186
- if (message.interval !== 0) {
187
- obj.interval = Math.round(message.interval);
188
- }
189
- if (message.samplingCount !== 0) {
190
- obj.samplingCount = Math.round(message.samplingCount);
191
- }
192
- if (message.timeout !== 0) {
193
- obj.timeout = Math.round(message.timeout);
194
- }
195
- return obj;
196
- },
197
- create(base) {
198
- return exports.HealthPingConfig.fromPartial(base ?? {});
199
- },
200
- fromPartial(object) {
201
- const message = createBaseHealthPingConfig();
202
- message.destination = object.destination ?? "";
203
- message.connectivity = object.connectivity ?? "";
204
- message.interval = object.interval ?? 0;
205
- message.samplingCount = object.samplingCount ?? 0;
206
- message.timeout = object.timeout ?? 0;
207
- return message;
208
- },
209
- };
210
- typeRegistry_1.messageTypeRegistry.set(exports.HealthPingConfig.$type, exports.HealthPingConfig);
211
- function longToNumber(int64) {
212
- const num = globalThis.Number(int64.toString());
213
- if (num > globalThis.Number.MAX_SAFE_INTEGER) {
214
- throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
215
- }
216
- if (num < globalThis.Number.MIN_SAFE_INTEGER) {
217
- throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
218
- }
219
- return num;
220
- }
221
- function isSet(value) {
222
- return value !== null && value !== undefined;
223
- }
@@ -1,53 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- import { type CallContext, type CallOptions } from "nice-grpc-common";
3
- import { ObservationResult } from "../config";
4
- export declare const protobufPackage = "xray.core.app.observatory.command";
5
- export interface GetOutboundStatusRequest {
6
- $type: "xray.core.app.observatory.command.GetOutboundStatusRequest";
7
- }
8
- export interface GetOutboundStatusResponse {
9
- $type: "xray.core.app.observatory.command.GetOutboundStatusResponse";
10
- status: ObservationResult | undefined;
11
- }
12
- export interface Config {
13
- $type: "xray.core.app.observatory.command.Config";
14
- }
15
- export declare const GetOutboundStatusRequest: MessageFns<GetOutboundStatusRequest, "xray.core.app.observatory.command.GetOutboundStatusRequest">;
16
- export declare const GetOutboundStatusResponse: MessageFns<GetOutboundStatusResponse, "xray.core.app.observatory.command.GetOutboundStatusResponse">;
17
- export declare const Config: MessageFns<Config, "xray.core.app.observatory.command.Config">;
18
- export type ObservatoryServiceDefinition = typeof ObservatoryServiceDefinition;
19
- export declare const ObservatoryServiceDefinition: {
20
- readonly name: "ObservatoryService";
21
- readonly fullName: "xray.core.app.observatory.command.ObservatoryService";
22
- readonly methods: {
23
- readonly getOutboundStatus: {
24
- readonly name: "GetOutboundStatus";
25
- readonly requestType: MessageFns<GetOutboundStatusRequest, "xray.core.app.observatory.command.GetOutboundStatusRequest">;
26
- readonly requestStream: false;
27
- readonly responseType: MessageFns<GetOutboundStatusResponse, "xray.core.app.observatory.command.GetOutboundStatusResponse">;
28
- readonly responseStream: false;
29
- readonly options: {};
30
- };
31
- };
32
- };
33
- export interface ObservatoryServiceImplementation<CallContextExt = {}> {
34
- getOutboundStatus(request: GetOutboundStatusRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetOutboundStatusResponse>>;
35
- }
36
- export interface ObservatoryServiceClient<CallOptionsExt = {}> {
37
- getOutboundStatus(request: DeepPartial<GetOutboundStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<GetOutboundStatusResponse>;
38
- }
39
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
40
- 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 {} ? {
41
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
42
- } : Partial<T>;
43
- export interface MessageFns<T, V extends string> {
44
- readonly $type: V;
45
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
46
- decode(input: BinaryReader | Uint8Array, length?: number): T;
47
- fromJSON(object: any): T;
48
- toJSON(message: T): unknown;
49
- create(base?: DeepPartial<T>): T;
50
- fromPartial(object: DeepPartial<T>): T;
51
- }
52
- export {};
53
- //# sourceMappingURL=command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../src/xray-protos/app/observatory/command/command.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAEnE,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,4DAA4D,CAAC;CACrE;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,6DAA6D,CAAC;IACrE,MAAM,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,0CAA0C,CAAC;CACnD;AAMD,eAAO,MAAM,wBAAwB,EAAE,UAAU,CAC/C,wBAAwB,EACxB,4DAA4D,CAwC7D,CAAC;AAQF,eAAO,MAAM,yBAAyB,EAAE,UAAU,CAChD,yBAAyB,EACzB,6DAA6D,CA4D9D,CAAC;AAQF,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,0CAA0C,CAuCjF,CAAC;AAIF,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAC;AAC/E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;CAa/B,CAAC;AAEX,MAAM,WAAW,gCAAgC,CAAC,cAAc,GAAG,EAAE;IACnE,iBAAiB,CACf,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,WAAW,GAAG,cAAc,GACpC,OAAO,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,wBAAwB,CAAC,cAAc,GAAG,EAAE;IAC3D,iBAAiB,CACf,OAAO,EAAE,WAAW,CAAC,wBAAwB,CAAC,EAC9C,OAAO,CAAC,E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