@tak-ps/node-tak 8.8.1 → 8.9.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/CHANGELOG.md +4 -0
- package/dist/lib/api/repeater.js +21 -0
- package/dist/lib/api/repeater.js.map +1 -1
- package/lib/api/repeater.ts +22 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/lib/api/repeater.js
CHANGED
|
@@ -14,6 +14,27 @@ export default class {
|
|
|
14
14
|
constructor(api) {
|
|
15
15
|
this.api = api;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Return or set the current rebroadcast period
|
|
19
|
+
*
|
|
20
|
+
* {@link https://docs.tak.gov/api/takserver/redoc#tag/repeater-api/operation/getPeriod TAK Server Docs}.
|
|
21
|
+
* {@link https://docs.tak.gov/api/takserver/redoc#tag/repeater-api/operation/setPeriod TAK Server Docs}.
|
|
22
|
+
*/
|
|
23
|
+
async period(period) {
|
|
24
|
+
const url = new URL('/Marti/api/repeater/period', this.api.url);
|
|
25
|
+
if (period === undefined) {
|
|
26
|
+
return await this.api.fetch(url, {
|
|
27
|
+
method: 'GET'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
await this.api.fetch(url, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
body: period
|
|
34
|
+
});
|
|
35
|
+
return period;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
17
38
|
/**
|
|
18
39
|
* Return a list of all configured COT Repeaters
|
|
19
40
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeater.js","sourceRoot":"","sources":["../../../lib/api/repeater.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAU,MAAM,mBAAmB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;IAChC,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,KAAK,CAAC,MAAM,CAAC,GAAW;QACpB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,8BAA8B,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEvE,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;YACtB,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/lib/api/repeater.ts
CHANGED
|
@@ -20,6 +20,28 @@ export default class {
|
|
|
20
20
|
this.api = api;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Return or set the current rebroadcast period
|
|
25
|
+
*
|
|
26
|
+
* {@link https://docs.tak.gov/api/takserver/redoc#tag/repeater-api/operation/getPeriod TAK Server Docs}.
|
|
27
|
+
* {@link https://docs.tak.gov/api/takserver/redoc#tag/repeater-api/operation/setPeriod TAK Server Docs}.
|
|
28
|
+
*/
|
|
29
|
+
async period(period?: number): Promise<number> {
|
|
30
|
+
const url = new URL('/Marti/api/repeater/period', this.api.url);
|
|
31
|
+
if (period === undefined) {
|
|
32
|
+
return await this.api.fetch(url, {
|
|
33
|
+
method: 'GET'
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
await this.api.fetch(url, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
body: period
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return period;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
23
45
|
/**
|
|
24
46
|
* Return a list of all configured COT Repeaters
|
|
25
47
|
*
|
package/package.json
CHANGED