@mrclrchtr/supi-lsp 1.11.1 → 1.11.2
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.
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/vscode-jsonrpc/README.md +2 -17
- package/node_modules/vscode-jsonrpc/eslint.config.js +12 -0
- package/node_modules/vscode-jsonrpc/lib/browser/main.js +10 -3
- package/node_modules/vscode-jsonrpc/lib/browser/ril.d.ts +11 -1
- package/node_modules/vscode-jsonrpc/lib/browser/ril.js +58 -4
- package/node_modules/vscode-jsonrpc/lib/common/api.d.ts +3 -3
- package/node_modules/vscode-jsonrpc/lib/common/api.js +10 -4
- package/node_modules/vscode-jsonrpc/lib/common/cancellation.js +41 -5
- package/node_modules/vscode-jsonrpc/lib/common/connection.d.ts +76 -67
- package/node_modules/vscode-jsonrpc/lib/common/connection.js +217 -160
- package/node_modules/vscode-jsonrpc/lib/common/events.js +10 -3
- package/node_modules/vscode-jsonrpc/lib/common/is.js +7 -8
- package/node_modules/vscode-jsonrpc/lib/common/linkedMap.d.ts +3 -1
- package/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +17 -3
- package/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +5 -2
- package/node_modules/vscode-jsonrpc/lib/common/messageReader.js +52 -3
- package/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +45 -3
- package/node_modules/vscode-jsonrpc/lib/common/messages.js +147 -17
- package/node_modules/vscode-jsonrpc/lib/common/semaphore.js +8 -2
- package/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +4 -3
- package/node_modules/vscode-jsonrpc/lib/node/main.d.ts +0 -5
- package/node_modules/vscode-jsonrpc/lib/node/main.js +56 -24
- package/node_modules/vscode-jsonrpc/lib/node/ril.d.ts +0 -1
- package/node_modules/vscode-jsonrpc/lib/node/ril.js +3 -1
- package/node_modules/vscode-jsonrpc/package.json +20 -11
- package/node_modules/vscode-jsonrpc/tsconfig.tsbuildinfo +1 -0
- package/package.json +4 -4
- package/node_modules/vscode-jsonrpc/browser.d.ts +0 -6
- package/node_modules/vscode-jsonrpc/browser.js +0 -7
- package/node_modules/vscode-jsonrpc/node.cmd +0 -5
- package/node_modules/vscode-jsonrpc/node.d.ts +0 -6
- package/node_modules/vscode-jsonrpc/node.js +0 -7
|
@@ -3,15 +3,20 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
6
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
10
|
exports.Emitter = exports.Event = void 0;
|
|
8
|
-
const ral_1 = require("./ral");
|
|
11
|
+
const ral_1 = __importDefault(require("./ral"));
|
|
9
12
|
var Event;
|
|
10
13
|
(function (Event) {
|
|
11
14
|
const _disposable = { dispose() { } };
|
|
12
15
|
Event.None = function () { return _disposable; };
|
|
13
16
|
})(Event || (exports.Event = Event = {}));
|
|
14
17
|
class CallbackList {
|
|
18
|
+
_callbacks;
|
|
19
|
+
_contexts;
|
|
15
20
|
add(callback, context = null, bucket) {
|
|
16
21
|
if (!this._callbacks) {
|
|
17
22
|
this._callbacks = [];
|
|
@@ -55,7 +60,6 @@ class CallbackList {
|
|
|
55
60
|
ret.push(callbacks[i].apply(contexts[i], args));
|
|
56
61
|
}
|
|
57
62
|
catch (e) {
|
|
58
|
-
// eslint-disable-next-line no-console
|
|
59
63
|
(0, ral_1.default)().console.error(e);
|
|
60
64
|
}
|
|
61
65
|
}
|
|
@@ -70,6 +74,10 @@ class CallbackList {
|
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
class Emitter {
|
|
77
|
+
_options;
|
|
78
|
+
static _noop = function () { };
|
|
79
|
+
_event;
|
|
80
|
+
_callbacks;
|
|
73
81
|
constructor(_options) {
|
|
74
82
|
this._options = _options;
|
|
75
83
|
}
|
|
@@ -125,4 +133,3 @@ class Emitter {
|
|
|
125
133
|
}
|
|
126
134
|
}
|
|
127
135
|
exports.Emitter = Emitter;
|
|
128
|
-
Emitter._noop = function () { };
|
|
@@ -4,32 +4,31 @@
|
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.boolean = boolean;
|
|
8
|
+
exports.string = string;
|
|
9
|
+
exports.number = number;
|
|
10
|
+
exports.error = error;
|
|
11
|
+
exports.func = func;
|
|
12
|
+
exports.array = array;
|
|
13
|
+
exports.stringArray = stringArray;
|
|
8
14
|
function boolean(value) {
|
|
9
15
|
return value === true || value === false;
|
|
10
16
|
}
|
|
11
|
-
exports.boolean = boolean;
|
|
12
17
|
function string(value) {
|
|
13
18
|
return typeof value === 'string' || value instanceof String;
|
|
14
19
|
}
|
|
15
|
-
exports.string = string;
|
|
16
20
|
function number(value) {
|
|
17
21
|
return typeof value === 'number' || value instanceof Number;
|
|
18
22
|
}
|
|
19
|
-
exports.number = number;
|
|
20
23
|
function error(value) {
|
|
21
24
|
return value instanceof Error;
|
|
22
25
|
}
|
|
23
|
-
exports.error = error;
|
|
24
26
|
function func(value) {
|
|
25
27
|
return typeof value === 'function';
|
|
26
28
|
}
|
|
27
|
-
exports.func = func;
|
|
28
29
|
function array(value) {
|
|
29
30
|
return Array.isArray(value);
|
|
30
31
|
}
|
|
31
|
-
exports.array = array;
|
|
32
32
|
function stringArray(value) {
|
|
33
33
|
return array(value) && value.every(elem => string(elem));
|
|
34
34
|
}
|
|
35
|
-
exports.stringArray = stringArray;
|
|
@@ -6,7 +6,7 @@ export declare namespace Touch {
|
|
|
6
6
|
const AsNew: 2;
|
|
7
7
|
}
|
|
8
8
|
export type Touch = 0 | 1 | 2;
|
|
9
|
-
export declare class LinkedMap<K, V>
|
|
9
|
+
export declare class LinkedMap<K, V> {
|
|
10
10
|
readonly [Symbol.toStringTag] = "LinkedMap";
|
|
11
11
|
private _map;
|
|
12
12
|
private _head;
|
|
@@ -19,6 +19,8 @@ export declare class LinkedMap<K, V> implements Map<K, V> {
|
|
|
19
19
|
get size(): number;
|
|
20
20
|
get first(): V | undefined;
|
|
21
21
|
get last(): V | undefined;
|
|
22
|
+
before(key: K): V | undefined;
|
|
23
|
+
after(key: K): V | undefined;
|
|
22
24
|
has(key: K): boolean;
|
|
23
25
|
get(key: K, touch?: Touch): V | undefined;
|
|
24
26
|
set(key: K, value: V, touch?: Touch): this;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var _a;
|
|
7
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
7
|
exports.LRUCache = exports.LinkedMap = exports.Touch = void 0;
|
|
9
8
|
var Touch;
|
|
@@ -15,8 +14,13 @@ var Touch;
|
|
|
15
14
|
Touch.AsNew = Touch.Last;
|
|
16
15
|
})(Touch || (exports.Touch = Touch = {}));
|
|
17
16
|
class LinkedMap {
|
|
17
|
+
[Symbol.toStringTag] = 'LinkedMap';
|
|
18
|
+
_map;
|
|
19
|
+
_head;
|
|
20
|
+
_tail;
|
|
21
|
+
_size;
|
|
22
|
+
_state;
|
|
18
23
|
constructor() {
|
|
19
|
-
this[_a] = 'LinkedMap';
|
|
20
24
|
this._map = new Map();
|
|
21
25
|
this._head = undefined;
|
|
22
26
|
this._tail = undefined;
|
|
@@ -42,6 +46,14 @@ class LinkedMap {
|
|
|
42
46
|
get last() {
|
|
43
47
|
return this._tail?.value;
|
|
44
48
|
}
|
|
49
|
+
before(key) {
|
|
50
|
+
const item = this._map.get(key);
|
|
51
|
+
return item ? item.previous?.value : undefined;
|
|
52
|
+
}
|
|
53
|
+
after(key) {
|
|
54
|
+
const item = this._map.get(key);
|
|
55
|
+
return item ? item.next?.value : undefined;
|
|
56
|
+
}
|
|
45
57
|
has(key) {
|
|
46
58
|
return this._map.has(key);
|
|
47
59
|
}
|
|
@@ -195,7 +207,7 @@ class LinkedMap {
|
|
|
195
207
|
};
|
|
196
208
|
return iterator;
|
|
197
209
|
}
|
|
198
|
-
[
|
|
210
|
+
[Symbol.iterator]() {
|
|
199
211
|
return this.entries();
|
|
200
212
|
}
|
|
201
213
|
trimOld(newSize) {
|
|
@@ -359,6 +371,8 @@ class LinkedMap {
|
|
|
359
371
|
}
|
|
360
372
|
exports.LinkedMap = LinkedMap;
|
|
361
373
|
class LRUCache extends LinkedMap {
|
|
374
|
+
_limit;
|
|
375
|
+
_ratio;
|
|
362
376
|
constructor(limit, ratio = 1) {
|
|
363
377
|
super();
|
|
364
378
|
this._limit = limit;
|
|
@@ -9,6 +9,9 @@ const CR = 13;
|
|
|
9
9
|
const LF = 10;
|
|
10
10
|
const CRLF = '\r\n';
|
|
11
11
|
class AbstractMessageBuffer {
|
|
12
|
+
_encoding;
|
|
13
|
+
_chunks;
|
|
14
|
+
_totalLength;
|
|
12
15
|
constructor(encoding = 'utf-8') {
|
|
13
16
|
this._encoding = encoding;
|
|
14
17
|
this._chunks = [];
|
|
@@ -33,7 +36,7 @@ class AbstractMessageBuffer {
|
|
|
33
36
|
row: while (chunkIndex < this._chunks.length) {
|
|
34
37
|
const chunk = this._chunks[chunkIndex];
|
|
35
38
|
offset = 0;
|
|
36
|
-
|
|
39
|
+
while (offset < chunk.length) {
|
|
37
40
|
const value = chunk[offset];
|
|
38
41
|
switch (value) {
|
|
39
42
|
case CR:
|
|
@@ -125,7 +128,7 @@ class AbstractMessageBuffer {
|
|
|
125
128
|
}
|
|
126
129
|
const result = this.allocNative(byteCount);
|
|
127
130
|
let resultOffset = 0;
|
|
128
|
-
|
|
131
|
+
const chunkIndex = 0;
|
|
129
132
|
while (byteCount > 0) {
|
|
130
133
|
const chunk = this._chunks[chunkIndex];
|
|
131
134
|
if (chunk.byteLength > byteCount) {
|
|
@@ -3,22 +3,61 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
+
};
|
|
6
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
43
|
exports.ReadableStreamMessageReader = exports.AbstractMessageReader = exports.MessageReader = void 0;
|
|
8
|
-
const ral_1 = require("./ral");
|
|
9
|
-
const Is = require("./is");
|
|
44
|
+
const ral_1 = __importDefault(require("./ral"));
|
|
45
|
+
const Is = __importStar(require("./is"));
|
|
10
46
|
const events_1 = require("./events");
|
|
11
47
|
const semaphore_1 = require("./semaphore");
|
|
12
48
|
var MessageReader;
|
|
13
49
|
(function (MessageReader) {
|
|
14
50
|
function is(value) {
|
|
15
|
-
|
|
51
|
+
const candidate = value;
|
|
16
52
|
return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&
|
|
17
53
|
Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
|
|
18
54
|
}
|
|
19
55
|
MessageReader.is = is;
|
|
20
56
|
})(MessageReader || (exports.MessageReader = MessageReader = {}));
|
|
21
57
|
class AbstractMessageReader {
|
|
58
|
+
errorEmitter;
|
|
59
|
+
closeEmitter;
|
|
60
|
+
partialMessageEmitter;
|
|
22
61
|
constructor() {
|
|
23
62
|
this.errorEmitter = new events_1.Emitter();
|
|
24
63
|
this.closeEmitter = new events_1.Emitter();
|
|
@@ -27,6 +66,7 @@ class AbstractMessageReader {
|
|
|
27
66
|
dispose() {
|
|
28
67
|
this.errorEmitter.dispose();
|
|
29
68
|
this.closeEmitter.dispose();
|
|
69
|
+
this.partialMessageEmitter.dispose();
|
|
30
70
|
}
|
|
31
71
|
get onError() {
|
|
32
72
|
return this.errorEmitter.event;
|
|
@@ -98,6 +138,15 @@ var ResolvedMessageReaderOptions;
|
|
|
98
138
|
ResolvedMessageReaderOptions.fromOptions = fromOptions;
|
|
99
139
|
})(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));
|
|
100
140
|
class ReadableStreamMessageReader extends AbstractMessageReader {
|
|
141
|
+
readable;
|
|
142
|
+
options;
|
|
143
|
+
callback;
|
|
144
|
+
nextMessageLength;
|
|
145
|
+
messageToken;
|
|
146
|
+
buffer;
|
|
147
|
+
partialMessageTimer;
|
|
148
|
+
_partialMessageTimeout;
|
|
149
|
+
readSemaphore;
|
|
101
150
|
constructor(readable, options) {
|
|
102
151
|
super();
|
|
103
152
|
this.readable = readable;
|
|
@@ -3,10 +3,46 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
+
};
|
|
6
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
43
|
exports.WriteableStreamMessageWriter = exports.AbstractMessageWriter = exports.MessageWriter = void 0;
|
|
8
|
-
const ral_1 = require("./ral");
|
|
9
|
-
const Is = require("./is");
|
|
44
|
+
const ral_1 = __importDefault(require("./ral"));
|
|
45
|
+
const Is = __importStar(require("./is"));
|
|
10
46
|
const semaphore_1 = require("./semaphore");
|
|
11
47
|
const events_1 = require("./events");
|
|
12
48
|
const ContentLength = 'Content-Length: ';
|
|
@@ -14,13 +50,15 @@ const CRLF = '\r\n';
|
|
|
14
50
|
var MessageWriter;
|
|
15
51
|
(function (MessageWriter) {
|
|
16
52
|
function is(value) {
|
|
17
|
-
|
|
53
|
+
const candidate = value;
|
|
18
54
|
return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&
|
|
19
55
|
Is.func(candidate.onError) && Is.func(candidate.write);
|
|
20
56
|
}
|
|
21
57
|
MessageWriter.is = is;
|
|
22
58
|
})(MessageWriter || (exports.MessageWriter = MessageWriter = {}));
|
|
23
59
|
class AbstractMessageWriter {
|
|
60
|
+
errorEmitter;
|
|
61
|
+
closeEmitter;
|
|
24
62
|
constructor() {
|
|
25
63
|
this.errorEmitter = new events_1.Emitter();
|
|
26
64
|
this.closeEmitter = new events_1.Emitter();
|
|
@@ -64,6 +102,10 @@ var ResolvedMessageWriterOptions;
|
|
|
64
102
|
ResolvedMessageWriterOptions.fromOptions = fromOptions;
|
|
65
103
|
})(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));
|
|
66
104
|
class WriteableStreamMessageWriter extends AbstractMessageWriter {
|
|
105
|
+
writable;
|
|
106
|
+
options;
|
|
107
|
+
errorCount;
|
|
108
|
+
writeSemaphore;
|
|
67
109
|
constructor(writable, options) {
|
|
68
110
|
super();
|
|
69
111
|
this.writable = writable;
|
|
@@ -3,9 +3,42 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
6
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
40
|
exports.Message = exports.NotificationType9 = exports.NotificationType8 = exports.NotificationType7 = exports.NotificationType6 = exports.NotificationType5 = exports.NotificationType4 = exports.NotificationType3 = exports.NotificationType2 = exports.NotificationType1 = exports.NotificationType0 = exports.NotificationType = exports.RequestType9 = exports.RequestType8 = exports.RequestType7 = exports.RequestType6 = exports.RequestType5 = exports.RequestType4 = exports.RequestType3 = exports.RequestType2 = exports.RequestType1 = exports.RequestType = exports.RequestType0 = exports.AbstractMessageSignature = exports.ParameterStructures = exports.ResponseError = exports.ErrorCodes = void 0;
|
|
8
|
-
const is = require("./is");
|
|
41
|
+
const is = __importStar(require("./is"));
|
|
9
42
|
/**
|
|
10
43
|
* Predefined error codes.
|
|
11
44
|
*/
|
|
@@ -67,6 +100,8 @@ var ErrorCodes;
|
|
|
67
100
|
* has failed.
|
|
68
101
|
*/
|
|
69
102
|
class ResponseError extends Error {
|
|
103
|
+
code;
|
|
104
|
+
data;
|
|
70
105
|
constructor(code, message, data) {
|
|
71
106
|
super(message);
|
|
72
107
|
this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
|
|
@@ -86,6 +121,23 @@ class ResponseError extends Error {
|
|
|
86
121
|
}
|
|
87
122
|
exports.ResponseError = ResponseError;
|
|
88
123
|
class ParameterStructures {
|
|
124
|
+
kind;
|
|
125
|
+
/**
|
|
126
|
+
* The parameter structure is automatically inferred on the number of parameters
|
|
127
|
+
* and the parameter type in case of a single param.
|
|
128
|
+
*/
|
|
129
|
+
static auto = new ParameterStructures('auto');
|
|
130
|
+
/**
|
|
131
|
+
* Forces `byPosition` parameter structure. This is useful if you have a single
|
|
132
|
+
* parameter which has a literal type.
|
|
133
|
+
*/
|
|
134
|
+
static byPosition = new ParameterStructures('byPosition');
|
|
135
|
+
/**
|
|
136
|
+
* Forces `byName` parameter structure. This is only useful when having a single
|
|
137
|
+
* parameter. The library will report errors if used with a different number of
|
|
138
|
+
* parameters.
|
|
139
|
+
*/
|
|
140
|
+
static byName = new ParameterStructures('byName');
|
|
89
141
|
constructor(kind) {
|
|
90
142
|
this.kind = kind;
|
|
91
143
|
}
|
|
@@ -97,26 +149,12 @@ class ParameterStructures {
|
|
|
97
149
|
}
|
|
98
150
|
}
|
|
99
151
|
exports.ParameterStructures = ParameterStructures;
|
|
100
|
-
/**
|
|
101
|
-
* The parameter structure is automatically inferred on the number of parameters
|
|
102
|
-
* and the parameter type in case of a single param.
|
|
103
|
-
*/
|
|
104
|
-
ParameterStructures.auto = new ParameterStructures('auto');
|
|
105
|
-
/**
|
|
106
|
-
* Forces `byPosition` parameter structure. This is useful if you have a single
|
|
107
|
-
* parameter which has a literal type.
|
|
108
|
-
*/
|
|
109
|
-
ParameterStructures.byPosition = new ParameterStructures('byPosition');
|
|
110
|
-
/**
|
|
111
|
-
* Forces `byName` parameter structure. This is only useful when having a single
|
|
112
|
-
* parameter. The library will report errors if used with a different number of
|
|
113
|
-
* parameters.
|
|
114
|
-
*/
|
|
115
|
-
ParameterStructures.byName = new ParameterStructures('byName');
|
|
116
152
|
/**
|
|
117
153
|
* An abstract implementation of a MessageType.
|
|
118
154
|
*/
|
|
119
155
|
class AbstractMessageSignature {
|
|
156
|
+
method;
|
|
157
|
+
numberOfParams;
|
|
120
158
|
constructor(method, numberOfParams) {
|
|
121
159
|
this.method = method;
|
|
122
160
|
this.numberOfParams = numberOfParams;
|
|
@@ -130,12 +168,21 @@ exports.AbstractMessageSignature = AbstractMessageSignature;
|
|
|
130
168
|
* Classes to type request response pairs
|
|
131
169
|
*/
|
|
132
170
|
class RequestType0 extends AbstractMessageSignature {
|
|
171
|
+
/**
|
|
172
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
173
|
+
*/
|
|
174
|
+
_;
|
|
133
175
|
constructor(method) {
|
|
134
176
|
super(method, 0);
|
|
135
177
|
}
|
|
136
178
|
}
|
|
137
179
|
exports.RequestType0 = RequestType0;
|
|
138
180
|
class RequestType extends AbstractMessageSignature {
|
|
181
|
+
_parameterStructures;
|
|
182
|
+
/**
|
|
183
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
184
|
+
*/
|
|
185
|
+
_;
|
|
139
186
|
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
140
187
|
super(method, 1);
|
|
141
188
|
this._parameterStructures = _parameterStructures;
|
|
@@ -146,6 +193,11 @@ class RequestType extends AbstractMessageSignature {
|
|
|
146
193
|
}
|
|
147
194
|
exports.RequestType = RequestType;
|
|
148
195
|
class RequestType1 extends AbstractMessageSignature {
|
|
196
|
+
_parameterStructures;
|
|
197
|
+
/**
|
|
198
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
199
|
+
*/
|
|
200
|
+
_;
|
|
149
201
|
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
150
202
|
super(method, 1);
|
|
151
203
|
this._parameterStructures = _parameterStructures;
|
|
@@ -156,54 +208,91 @@ class RequestType1 extends AbstractMessageSignature {
|
|
|
156
208
|
}
|
|
157
209
|
exports.RequestType1 = RequestType1;
|
|
158
210
|
class RequestType2 extends AbstractMessageSignature {
|
|
211
|
+
/**
|
|
212
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
213
|
+
*/
|
|
214
|
+
_;
|
|
159
215
|
constructor(method) {
|
|
160
216
|
super(method, 2);
|
|
161
217
|
}
|
|
162
218
|
}
|
|
163
219
|
exports.RequestType2 = RequestType2;
|
|
164
220
|
class RequestType3 extends AbstractMessageSignature {
|
|
221
|
+
/**
|
|
222
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
223
|
+
*/
|
|
224
|
+
_;
|
|
165
225
|
constructor(method) {
|
|
166
226
|
super(method, 3);
|
|
167
227
|
}
|
|
168
228
|
}
|
|
169
229
|
exports.RequestType3 = RequestType3;
|
|
170
230
|
class RequestType4 extends AbstractMessageSignature {
|
|
231
|
+
/**
|
|
232
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
233
|
+
*/
|
|
234
|
+
_;
|
|
171
235
|
constructor(method) {
|
|
172
236
|
super(method, 4);
|
|
173
237
|
}
|
|
174
238
|
}
|
|
175
239
|
exports.RequestType4 = RequestType4;
|
|
176
240
|
class RequestType5 extends AbstractMessageSignature {
|
|
241
|
+
/**
|
|
242
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
243
|
+
*/
|
|
244
|
+
_;
|
|
177
245
|
constructor(method) {
|
|
178
246
|
super(method, 5);
|
|
179
247
|
}
|
|
180
248
|
}
|
|
181
249
|
exports.RequestType5 = RequestType5;
|
|
182
250
|
class RequestType6 extends AbstractMessageSignature {
|
|
251
|
+
/**
|
|
252
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
253
|
+
*/
|
|
254
|
+
_;
|
|
183
255
|
constructor(method) {
|
|
184
256
|
super(method, 6);
|
|
185
257
|
}
|
|
186
258
|
}
|
|
187
259
|
exports.RequestType6 = RequestType6;
|
|
188
260
|
class RequestType7 extends AbstractMessageSignature {
|
|
261
|
+
/**
|
|
262
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
263
|
+
*/
|
|
264
|
+
_;
|
|
189
265
|
constructor(method) {
|
|
190
266
|
super(method, 7);
|
|
191
267
|
}
|
|
192
268
|
}
|
|
193
269
|
exports.RequestType7 = RequestType7;
|
|
194
270
|
class RequestType8 extends AbstractMessageSignature {
|
|
271
|
+
/**
|
|
272
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
273
|
+
*/
|
|
274
|
+
_;
|
|
195
275
|
constructor(method) {
|
|
196
276
|
super(method, 8);
|
|
197
277
|
}
|
|
198
278
|
}
|
|
199
279
|
exports.RequestType8 = RequestType8;
|
|
200
280
|
class RequestType9 extends AbstractMessageSignature {
|
|
281
|
+
/**
|
|
282
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
283
|
+
*/
|
|
284
|
+
_;
|
|
201
285
|
constructor(method) {
|
|
202
286
|
super(method, 9);
|
|
203
287
|
}
|
|
204
288
|
}
|
|
205
289
|
exports.RequestType9 = RequestType9;
|
|
206
290
|
class NotificationType extends AbstractMessageSignature {
|
|
291
|
+
_parameterStructures;
|
|
292
|
+
/**
|
|
293
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
294
|
+
*/
|
|
295
|
+
_;
|
|
207
296
|
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
208
297
|
super(method, 1);
|
|
209
298
|
this._parameterStructures = _parameterStructures;
|
|
@@ -214,12 +303,21 @@ class NotificationType extends AbstractMessageSignature {
|
|
|
214
303
|
}
|
|
215
304
|
exports.NotificationType = NotificationType;
|
|
216
305
|
class NotificationType0 extends AbstractMessageSignature {
|
|
306
|
+
/**
|
|
307
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
308
|
+
*/
|
|
309
|
+
_;
|
|
217
310
|
constructor(method) {
|
|
218
311
|
super(method, 0);
|
|
219
312
|
}
|
|
220
313
|
}
|
|
221
314
|
exports.NotificationType0 = NotificationType0;
|
|
222
315
|
class NotificationType1 extends AbstractMessageSignature {
|
|
316
|
+
_parameterStructures;
|
|
317
|
+
/**
|
|
318
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
319
|
+
*/
|
|
320
|
+
_;
|
|
223
321
|
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
224
322
|
super(method, 1);
|
|
225
323
|
this._parameterStructures = _parameterStructures;
|
|
@@ -230,48 +328,80 @@ class NotificationType1 extends AbstractMessageSignature {
|
|
|
230
328
|
}
|
|
231
329
|
exports.NotificationType1 = NotificationType1;
|
|
232
330
|
class NotificationType2 extends AbstractMessageSignature {
|
|
331
|
+
/**
|
|
332
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
333
|
+
*/
|
|
334
|
+
_;
|
|
233
335
|
constructor(method) {
|
|
234
336
|
super(method, 2);
|
|
235
337
|
}
|
|
236
338
|
}
|
|
237
339
|
exports.NotificationType2 = NotificationType2;
|
|
238
340
|
class NotificationType3 extends AbstractMessageSignature {
|
|
341
|
+
/**
|
|
342
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
343
|
+
*/
|
|
344
|
+
_;
|
|
239
345
|
constructor(method) {
|
|
240
346
|
super(method, 3);
|
|
241
347
|
}
|
|
242
348
|
}
|
|
243
349
|
exports.NotificationType3 = NotificationType3;
|
|
244
350
|
class NotificationType4 extends AbstractMessageSignature {
|
|
351
|
+
/**
|
|
352
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
353
|
+
*/
|
|
354
|
+
_;
|
|
245
355
|
constructor(method) {
|
|
246
356
|
super(method, 4);
|
|
247
357
|
}
|
|
248
358
|
}
|
|
249
359
|
exports.NotificationType4 = NotificationType4;
|
|
250
360
|
class NotificationType5 extends AbstractMessageSignature {
|
|
361
|
+
/**
|
|
362
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
363
|
+
*/
|
|
364
|
+
_;
|
|
251
365
|
constructor(method) {
|
|
252
366
|
super(method, 5);
|
|
253
367
|
}
|
|
254
368
|
}
|
|
255
369
|
exports.NotificationType5 = NotificationType5;
|
|
256
370
|
class NotificationType6 extends AbstractMessageSignature {
|
|
371
|
+
/**
|
|
372
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
373
|
+
*/
|
|
374
|
+
_;
|
|
257
375
|
constructor(method) {
|
|
258
376
|
super(method, 6);
|
|
259
377
|
}
|
|
260
378
|
}
|
|
261
379
|
exports.NotificationType6 = NotificationType6;
|
|
262
380
|
class NotificationType7 extends AbstractMessageSignature {
|
|
381
|
+
/**
|
|
382
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
383
|
+
*/
|
|
384
|
+
_;
|
|
263
385
|
constructor(method) {
|
|
264
386
|
super(method, 7);
|
|
265
387
|
}
|
|
266
388
|
}
|
|
267
389
|
exports.NotificationType7 = NotificationType7;
|
|
268
390
|
class NotificationType8 extends AbstractMessageSignature {
|
|
391
|
+
/**
|
|
392
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
393
|
+
*/
|
|
394
|
+
_;
|
|
269
395
|
constructor(method) {
|
|
270
396
|
super(method, 8);
|
|
271
397
|
}
|
|
272
398
|
}
|
|
273
399
|
exports.NotificationType8 = NotificationType8;
|
|
274
400
|
class NotificationType9 extends AbstractMessageSignature {
|
|
401
|
+
/**
|
|
402
|
+
* Clients must not use this property. It is here to ensure correct typing.
|
|
403
|
+
*/
|
|
404
|
+
_;
|
|
275
405
|
constructor(method) {
|
|
276
406
|
super(method, 9);
|
|
277
407
|
}
|