node-ts 7.0.1 → 8.0.0
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/lib/index.js +1 -17
- package/lib/node-ts.d.ts +4 -2
- package/lib/node-ts.js +71 -103
- package/lib/queryStrings.js +2 -6
- package/package.json +3 -3
- package/.github/FUNDING.yml +0 -1
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/CD.yml +0 -34
- package/.github/workflows/CI.yml +0 -27
- package/lib/types.d.ts +0 -4
- package/lib/types.js +0 -5
package/lib/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./node-ts"), exports);
|
|
1
|
+
export * from "./node-ts";
|
package/lib/node-ts.d.ts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* @autor Niklas Mollenhauer <holzig@outlook.com>
|
|
3
3
|
* @autor Tim Kluge <timklge@wh2.tu-dresden.de>
|
|
4
4
|
*/
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
|
|
5
|
+
import { EventEmitter } from "node:events";
|
|
6
|
+
/** Represents a Key-Value object. */
|
|
7
|
+
type MapLike<T> = Record<string, T>;
|
|
7
8
|
/**
|
|
8
9
|
* Client that can be used to connect to a TeamSpeak server query API.
|
|
9
10
|
*/
|
|
@@ -1188,3 +1189,4 @@ export declare enum TokenType {
|
|
|
1188
1189
|
*/
|
|
1189
1190
|
CHANNEL_GROUP = 1
|
|
1190
1191
|
}
|
|
1192
|
+
export {};
|
package/lib/node-ts.js
CHANGED
|
@@ -2,34 +2,22 @@
|
|
|
2
2
|
* @autor Niklas Mollenhauer <holzig@outlook.com>
|
|
3
3
|
* @autor Tim Kluge <timklge@wh2.tu-dresden.de>
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
16
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
17
|
-
var m = o[Symbol.asyncIterator], i;
|
|
18
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
19
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
20
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.TokenType = exports.PermissionGroupTypes = exports.PermissionGroupDatabaseTypes = exports.ReasonIdentifier = exports.LogLevel = exports.TextMessageTargetMode = exports.CodecEncryptionMode = exports.Codec = exports.HostBannerMode = exports.HostMessageMode = exports.YesNo = exports.TeamSpeakClient = void 0;
|
|
24
|
-
const net = require("net");
|
|
25
|
-
const events_1 = require("events");
|
|
26
|
-
const util_1 = require("util");
|
|
27
|
-
const stringio_1 = require("@rauschma/stringio");
|
|
28
|
-
const queryStrings_1 = require("./queryStrings");
|
|
5
|
+
import * as net from "node:net";
|
|
6
|
+
import { EventEmitter } from "node:events";
|
|
7
|
+
import { chunksToLinesAsync, chomp } from "@rauschma/stringio";
|
|
8
|
+
import { escape, unescape } from "./queryStrings.js";
|
|
29
9
|
/**
|
|
30
10
|
* Client that can be used to connect to a TeamSpeak server query API.
|
|
31
11
|
*/
|
|
32
|
-
class TeamSpeakClient extends
|
|
12
|
+
export class TeamSpeakClient extends EventEmitter {
|
|
13
|
+
host;
|
|
14
|
+
port;
|
|
15
|
+
queue = [];
|
|
16
|
+
_executing;
|
|
17
|
+
socket;
|
|
18
|
+
isConnected = false;
|
|
19
|
+
static DefaultHost = "localhost";
|
|
20
|
+
static DefaultPort = 10011;
|
|
33
21
|
/**
|
|
34
22
|
* Creates a new instance of TeamSpeakClient for a specific remote host:port.
|
|
35
23
|
* @param {string = TeamSpeakClient.DefaultHost} host Remote host of the TeamSpeak server. Can be an IP address or a host name.
|
|
@@ -40,8 +28,6 @@ class TeamSpeakClient extends events_1.EventEmitter {
|
|
|
40
28
|
super();
|
|
41
29
|
this.host = host;
|
|
42
30
|
this.port = port;
|
|
43
|
-
this.queue = [];
|
|
44
|
-
this.isConnected = false;
|
|
45
31
|
}
|
|
46
32
|
connect() {
|
|
47
33
|
this.isConnected = false;
|
|
@@ -59,49 +45,34 @@ class TeamSpeakClient extends events_1.EventEmitter {
|
|
|
59
45
|
/**
|
|
60
46
|
* Gets called on an opened connection
|
|
61
47
|
*/
|
|
62
|
-
onConnect(connectionEstablished, error) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
switch (lineCounter) {
|
|
77
|
-
case 1: {
|
|
78
|
-
if (line !== "TS3") {
|
|
79
|
-
this.isConnected = false;
|
|
80
|
-
error(new Error("Remove server is not a TS3 Query Server endpoint."));
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
case 2:
|
|
86
|
-
// We have read a second non-empty line, so we are ready to take commands
|
|
87
|
-
this.isConnected = true;
|
|
88
|
-
connectionEstablished();
|
|
89
|
-
continue; // Welcome message, followed by empty line (which is skipped)
|
|
90
|
-
default: {
|
|
91
|
-
this.handleSingleLine(line);
|
|
92
|
-
this.checkQueue();
|
|
93
|
-
}
|
|
48
|
+
async onConnect(connectionEstablished, error) {
|
|
49
|
+
const lineGenerator = chunksToLinesAsync(this.socket);
|
|
50
|
+
let lineCounter = 0;
|
|
51
|
+
for await (const lineWithNewLine of lineGenerator) {
|
|
52
|
+
const line = chomp(lineWithNewLine).trim();
|
|
53
|
+
if (line === "")
|
|
54
|
+
continue;
|
|
55
|
+
++lineCounter;
|
|
56
|
+
switch (lineCounter) {
|
|
57
|
+
case 1: {
|
|
58
|
+
if (line !== "TS3") {
|
|
59
|
+
this.isConnected = false;
|
|
60
|
+
error(new Error("Remove server is not a TS3 Query Server endpoint."));
|
|
61
|
+
return;
|
|
94
62
|
}
|
|
63
|
+
continue;
|
|
95
64
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
65
|
+
case 2:
|
|
66
|
+
// We have read a second non-empty line, so we are ready to take commands
|
|
67
|
+
this.isConnected = true;
|
|
68
|
+
connectionEstablished();
|
|
69
|
+
continue; // Welcome message, followed by empty line (which is skipped)
|
|
70
|
+
default: {
|
|
71
|
+
this.handleSingleLine(line);
|
|
72
|
+
this.checkQueue();
|
|
101
73
|
}
|
|
102
|
-
finally { if (e_1) throw e_1.error; }
|
|
103
74
|
}
|
|
104
|
-
}
|
|
75
|
+
}
|
|
105
76
|
}
|
|
106
77
|
handleSingleLine(line) {
|
|
107
78
|
// Server answers with:
|
|
@@ -158,22 +129,22 @@ class TeamSpeakClient extends events_1.EventEmitter {
|
|
|
158
129
|
return Promise.reject(new Error("Empty command"));
|
|
159
130
|
if (!this.isConnected)
|
|
160
131
|
return Promise.reject(new Error("Not connected to any server. Call \"connect()\" before sending anything."));
|
|
161
|
-
let tosend =
|
|
132
|
+
let tosend = escape(cmd);
|
|
162
133
|
for (const v of options)
|
|
163
|
-
tosend +=
|
|
134
|
+
tosend += ` -${escape(v)}`;
|
|
164
135
|
for (const key in params) {
|
|
165
136
|
if (!params.hasOwnProperty(key))
|
|
166
137
|
continue;
|
|
167
138
|
const value = params[key];
|
|
168
|
-
if (!
|
|
169
|
-
tosend +=
|
|
139
|
+
if (!Array.isArray(value)) {
|
|
140
|
+
tosend += ` ${escape(key.toString())}=${escape(value.toString())}`;
|
|
170
141
|
}
|
|
171
142
|
}
|
|
172
143
|
// Handle multiple arrays correctly
|
|
173
144
|
// Get all array in the params
|
|
174
145
|
const arrayParamKeys = [];
|
|
175
146
|
for (const key in params) {
|
|
176
|
-
if (params.hasOwnProperty(key) &&
|
|
147
|
+
if (params.hasOwnProperty(key) && Array.isArray(params[key]))
|
|
177
148
|
arrayParamKeys.push(key);
|
|
178
149
|
}
|
|
179
150
|
if (arrayParamKeys.length > 0) {
|
|
@@ -181,13 +152,13 @@ class TeamSpeakClient extends events_1.EventEmitter {
|
|
|
181
152
|
const firstArray = params[arrayParamKeys[0]];
|
|
182
153
|
for (let i = 0; i < firstArray.length; ++i) {
|
|
183
154
|
let segment = "";
|
|
184
|
-
for (
|
|
185
|
-
segment +=
|
|
155
|
+
for (const key of arrayParamKeys) {
|
|
156
|
+
segment += `${escape(key)}=${escape(params[key][i])} `;
|
|
186
157
|
}
|
|
187
|
-
escapedSegments += segment.slice(0, -1)
|
|
158
|
+
escapedSegments += `${segment.slice(0, -1)}|`;
|
|
188
159
|
}
|
|
189
160
|
if (escapedSegments.length > 0)
|
|
190
|
-
tosend +=
|
|
161
|
+
tosend += ` ${escapedSegments.slice(0, -1)}`;
|
|
191
162
|
}
|
|
192
163
|
return new Promise((resolve, reject) => {
|
|
193
164
|
this.queue.push({
|
|
@@ -237,9 +208,9 @@ class TeamSpeakClient extends events_1.EventEmitter {
|
|
|
237
208
|
thisrec[v] = "";
|
|
238
209
|
continue;
|
|
239
210
|
}
|
|
240
|
-
const key =
|
|
241
|
-
const value =
|
|
242
|
-
thisrec[key] = (parseInt(value, 10).toString() == value) ? parseInt(value, 10) : value;
|
|
211
|
+
const key = unescape(v.substr(0, v.indexOf("=")));
|
|
212
|
+
const value = unescape(v.substr(v.indexOf("=") + 1));
|
|
213
|
+
thisrec[key] = (Number.parseInt(value, 10).toString() == value) ? Number.parseInt(value, 10) : value;
|
|
243
214
|
}
|
|
244
215
|
return thisrec;
|
|
245
216
|
});
|
|
@@ -292,20 +263,17 @@ class TeamSpeakClient extends events_1.EventEmitter {
|
|
|
292
263
|
return this.setTimeout(0);
|
|
293
264
|
}
|
|
294
265
|
}
|
|
295
|
-
exports.TeamSpeakClient = TeamSpeakClient;
|
|
296
|
-
TeamSpeakClient.DefaultHost = "localhost";
|
|
297
|
-
TeamSpeakClient.DefaultPort = 10011;
|
|
298
266
|
/*
|
|
299
267
|
|
|
300
268
|
Enums imported from documentation.
|
|
301
269
|
|
|
302
270
|
*/
|
|
303
|
-
var YesNo;
|
|
271
|
+
export var YesNo;
|
|
304
272
|
(function (YesNo) {
|
|
305
273
|
YesNo[YesNo["No"] = 0] = "No";
|
|
306
274
|
YesNo[YesNo["Yes"] = 1] = "Yes";
|
|
307
|
-
})(YesNo || (
|
|
308
|
-
var HostMessageMode;
|
|
275
|
+
})(YesNo || (YesNo = {}));
|
|
276
|
+
export var HostMessageMode;
|
|
309
277
|
(function (HostMessageMode) {
|
|
310
278
|
/**
|
|
311
279
|
* 1: display message in chatlog
|
|
@@ -319,8 +287,8 @@ var HostMessageMode;
|
|
|
319
287
|
* 3: display message in modal dialog and close connection
|
|
320
288
|
*/
|
|
321
289
|
HostMessageMode[HostMessageMode["MODALQUIT"] = 3] = "MODALQUIT";
|
|
322
|
-
})(HostMessageMode || (
|
|
323
|
-
var HostBannerMode;
|
|
290
|
+
})(HostMessageMode || (HostMessageMode = {}));
|
|
291
|
+
export var HostBannerMode;
|
|
324
292
|
(function (HostBannerMode) {
|
|
325
293
|
/**
|
|
326
294
|
* 0: do not adjust
|
|
@@ -334,8 +302,8 @@ var HostBannerMode;
|
|
|
334
302
|
* 2: adjust and keep aspect ratio
|
|
335
303
|
*/
|
|
336
304
|
HostBannerMode[HostBannerMode["KEEPASPECT"] = 2] = "KEEPASPECT";
|
|
337
|
-
})(HostBannerMode || (
|
|
338
|
-
var Codec;
|
|
305
|
+
})(HostBannerMode || (HostBannerMode = {}));
|
|
306
|
+
export var Codec;
|
|
339
307
|
(function (Codec) {
|
|
340
308
|
/**
|
|
341
309
|
* 0: speex narrowband (mono, 16bit, 8kHz)
|
|
@@ -353,8 +321,8 @@ var Codec;
|
|
|
353
321
|
* 3: celt mono (mono, 16bit, 48kHz)
|
|
354
322
|
*/
|
|
355
323
|
Codec[Codec["CELT_MONO"] = 3] = "CELT_MONO";
|
|
356
|
-
})(Codec || (
|
|
357
|
-
var CodecEncryptionMode;
|
|
324
|
+
})(Codec || (Codec = {}));
|
|
325
|
+
export var CodecEncryptionMode;
|
|
358
326
|
(function (CodecEncryptionMode) {
|
|
359
327
|
/**
|
|
360
328
|
* 0: configure per channel
|
|
@@ -368,8 +336,8 @@ var CodecEncryptionMode;
|
|
|
368
336
|
* 2: globally enabled
|
|
369
337
|
*/
|
|
370
338
|
CodecEncryptionMode[CodecEncryptionMode["ENABLED"] = 2] = "ENABLED";
|
|
371
|
-
})(CodecEncryptionMode || (
|
|
372
|
-
var TextMessageTargetMode;
|
|
339
|
+
})(CodecEncryptionMode || (CodecEncryptionMode = {}));
|
|
340
|
+
export var TextMessageTargetMode;
|
|
373
341
|
(function (TextMessageTargetMode) {
|
|
374
342
|
/**
|
|
375
343
|
* 1: target is a client
|
|
@@ -383,8 +351,8 @@ var TextMessageTargetMode;
|
|
|
383
351
|
* 3: target is a virtual server
|
|
384
352
|
*/
|
|
385
353
|
TextMessageTargetMode[TextMessageTargetMode["SERVER"] = 3] = "SERVER";
|
|
386
|
-
})(TextMessageTargetMode || (
|
|
387
|
-
var LogLevel;
|
|
354
|
+
})(TextMessageTargetMode || (TextMessageTargetMode = {}));
|
|
355
|
+
export var LogLevel;
|
|
388
356
|
(function (LogLevel) {
|
|
389
357
|
/**
|
|
390
358
|
* 1: everything that is really bad
|
|
@@ -402,8 +370,8 @@ var LogLevel;
|
|
|
402
370
|
* 4: informational output
|
|
403
371
|
*/
|
|
404
372
|
LogLevel[LogLevel["INFO"] = 4] = "INFO";
|
|
405
|
-
})(LogLevel || (
|
|
406
|
-
var ReasonIdentifier;
|
|
373
|
+
})(LogLevel || (LogLevel = {}));
|
|
374
|
+
export var ReasonIdentifier;
|
|
407
375
|
(function (ReasonIdentifier) {
|
|
408
376
|
/**
|
|
409
377
|
* 4: kick client from channel
|
|
@@ -413,8 +381,8 @@ var ReasonIdentifier;
|
|
|
413
381
|
* 5: kick client from server
|
|
414
382
|
*/
|
|
415
383
|
ReasonIdentifier[ReasonIdentifier["SERVER"] = 5] = "SERVER";
|
|
416
|
-
})(ReasonIdentifier || (
|
|
417
|
-
var PermissionGroupDatabaseTypes;
|
|
384
|
+
})(ReasonIdentifier || (ReasonIdentifier = {}));
|
|
385
|
+
export var PermissionGroupDatabaseTypes;
|
|
418
386
|
(function (PermissionGroupDatabaseTypes) {
|
|
419
387
|
/**
|
|
420
388
|
* 0: template group (used for new virtual servers)
|
|
@@ -428,8 +396,8 @@ var PermissionGroupDatabaseTypes;
|
|
|
428
396
|
* 2: global query group (used for ServerQuery clients)
|
|
429
397
|
*/
|
|
430
398
|
PermissionGroupDatabaseTypes[PermissionGroupDatabaseTypes["QUERY"] = 2] = "QUERY";
|
|
431
|
-
})(PermissionGroupDatabaseTypes || (
|
|
432
|
-
var PermissionGroupTypes;
|
|
399
|
+
})(PermissionGroupDatabaseTypes || (PermissionGroupDatabaseTypes = {}));
|
|
400
|
+
export var PermissionGroupTypes;
|
|
433
401
|
(function (PermissionGroupTypes) {
|
|
434
402
|
/**
|
|
435
403
|
* 0: server group permission
|
|
@@ -451,8 +419,8 @@ var PermissionGroupTypes;
|
|
|
451
419
|
* 4: channel-client specific permission
|
|
452
420
|
*/
|
|
453
421
|
PermissionGroupTypes[PermissionGroupTypes["CHANNEL_CLIENT"] = 4] = "CHANNEL_CLIENT";
|
|
454
|
-
})(PermissionGroupTypes || (
|
|
455
|
-
var TokenType;
|
|
422
|
+
})(PermissionGroupTypes || (PermissionGroupTypes = {}));
|
|
423
|
+
export var TokenType;
|
|
456
424
|
(function (TokenType) {
|
|
457
425
|
/**
|
|
458
426
|
* 0: server group token (id1={groupID} id2=0)
|
|
@@ -462,4 +430,4 @@ var TokenType;
|
|
|
462
430
|
* 1: channel group token (id1={groupID} id2={channelID})
|
|
463
431
|
*/
|
|
464
432
|
TokenType[TokenType["CHANNEL_GROUP"] = 1] = "CHANNEL_GROUP";
|
|
465
|
-
})(TokenType || (
|
|
433
|
+
})(TokenType || (TokenType = {}));
|
package/lib/queryStrings.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escape = escape;
|
|
4
|
-
exports.unescape = unescape;
|
|
5
1
|
/**
|
|
6
2
|
* Escapes a string so it can be safely used for querying the api.
|
|
7
3
|
* @param {string} s The string to escape.
|
|
8
4
|
* @return {string} An escaped string.
|
|
9
5
|
*/
|
|
10
|
-
function escape(s) {
|
|
6
|
+
export function escape(s) {
|
|
11
7
|
let r = String(s);
|
|
12
8
|
r = r.replace(/\\/g, "\\\\"); // Backslash
|
|
13
9
|
r = r.replace(/\//g, "\\/"); // Slash
|
|
@@ -25,7 +21,7 @@ function escape(s) {
|
|
|
25
21
|
* @param {string} s The string to unescape.
|
|
26
22
|
* @return {string} An unescaped string.
|
|
27
23
|
*/
|
|
28
|
-
function unescape(s) {
|
|
24
|
+
export function unescape(s) {
|
|
29
25
|
let r = String(s);
|
|
30
26
|
r = r.replace(/\\s/g, " "); // Whitespace
|
|
31
27
|
r = r.replace(/\\p/g, "|"); // Pipe
|
package/package.json
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
"author": "Niklas Mollenhauer <nikeee@outlook.com>",
|
|
3
3
|
"name": "node-ts",
|
|
4
4
|
"description": "TeamSpeak® 3 Server Query client for node.js implemented using TypeScript",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "8.0.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git://github.com/nikeee/node-ts.git"
|
|
9
9
|
},
|
|
10
10
|
"main": "lib/index.js",
|
|
11
|
+
"type": "module",
|
|
11
12
|
"types": "lib/index.d.ts",
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@rauschma/stringio": "^1.4.0",
|
|
@@ -34,6 +35,5 @@
|
|
|
34
35
|
"engines": {
|
|
35
36
|
"node": ">=22.0.0"
|
|
36
37
|
},
|
|
37
|
-
"license": "LGPL-3.0"
|
|
38
|
-
"readmeFilename": "README.md"
|
|
38
|
+
"license": "LGPL-3.0"
|
|
39
39
|
}
|
package/.github/FUNDING.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
github: nikeee
|
package/.github/dependabot.yml
DELETED
package/.github/workflows/CD.yml
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
name: CD
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- "!*"
|
|
7
|
-
tags:
|
|
8
|
-
- "v*"
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
|
|
14
|
-
permissions:
|
|
15
|
-
contents: read
|
|
16
|
-
id-token: write
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v4
|
|
20
|
-
|
|
21
|
-
- uses: actions/setup-node@v4
|
|
22
|
-
with:
|
|
23
|
-
node-version: 23
|
|
24
|
-
cache: npm
|
|
25
|
-
registry-url: https://registry.npmjs.org
|
|
26
|
-
|
|
27
|
-
- run: npm ci
|
|
28
|
-
- run: npm run compile
|
|
29
|
-
- run: npm test
|
|
30
|
-
env:
|
|
31
|
-
CI: true
|
|
32
|
-
- run: npm publish --provenance --access public
|
|
33
|
-
env:
|
|
34
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.github/workflows/CI.yml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
name: Node.js CI
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
|
|
10
|
-
strategy:
|
|
11
|
-
matrix:
|
|
12
|
-
node-version: [20.x, 22.x, 23.x]
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
18
|
-
uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: ${{ matrix.node-version }}
|
|
21
|
-
cache: npm
|
|
22
|
-
|
|
23
|
-
- run: npm ci
|
|
24
|
-
- run: npm run compile
|
|
25
|
-
- run: npm test
|
|
26
|
-
env:
|
|
27
|
-
CI: true
|
package/lib/types.d.ts
DELETED