@tak-ps/node-tak 11.26.0 → 11.26.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/CHANGELOG.md +8 -0
- package/dist/lib/api/client.d.ts +27 -2
- package/dist/lib/api/client.js +27 -3
- package/dist/lib/api/client.js.map +1 -1
- package/lib/api/client.ts +29 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
## Version History
|
|
12
12
|
|
|
13
|
+
### v11.26.2 - 2025-02-05
|
|
14
|
+
|
|
15
|
+
- :bug: Wrap return type of Client list in TAKList object
|
|
16
|
+
|
|
17
|
+
### v11.26.1 - 2025-02-05
|
|
18
|
+
|
|
19
|
+
- :rocket: Allow specifying Client Endpoint List query parameters
|
|
20
|
+
|
|
13
21
|
### v11.26.0 - 2025-02-05
|
|
14
22
|
|
|
15
23
|
- :tada: Add support for Client Endpoint List
|
package/dist/lib/api/client.d.ts
CHANGED
|
@@ -9,15 +9,40 @@ export declare const ClientEndpoint: import("@sinclair/typebox").TObject<{
|
|
|
9
9
|
role: import("@sinclair/typebox").TString;
|
|
10
10
|
lastStatus: import("@sinclair/typebox").TString;
|
|
11
11
|
}>;
|
|
12
|
+
export declare const ClientEndpointList: import("@sinclair/typebox").TObject<{
|
|
13
|
+
version: import("@sinclair/typebox").TString;
|
|
14
|
+
type: import("@sinclair/typebox").TString;
|
|
15
|
+
data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
16
|
+
callsign: import("@sinclair/typebox").TString;
|
|
17
|
+
uid: import("@sinclair/typebox").TString;
|
|
18
|
+
username: import("@sinclair/typebox").TString;
|
|
19
|
+
team: import("@sinclair/typebox").TString;
|
|
20
|
+
role: import("@sinclair/typebox").TString;
|
|
21
|
+
lastStatus: import("@sinclair/typebox").TString;
|
|
22
|
+
}>>;
|
|
23
|
+
messages: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
24
|
+
nodeId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const ClientListQuery: import("@sinclair/typebox").TObject<{
|
|
27
|
+
secAgo: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
28
|
+
showCurrentlyConnectedClients: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
29
|
+
showMostRecentOnly: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
30
|
+
group: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
31
|
+
}>;
|
|
12
32
|
export default class Client extends Commands {
|
|
13
33
|
schema: {
|
|
14
34
|
list: {
|
|
15
35
|
description: string;
|
|
16
36
|
params: import("@sinclair/typebox").TObject<{}>;
|
|
17
|
-
query: import("@sinclair/typebox").TObject<{
|
|
37
|
+
query: import("@sinclair/typebox").TObject<{
|
|
38
|
+
secAgo: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
39
|
+
showCurrentlyConnectedClients: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
40
|
+
showMostRecentOnly: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
41
|
+
group: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
42
|
+
}>;
|
|
18
43
|
formats: CommandOutputFormat[];
|
|
19
44
|
};
|
|
20
45
|
};
|
|
21
46
|
cli(args: ParsedArgs): Promise<object | string>;
|
|
22
|
-
list(): Promise<
|
|
47
|
+
list(query?: Static<typeof ClientListQuery>): Promise<Static<typeof ClientEndpointList>>;
|
|
23
48
|
}
|
package/dist/lib/api/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from '@sinclair/typebox';
|
|
2
|
+
import { TAKList } from './types.js';
|
|
2
3
|
import Commands, { CommandOutputFormat } from '../commands.js';
|
|
3
4
|
export const ClientEndpoint = Type.Object({
|
|
4
5
|
callsign: Type.String(),
|
|
@@ -8,25 +9,48 @@ export const ClientEndpoint = Type.Object({
|
|
|
8
9
|
role: Type.String(),
|
|
9
10
|
lastStatus: Type.String(),
|
|
10
11
|
});
|
|
12
|
+
export const ClientEndpointList = TAKList(ClientEndpoint);
|
|
13
|
+
export const ClientListQuery = Type.Object({
|
|
14
|
+
secAgo: Type.Optional(Type.Integer({ default: 0 })),
|
|
15
|
+
showCurrentlyConnectedClients: Type.Optional(Type.String({ default: "false" })),
|
|
16
|
+
showMostRecentOnly: Type.Optional(Type.String({ default: "false" })),
|
|
17
|
+
group: Type.Optional(Type.Array(Type.String()))
|
|
18
|
+
});
|
|
11
19
|
export default class Client extends Commands {
|
|
12
20
|
schema = {
|
|
13
21
|
list: {
|
|
14
22
|
description: 'List Client Endpoints',
|
|
15
23
|
params: Type.Object({}),
|
|
16
|
-
query:
|
|
24
|
+
query: ClientListQuery,
|
|
17
25
|
formats: [CommandOutputFormat.JSON]
|
|
18
26
|
}
|
|
19
27
|
};
|
|
20
28
|
async cli(args) {
|
|
21
29
|
if (args._[3] === 'list') {
|
|
22
|
-
return await this.list(
|
|
30
|
+
return await this.list({
|
|
31
|
+
secAgo: args.secAgo,
|
|
32
|
+
showCurrentlyConnectedClients: args.showCurrentlyConnectedClients ? String(args.showCurrentlyConnectedClients) : undefined,
|
|
33
|
+
showMostRecentOnly: args.showMostRecentOnly ? String(args.showMostRecentOnly) : undefined,
|
|
34
|
+
group: args.group ? (Array.isArray(args.group) ? args.group : [args.group]) : undefined
|
|
35
|
+
});
|
|
23
36
|
}
|
|
24
37
|
else {
|
|
25
38
|
throw new Error('Unsupported Subcommand');
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
|
-
async list() {
|
|
41
|
+
async list(query = {}) {
|
|
29
42
|
const url = new URL(`/Marti/api/clientEndPoints`, this.api.url);
|
|
43
|
+
if (query.secAgo)
|
|
44
|
+
url.searchParams.append('secAgo', String(query.secAgo));
|
|
45
|
+
if (query.showCurrentlyConnectedClients)
|
|
46
|
+
url.searchParams.append('showCurrentlyConnectedClients', query.showCurrentlyConnectedClients);
|
|
47
|
+
if (query.showMostRecentOnly)
|
|
48
|
+
url.searchParams.append('showMostRecentOnly', query.showMostRecentOnly);
|
|
49
|
+
if (query.group) {
|
|
50
|
+
for (const group of query.group) {
|
|
51
|
+
url.searchParams.append('group', group);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
30
54
|
return await this.api.fetch(url, {
|
|
31
55
|
method: 'GET'
|
|
32
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../lib/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,mBAAmB,CAAC;AAEjD,OAAO,QAAQ,EAAE,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE;IACvB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,QAAQ;IACxC,MAAM,GAAG;QACL,IAAI,EAAE;YACF,WAAW,EAAE,uBAAuB;YACpC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../lib/api/client.ts"],"names":[],"mappings":"AAAA,OAAO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A+B,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACvI,IAAI,KAAK,CAAC,kBAAkB;YAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAEtG,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC9B,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;QAED,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;YAC7B,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/lib/api/client.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Type, Static } from '@sinclair/typebox';
|
|
2
2
|
import type { ParsedArgs } from 'minimist'
|
|
3
|
+
import { TAKList } from './types.js';
|
|
3
4
|
import Commands, { CommandOutputFormat } from '../commands.js';
|
|
4
5
|
|
|
5
6
|
export const ClientEndpoint = Type.Object({
|
|
@@ -11,26 +12,51 @@ export const ClientEndpoint = Type.Object({
|
|
|
11
12
|
lastStatus: Type.String(),
|
|
12
13
|
});
|
|
13
14
|
|
|
15
|
+
export const ClientEndpointList = TAKList(ClientEndpoint);
|
|
16
|
+
|
|
17
|
+
export const ClientListQuery = Type.Object({
|
|
18
|
+
secAgo: Type.Optional(Type.Integer({ default: 0 })),
|
|
19
|
+
showCurrentlyConnectedClients: Type.Optional(Type.String({ default: "false" })),
|
|
20
|
+
showMostRecentOnly: Type.Optional(Type.String({ default: "false" })),
|
|
21
|
+
group: Type.Optional(Type.Array(Type.String()))
|
|
22
|
+
});
|
|
23
|
+
|
|
14
24
|
export default class Client extends Commands {
|
|
15
25
|
schema = {
|
|
16
26
|
list: {
|
|
17
27
|
description: 'List Client Endpoints',
|
|
18
28
|
params: Type.Object({}),
|
|
19
|
-
query:
|
|
29
|
+
query: ClientListQuery,
|
|
20
30
|
formats: [ CommandOutputFormat.JSON ]
|
|
21
31
|
}
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
async cli(args: ParsedArgs): Promise<object | string> {
|
|
25
35
|
if (args._[3] === 'list') {
|
|
26
|
-
return await this.list(
|
|
36
|
+
return await this.list({
|
|
37
|
+
secAgo: args.secAgo,
|
|
38
|
+
showCurrentlyConnectedClients: args.showCurrentlyConnectedClients ? String(args.showCurrentlyConnectedClients) : undefined,
|
|
39
|
+
showMostRecentOnly: args.showMostRecentOnly ? String(args.showMostRecentOnly) : undefined,
|
|
40
|
+
group: args.group ? (Array.isArray(args.group) ? args.group : [args.group]) : undefined
|
|
41
|
+
});
|
|
27
42
|
} else {
|
|
28
43
|
throw new Error('Unsupported Subcommand');
|
|
29
44
|
}
|
|
30
45
|
}
|
|
31
46
|
|
|
32
|
-
async list(): Promise<
|
|
47
|
+
async list(query: Static<typeof ClientListQuery> = {}): Promise<Static<typeof ClientEndpointList>> {
|
|
33
48
|
const url = new URL(`/Marti/api/clientEndPoints`, this.api.url);
|
|
49
|
+
|
|
50
|
+
if (query.secAgo) url.searchParams.append('secAgo', String(query.secAgo));
|
|
51
|
+
if (query.showCurrentlyConnectedClients) url.searchParams.append('showCurrentlyConnectedClients', query.showCurrentlyConnectedClients);
|
|
52
|
+
if (query.showMostRecentOnly) url.searchParams.append('showMostRecentOnly', query.showMostRecentOnly);
|
|
53
|
+
|
|
54
|
+
if (query.group) {
|
|
55
|
+
for (const group of query.group) {
|
|
56
|
+
url.searchParams.append('group', group);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
34
60
|
return await this.api.fetch(url, {
|
|
35
61
|
method: 'GET'
|
|
36
62
|
});
|
package/package.json
CHANGED