@formant/formant-cli 0.1.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.
Files changed (147) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +322 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.js +5 -0
  5. package/dist/base-command.d.ts +38 -0
  6. package/dist/base-command.js +66 -0
  7. package/dist/base-command.js.map +1 -0
  8. package/dist/commands/analytics/query.d.ts +12 -0
  9. package/dist/commands/analytics/query.js +82 -0
  10. package/dist/commands/analytics/query.js.map +1 -0
  11. package/dist/commands/analytics/tables.d.ts +9 -0
  12. package/dist/commands/analytics/tables.js +34 -0
  13. package/dist/commands/analytics/tables.js.map +1 -0
  14. package/dist/commands/commands/for-device.d.ts +12 -0
  15. package/dist/commands/commands/for-device.js +33 -0
  16. package/dist/commands/commands/for-device.js.map +1 -0
  17. package/dist/commands/commands/get.d.ts +11 -0
  18. package/dist/commands/commands/get.js +133 -0
  19. package/dist/commands/commands/get.js.map +1 -0
  20. package/dist/commands/commands/history.d.ts +13 -0
  21. package/dist/commands/commands/history.js +49 -0
  22. package/dist/commands/commands/history.js.map +1 -0
  23. package/dist/commands/commands/list.d.ts +9 -0
  24. package/dist/commands/commands/list.js +31 -0
  25. package/dist/commands/commands/list.js.map +1 -0
  26. package/dist/commands/commands/send.d.ts +37 -0
  27. package/dist/commands/commands/send.js +260 -0
  28. package/dist/commands/commands/send.js.map +1 -0
  29. package/dist/commands/devices/config.d.ts +10 -0
  30. package/dist/commands/devices/config.js +38 -0
  31. package/dist/commands/devices/config.js.map +1 -0
  32. package/dist/commands/devices/get.d.ts +10 -0
  33. package/dist/commands/devices/get.js +35 -0
  34. package/dist/commands/devices/get.js.map +1 -0
  35. package/dist/commands/devices/last-seen.d.ts +10 -0
  36. package/dist/commands/devices/last-seen.js +25 -0
  37. package/dist/commands/devices/last-seen.js.map +1 -0
  38. package/dist/commands/devices/list.d.ts +20 -0
  39. package/dist/commands/devices/list.js +133 -0
  40. package/dist/commands/devices/list.js.map +1 -0
  41. package/dist/commands/devices/streams.d.ts +12 -0
  42. package/dist/commands/devices/streams.js +56 -0
  43. package/dist/commands/devices/streams.js.map +1 -0
  44. package/dist/commands/event-triggers/get.d.ts +10 -0
  45. package/dist/commands/event-triggers/get.js +29 -0
  46. package/dist/commands/event-triggers/get.js.map +1 -0
  47. package/dist/commands/event-triggers/list.d.ts +9 -0
  48. package/dist/commands/event-triggers/list.js +30 -0
  49. package/dist/commands/event-triggers/list.js.map +1 -0
  50. package/dist/commands/events/get.d.ts +10 -0
  51. package/dist/commands/events/get.js +35 -0
  52. package/dist/commands/events/get.js.map +1 -0
  53. package/dist/commands/events/list.d.ts +17 -0
  54. package/dist/commands/events/list.js +81 -0
  55. package/dist/commands/events/list.js.map +1 -0
  56. package/dist/commands/fleets/get.d.ts +10 -0
  57. package/dist/commands/fleets/get.js +28 -0
  58. package/dist/commands/fleets/get.js.map +1 -0
  59. package/dist/commands/fleets/list.d.ts +9 -0
  60. package/dist/commands/fleets/list.js +27 -0
  61. package/dist/commands/fleets/list.js.map +1 -0
  62. package/dist/commands/investigations/analytics.d.ts +15 -0
  63. package/dist/commands/investigations/analytics.js +69 -0
  64. package/dist/commands/investigations/analytics.js.map +1 -0
  65. package/dist/commands/investigations/get.d.ts +10 -0
  66. package/dist/commands/investigations/get.js +38 -0
  67. package/dist/commands/investigations/get.js.map +1 -0
  68. package/dist/commands/investigations/list.d.ts +12 -0
  69. package/dist/commands/investigations/list.js +41 -0
  70. package/dist/commands/investigations/list.js.map +1 -0
  71. package/dist/commands/investigations/run.d.ts +15 -0
  72. package/dist/commands/investigations/run.js +96 -0
  73. package/dist/commands/investigations/run.js.map +1 -0
  74. package/dist/commands/investigations/runs-list.d.ts +18 -0
  75. package/dist/commands/investigations/runs-list.js +57 -0
  76. package/dist/commands/investigations/runs-list.js.map +1 -0
  77. package/dist/commands/investigations/runs.d.ts +12 -0
  78. package/dist/commands/investigations/runs.js +30 -0
  79. package/dist/commands/investigations/runs.js.map +1 -0
  80. package/dist/commands/investigations/stats.d.ts +11 -0
  81. package/dist/commands/investigations/stats.js +40 -0
  82. package/dist/commands/investigations/stats.js.map +1 -0
  83. package/dist/commands/investigations/trigger.d.ts +14 -0
  84. package/dist/commands/investigations/trigger.js +43 -0
  85. package/dist/commands/investigations/trigger.js.map +1 -0
  86. package/dist/commands/kv/get.d.ts +10 -0
  87. package/dist/commands/kv/get.js +28 -0
  88. package/dist/commands/kv/get.js.map +1 -0
  89. package/dist/commands/kv/list.d.ts +13 -0
  90. package/dist/commands/kv/list.js +73 -0
  91. package/dist/commands/kv/list.js.map +1 -0
  92. package/dist/commands/kv/set.d.ts +11 -0
  93. package/dist/commands/kv/set.js +40 -0
  94. package/dist/commands/kv/set.js.map +1 -0
  95. package/dist/commands/query/index.d.ts +19 -0
  96. package/dist/commands/query/index.js +105 -0
  97. package/dist/commands/query/index.js.map +1 -0
  98. package/dist/commands/query/latest-values.d.ts +14 -0
  99. package/dist/commands/query/latest-values.js +102 -0
  100. package/dist/commands/query/latest-values.js.map +1 -0
  101. package/dist/commands/schedules/get.d.ts +10 -0
  102. package/dist/commands/schedules/get.js +29 -0
  103. package/dist/commands/schedules/get.js.map +1 -0
  104. package/dist/commands/schedules/list.d.ts +9 -0
  105. package/dist/commands/schedules/list.js +29 -0
  106. package/dist/commands/schedules/list.js.map +1 -0
  107. package/dist/commands/signals/count.d.ts +13 -0
  108. package/dist/commands/signals/count.js +43 -0
  109. package/dist/commands/signals/count.js.map +1 -0
  110. package/dist/commands/signals/get.d.ts +13 -0
  111. package/dist/commands/signals/get.js +80 -0
  112. package/dist/commands/signals/get.js.map +1 -0
  113. package/dist/commands/signals/list.d.ts +9 -0
  114. package/dist/commands/signals/list.js +30 -0
  115. package/dist/commands/signals/list.js.map +1 -0
  116. package/dist/commands/signals/query.d.ts +14 -0
  117. package/dist/commands/signals/query.js +52 -0
  118. package/dist/commands/signals/query.js.map +1 -0
  119. package/dist/commands/users/get.d.ts +10 -0
  120. package/dist/commands/users/get.js +28 -0
  121. package/dist/commands/users/get.js.map +1 -0
  122. package/dist/commands/users/list.d.ts +9 -0
  123. package/dist/commands/users/list.js +28 -0
  124. package/dist/commands/users/list.js.map +1 -0
  125. package/dist/help.d.ts +4 -0
  126. package/dist/help.js +91 -0
  127. package/dist/help.js.map +1 -0
  128. package/dist/hooks/init.d.ts +3 -0
  129. package/dist/hooks/init.js +7 -0
  130. package/dist/hooks/init.js.map +1 -0
  131. package/dist/index.d.ts +1 -0
  132. package/dist/index.js +2 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/lib/api.d.ts +12 -0
  135. package/dist/lib/api.js +46 -0
  136. package/dist/lib/api.js.map +1 -0
  137. package/dist/lib/auth.d.ts +17 -0
  138. package/dist/lib/auth.js +41 -0
  139. package/dist/lib/auth.js.map +1 -0
  140. package/dist/lib/config.d.ts +7 -0
  141. package/dist/lib/config.js +21 -0
  142. package/dist/lib/config.js.map +1 -0
  143. package/dist/lib/formatters.d.ts +17 -0
  144. package/dist/lib/formatters.js +53 -0
  145. package/dist/lib/formatters.js.map +1 -0
  146. package/oclif.manifest.json +2683 -0
  147. package/package.json +117 -0
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class DevicesGet extends BaseCommand<typeof DevicesGet> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<Record<string, unknown>>;
10
+ }
@@ -0,0 +1,35 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class DevicesGet extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Device ID (UUID)', required: true }),
7
+ };
8
+ static description = 'Get detailed information about a specific device by its ID.';
9
+ static examples = [
10
+ '<%= config.bin %> devices get <device-id>',
11
+ '<%= config.bin %> devices get <device-id> --json',
12
+ ];
13
+ static summary = 'Get a device by ID';
14
+ async run() {
15
+ const device = await this.api('admin', `devices/${this.args.id}`, {
16
+ method: 'GET',
17
+ });
18
+ if (!this.jsonEnabled()) {
19
+ this.log(`\nDevice Details (${this.env}):\n`);
20
+ this.log(formatDetail(device, {
21
+ createdAt: 'Created',
22
+ enabled: 'Enabled',
23
+ id: 'ID',
24
+ name: 'Name',
25
+ organizationId: 'Organization',
26
+ tags: 'Tags',
27
+ type: 'Type',
28
+ updatedAt: 'Updated',
29
+ }));
30
+ this.log('');
31
+ }
32
+ return device;
33
+ }
34
+ }
35
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/devices/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACpE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KACnE,CAAA;IAED,MAAM,CAAU,WAAW,GAAG,6DAA6D,CAAA;IAE3F,MAAM,CAAU,QAAQ,GAAG;QACzB,2CAA2C;QAC3C,kDAAkD;KACnD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,oBAAoB,CAAA;IAEvC,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,WAAW,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;YACzF,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,qBAAqB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC7C,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE;gBAC5B,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,SAAS;gBAClB,EAAE,EAAE,IAAI;gBACR,IAAI,EAAE,MAAM;gBACZ,cAAc,EAAE,cAAc;gBAC9B,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;gBACZ,SAAS,EAAE,SAAS;aACrB,CAAC,CAAC,CAAA;YACH,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class DevicesLastSeen extends BaseCommand<typeof DevicesLastSeen> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<Record<string, unknown>>;
10
+ }
@@ -0,0 +1,25 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ export default class DevicesLastSeen extends BaseCommand {
4
+ static args = {
5
+ id: Args.string({ description: 'Device ID (UUID)', required: true }),
6
+ };
7
+ static description = `Get when a device was last seen online.
8
+
9
+ Shows the most recent timestamp when the device was detected as online.`;
10
+ static examples = [
11
+ '<%= config.bin %> devices last-seen <device-id>',
12
+ '<%= config.bin %> devices last-seen <device-id> --json',
13
+ ];
14
+ static summary = 'Get device last seen timestamp';
15
+ async run() {
16
+ const result = await this.api('query', `online-devices/${this.args.id}/last-seen`, { method: 'GET' });
17
+ if (!this.jsonEnabled()) {
18
+ this.log(`\nDevice Last Seen (${this.env}):\n`);
19
+ this.log(` Device ID: ${this.args.id}`);
20
+ this.log(` Last Seen: ${result.lastSeen || 'Never'}\n`);
21
+ }
22
+ return result;
23
+ }
24
+ }
25
+ //# sourceMappingURL=last-seen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"last-seen.js","sourceRoot":"","sources":["../../../src/commands/devices/last-seen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAmC;IAC9E,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KACnE,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;wEAEwC,CAAA;IAEtE,MAAM,CAAU,QAAQ,GAAG;QACzB,iDAAiD;QACjD,wDAAwD;KACzD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,gCAAgC,CAAA;IAEnD,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAC3B,OAAO,EACP,kBAAkB,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,EAC1C,EAAC,MAAM,EAAE,KAAK,EAAC,CAChB,CAAA;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC/C,IAAI,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAA;YACxC,IAAI,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,QAAQ,IAAI,OAAO,IAAI,CAAC,CAAA;QAC1D,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class DevicesList extends BaseCommand<typeof DevicesList> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ tag: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ static summary: string;
12
+ run(): Promise<{
13
+ items: unknown[];
14
+ }>;
15
+ /**
16
+ * Try to get online device IDs from the presence service.
17
+ * Returns null if the endpoint fails or is unavailable.
18
+ */
19
+ private getOnlineDeviceIds;
20
+ }
@@ -0,0 +1,133 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class DevicesList extends BaseCommand {
5
+ static description = `List robots and sensors in your fleet. Shows only online devices by default.
6
+
7
+ Use --all to include offline devices.`;
8
+ static examples = [
9
+ '<%= config.bin %> devices list',
10
+ '<%= config.bin %> devices list --all',
11
+ '<%= config.bin %> devices list --all --limit 100',
12
+ '<%= config.bin %> devices list --tag location=warehouse',
13
+ '<%= config.bin %> devices list --name robot --dev --json',
14
+ ];
15
+ static flags = {
16
+ all: Flags.boolean({
17
+ char: 'a',
18
+ description: 'Show all devices (online and offline)',
19
+ }),
20
+ limit: Flags.integer({
21
+ char: 'l',
22
+ default: 50,
23
+ description: 'Maximum number of devices to return',
24
+ }),
25
+ name: Flags.string({
26
+ char: 'n',
27
+ description: 'Filter devices by name (search)',
28
+ }),
29
+ tag: Flags.string({
30
+ char: 't',
31
+ description: 'Filter by tag (key=value), can be specified multiple times',
32
+ multiple: true,
33
+ }),
34
+ };
35
+ static summary = 'List robots and sensors in your fleet';
36
+ async run() {
37
+ const baseBody = {
38
+ enabled: true,
39
+ };
40
+ if (this.flags.name)
41
+ baseBody.query = this.flags.name;
42
+ if (this.flags.tag && this.flags.tag.length > 0) {
43
+ const tags = {};
44
+ for (const t of this.flags.tag) {
45
+ const [key, ...rest] = t.split('=');
46
+ const value = rest.join('=');
47
+ if (!key || !value) {
48
+ this.error(`Invalid tag format: "${t}". Use key=value.`);
49
+ }
50
+ if (!tags[key])
51
+ tags[key] = [];
52
+ tags[key].push(value);
53
+ }
54
+ baseBody.tags = tags;
55
+ }
56
+ const limit = this.flags.limit;
57
+ let filtered;
58
+ if (this.flags.all) {
59
+ // --all: simple single fetch, enrich with online status
60
+ const result = await this.api('admin', 'devices/query', { body: { ...baseBody, count: limit } });
61
+ const onlineIds = await this.getOnlineDeviceIds();
62
+ filtered = (result.items ?? []).map((device) => ({
63
+ ...device,
64
+ online: onlineIds ? onlineIds.has(device.id) : isOnlineByState(device),
65
+ }));
66
+ }
67
+ else {
68
+ // Online-only: try fast path via GET /v1/queries/online-devices first
69
+ const onlineIds = await this.getOnlineDeviceIds();
70
+ if (onlineIds && onlineIds.size > 0) {
71
+ // Fast path: we know exactly which devices are online, query only those
72
+ const ids = [...onlineIds].slice(0, limit);
73
+ const result = await this.api('admin', 'devices/query', { body: { ...baseBody, deviceIds: ids, count: limit } });
74
+ filtered = (result.items ?? []).map((device) => ({ ...device, online: true }));
75
+ }
76
+ else {
77
+ // Fallback: page through devices, filter by state.agentVersion
78
+ const PAGE_SIZE = 200;
79
+ filtered = [];
80
+ let offset = 0;
81
+ let exhausted = false;
82
+ while (filtered.length < limit && !exhausted) {
83
+ const result = await this.api('admin', 'devices/query', { body: { ...baseBody, count: PAGE_SIZE, offset } });
84
+ const page = result.items ?? [];
85
+ if (page.length === 0 || page.length < PAGE_SIZE) {
86
+ exhausted = true;
87
+ }
88
+ for (const device of page) {
89
+ if (isOnlineByState(device)) {
90
+ filtered.push({ ...device, online: true });
91
+ if (filtered.length >= limit)
92
+ break;
93
+ }
94
+ }
95
+ offset += PAGE_SIZE;
96
+ }
97
+ }
98
+ }
99
+ const output = { items: filtered };
100
+ if (!this.jsonEnabled()) {
101
+ const mode = this.flags.all ? 'all' : 'online';
102
+ const columns = [
103
+ { key: 'name', label: 'NAME', width: 30 },
104
+ { key: 'id', label: 'ID', width: 40 },
105
+ { key: 'online', label: 'ONLINE', width: 10 },
106
+ { key: 'type', label: 'TYPE', width: 14 },
107
+ ];
108
+ this.log(`\nDevices — ${mode} (${this.env}):\n`);
109
+ this.log(formatTable(filtered, columns));
110
+ this.log('');
111
+ }
112
+ return output;
113
+ }
114
+ /**
115
+ * Try to get online device IDs from the presence service.
116
+ * Returns null if the endpoint fails or is unavailable.
117
+ */
118
+ async getOnlineDeviceIds() {
119
+ try {
120
+ const result = await this.api('query', 'online-devices', { method: 'GET' });
121
+ const ids = result.items ?? [];
122
+ return ids.length > 0 ? new Set(ids) : null;
123
+ }
124
+ catch {
125
+ return null;
126
+ }
127
+ }
128
+ }
129
+ function isOnlineByState(device) {
130
+ const state = device.state;
131
+ return Boolean(state?.agentVersion);
132
+ }
133
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/devices/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAA+B;IACtE,MAAM,CAAU,WAAW,GAAG;;sCAEM,CAAA;IAEpC,MAAM,CAAU,QAAQ,GAAG;QACzB,gCAAgC;QAChC,sCAAsC;QACtC,kDAAkD;QAClD,yDAAyD;QACzD,0DAA0D;KAC3D,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,uCAAuC;SACrD,CAAC;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ACb,CAAC;IACH,CAAC;;AAGH,SAAS,eAAe,CAAC,MAA+B;IACtD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAmD,CAAA;IACxE,OAAO,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;AACrC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class DevicesStreams extends BaseCommand<typeof DevicesStreams> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<{
10
+ streams: unknown[];
11
+ }>;
12
+ }
@@ -0,0 +1,56 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class DevicesStreams extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Device ID (UUID)', required: true }),
7
+ };
8
+ static description = `List telemetry streams configured on a device.
9
+
10
+ Shows a clean view of stream definitions parsed from the device configuration,
11
+ including stream names, types, topics, and quality settings.`;
12
+ static examples = [
13
+ '<%= config.bin %> devices streams <device-id>',
14
+ '<%= config.bin %> devices streams <device-id> --json',
15
+ ];
16
+ static summary = 'List device streams';
17
+ async run() {
18
+ // Fetch device and its configuration
19
+ const device = await this.api('admin', `devices/${this.args.id}`, {
20
+ method: 'GET',
21
+ });
22
+ const configVersion = device.desiredConfigurationVersion;
23
+ if (!configVersion) {
24
+ this.error('Device has no configuration version set');
25
+ }
26
+ const config = await this.api('admin', `devices/${this.args.id}/configurations/${configVersion}`, { method: 'GET' });
27
+ // Parse streams from config
28
+ const doc = config.document;
29
+ const telemetry = doc?.telemetry;
30
+ const streams = telemetry?.streams || [];
31
+ if (!this.jsonEnabled()) {
32
+ const columns = [
33
+ { key: 'name', label: 'NAME', width: 30 },
34
+ { key: 'type', label: 'TYPE', width: 20 },
35
+ { key: 'topic', label: 'TOPIC', width: 40 },
36
+ { key: 'quality', label: 'QUALITY', width: 12 },
37
+ ];
38
+ // Format streams for display
39
+ const rows = streams.map((s) => {
40
+ const conf = s.configuration;
41
+ return {
42
+ name: s.name,
43
+ type: conf?.type || '—',
44
+ topic: conf?.topic || '—',
45
+ quality: s.quality || '—',
46
+ };
47
+ });
48
+ this.log(`\nDevice Streams (${this.env}):\n`);
49
+ this.log(` Device: ${device.name} (${this.args.id})\n`);
50
+ this.log(formatTable(rows, columns));
51
+ this.log('');
52
+ }
53
+ return { streams };
54
+ }
55
+ }
56
+ //# sourceMappingURL=streams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.js","sourceRoot":"","sources":["../../../src/commands/devices/streams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAkC;IAC5E,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KACnE,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;;6DAG6B,CAAA;IAE3D,MAAM,CAAU,QAAQ,GAAG;QACzB,+CAA+C;QAC/C,sDAAsD;KACvD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,qBAAqB,CAAA;IAExC,KAAK,CAAC,GAAG;QACd,qCAAqC;QACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,WAAW,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;YACzF,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,MAAM,aAAa,GAAG,MAAM,CAAC,2BAA2B,CAAA;QAExD,IAAI,CAAC,a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AEF,IAAI,CAAC,GAAG,CAAC,qBAAqB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC7C,IAAI,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAA;YACxD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;YACpC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,EAAC,OAAO,EAAC,CAAA;IAClB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class EventTriggersGet extends BaseCommand<typeof EventTriggersGet> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<Record<string, unknown>>;
10
+ }
@@ -0,0 +1,29 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class EventTriggersGet extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Event trigger ID (UUID)', required: true }),
7
+ };
8
+ static description = `Get detailed information about an event trigger.
9
+
10
+ Shows the full trigger configuration including conditions, exit conditions, commands
11
+ it executes, and device targeting filters.`;
12
+ static examples = [
13
+ '<%= config.bin %> event-triggers get <trigger-id>',
14
+ '<%= config.bin %> event-triggers get <trigger-id> --json',
15
+ ];
16
+ static summary = 'Get event trigger details';
17
+ async run() {
18
+ const trigger = await this.api('admin', `event-triggers/${this.args.id}`, {
19
+ method: 'GET',
20
+ });
21
+ if (!this.jsonEnabled()) {
22
+ this.log(`\nEvent Trigger Details (${this.env}):\n`);
23
+ this.log(formatDetail(trigger));
24
+ this.log('');
25
+ }
26
+ return trigger;
27
+ }
28
+ }
29
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/event-triggers/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAoC;IAChF,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,yBAAyB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC1E,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;;2CAGW,CAAA;IAEzC,MAAM,CAAU,QAAQ,GAAG;QACzB,mDAAmD;QACnD,0DAA0D;KAC3D,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,2BAA2B,CAAA;IAE9C,KAAK,CAAC,GAAG;QACd,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,kBAAkB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;YACjG,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,4BAA4B,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YACpD,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;YAC/B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class EventTriggersList extends BaseCommand<typeof EventTriggersList> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static summary: string;
6
+ run(): Promise<{
7
+ items: unknown[];
8
+ }>;
9
+ }
@@ -0,0 +1,30 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ import { formatTable } from '../../lib/formatters.js';
3
+ export default class EventTriggersList extends BaseCommand {
4
+ static description = `List all event trigger rules in your organization.
5
+
6
+ Event triggers monitor device data and generate events/signals when conditions are met.
7
+ They can trigger investigations, send notifications, or execute commands.`;
8
+ static examples = [
9
+ '<%= config.bin %> event-triggers list',
10
+ '<%= config.bin %> event-triggers list --json',
11
+ ];
12
+ static summary = 'List event trigger rules';
13
+ async run() {
14
+ const result = await this.api('admin', 'event-triggers', { method: 'GET' });
15
+ const items = (result.items ?? []).filter((t) => t.enabled !== false);
16
+ if (!this.jsonEnabled()) {
17
+ const columns = [
18
+ { key: 'message', label: 'MESSAGE', width: 40 },
19
+ { key: 'eventType', label: 'TYPE', width: 20 },
20
+ { key: 'severity', label: 'SEVERITY', width: 12 },
21
+ { key: 'id', label: 'ID', width: 40 },
22
+ ];
23
+ this.log(`\nEvent Triggers (${this.env}):\n`);
24
+ this.log(formatTable(items, columns));
25
+ this.log('');
26
+ }
27
+ return { items };
28
+ }
29
+ }
30
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/event-triggers/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAqC;IAClF,MAAM,CAAU,WAAW,GAAG;;;0EAG0C,CAAA;IAExE,MAAM,CAAU,QAAQ,GAAG;QACzB,uCAAuC;QACvC,8CAA8C;KAC/C,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,0BAA0B,CAAA;IAE7C,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAC3B,OAAO,EACP,gBAAgB,EAChB,EAAC,MAAM,EAAE,KAAK,EAAC,CAChB,CAAA;QAED,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,CAAA;QAErE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,OAAO,GAAa;gBACxB,EAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC7C,EAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC5C,EAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC/C,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC;aACpC,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,qBAAqB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC7C,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;YACrC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,EAAC,KAAK,EAAC,CAAA;IAChB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class EventsGet extends BaseCommand<typeof EventsGet> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<Record<string, unknown>>;
10
+ }
@@ -0,0 +1,35 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class EventsGet extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Event ID (UUID)', required: true }),
7
+ };
8
+ static description = 'Get detailed information about a specific event by its ID.';
9
+ static examples = [
10
+ '<%= config.bin %> events get <event-id>',
11
+ '<%= config.bin %> events get <event-id> --json',
12
+ ];
13
+ static summary = 'Get an event by ID';
14
+ async run() {
15
+ const event = await this.api('admin', `events/${this.args.id}`, {
16
+ method: 'GET',
17
+ });
18
+ if (!this.jsonEnabled()) {
19
+ this.log(`\nEvent Details (${this.env}):\n`);
20
+ this.log(formatDetail(event, {
21
+ createdAt: 'Created',
22
+ deviceId: 'Device ID',
23
+ id: 'ID',
24
+ message: 'Message',
25
+ severity: 'Severity',
26
+ tags: 'Tags',
27
+ time: 'Time',
28
+ type: 'Type',
29
+ }));
30
+ this.log('');
31
+ }
32
+ return event;
33
+ }
34
+ }
35
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/events/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAA6B;IAClE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAClE,CAAA;IAED,MAAM,CAAU,WAAW,GAAG,4DAA4D,CAAA;IAE1F,MAAM,CAAU,QAAQ,GAAG;QACzB,yCAAyC;QACzC,gDAAgD;KACjD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,oBAAoB,CAAA;IAEvC,KAAK,CAAC,GAAG;QACd,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;YACvF,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC5C,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE;gBAC3B,SAAS,EAAE,SAAS;gBACpB,QAAQ,EAAE,WAAW;gBACrB,EAAE,EAAE,IAAI;gBACR,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,MAAM;aACb,CAAC,CAAC,CAAA;YACH,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class EventsList extends BaseCommand<typeof EventsList> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ device: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ end: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
9
+ severity: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ start: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ static summary: string;
14
+ run(): Promise<{
15
+ items: unknown[];
16
+ }>;
17
+ }
@@ -0,0 +1,81 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class EventsList extends BaseCommand {
5
+ static description = `View important events emitted by devices with optional filters.
6
+
7
+ Events are significant occurrences from robots and sensors (e.g., device online/offline,
8
+ errors, state changes, commands). They can trigger signals for investigation.
9
+
10
+ Event types include: triggered-event, datapoint-event, device-online, device-offline,
11
+ intervention-request, intervention-response, teleop-session-record, command-request,
12
+ command-response, custom, comment, system, annotation, task-summary, stateful.
13
+
14
+ Severities: info, warning, error, critical.`;
15
+ static examples = [
16
+ '<%= config.bin %> events list',
17
+ '<%= config.bin %> events list --device <id> --severity critical',
18
+ '<%= config.bin %> events list --type device-offline --start 2026-01-01 --end 2026-01-02',
19
+ '<%= config.bin %> events list --limit 100 --json',
20
+ ];
21
+ static flags = {
22
+ device: Flags.string({
23
+ char: 'd',
24
+ description: 'Filter by device ID',
25
+ }),
26
+ end: Flags.string({
27
+ description: 'End time (ISO 8601)',
28
+ }),
29
+ limit: Flags.integer({
30
+ char: 'l',
31
+ default: 25,
32
+ description: 'Maximum number of events to return',
33
+ }),
34
+ severity: Flags.string({
35
+ description: 'Filter by severity',
36
+ options: ['info', 'warning', 'error', 'critical'],
37
+ }),
38
+ start: Flags.string({
39
+ description: 'Start time (ISO 8601)',
40
+ }),
41
+ type: Flags.string({
42
+ description: 'Filter by event type',
43
+ }),
44
+ };
45
+ static summary = 'View events emitted by devices';
46
+ async run() {
47
+ const body = {
48
+ count: this.flags.limit,
49
+ };
50
+ if (this.flags.device)
51
+ body.deviceIds = [this.flags.device];
52
+ if (this.flags.type)
53
+ body.eventTypes = [this.flags.type];
54
+ if (this.flags.severity)
55
+ body.severities = [this.flags.severity];
56
+ if (this.flags.start)
57
+ body.start = this.flags.start;
58
+ if (this.flags.end)
59
+ body.end = this.flags.end;
60
+ const result = await this.api('admin', 'events/query', { body });
61
+ if (!this.jsonEnabled()) {
62
+ const columns = [
63
+ { key: 'type', label: 'TYPE', width: 24 },
64
+ { key: 'message', label: 'MESSAGE', width: 40 },
65
+ { key: 'severity', label: 'SEVERITY', width: 12 },
66
+ { key: 'time', label: 'TIME', width: 26 },
67
+ { key: 'id', label: 'ID', width: 40 },
68
+ ];
69
+ // Flatten event data for display
70
+ const rows = (result.items ?? []).map((e) => ({
71
+ ...e,
72
+ time: e.createdAt ?? e.timestamp ?? '—',
73
+ }));
74
+ this.log(`\nEvents (${this.env} environment):\n`);
75
+ this.log(formatTable(rows, columns));
76
+ this.log('');
77
+ }
78
+ return result;
79
+ }
80
+ }
81
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/events/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACpE,MAAM,CAAU,WAAW,GAAG;;;;;;;;;4CASY,CAAA;IAE1C,MAAM,CAAU,QAAQ,GAAG;QACzB,+BAA+B;QAC/B,iEAAiE;QACjE,yFAAyF;QACzF,kDAAkD;KACnD,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,qBAAqB;SACnC,CAAC;QACF,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,qBAAqB;SACnC,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,oCAAoC;SAClD,CAAC;QACF,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,oBA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AAE,KAAK,EAAE,EAAE,EAAC;gBACvC,EAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC7C,EAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC/C,EAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAC;gBACvC,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC;aACpC,CAAA;YAED,iCAAiC;YACjC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC5C,GAAG,CAAC;gBACJ,IAAI,EAAE,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,IAAI,GAAG;aACxC,CAAC,CAAC,CAAA;YAEH,IAAI,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAA;YACjD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;YACpC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class FleetsGet extends BaseCommand<typeof FleetsGet> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<Record<string, unknown>>;
10
+ }
@@ -0,0 +1,28 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class FleetsGet extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Fleet (group) ID (UUID)', required: true }),
7
+ };
8
+ static description = `Get detailed information about a device group (fleet).
9
+
10
+ Shows the full fleet configuration including member devices and settings.`;
11
+ static examples = [
12
+ '<%= config.bin %> fleets get <fleet-id>',
13
+ '<%= config.bin %> fleets get <fleet-id> --json',
14
+ ];
15
+ static summary = 'Get fleet details';
16
+ async run() {
17
+ const fleet = await this.api('admin', `groups/${this.args.id}`, {
18
+ method: 'GET',
19
+ });
20
+ if (!this.jsonEnabled()) {
21
+ this.log(`\nFleet Details (${this.env}):\n`);
22
+ this.log(formatDetail(fleet));
23
+ this.log('');
24
+ }
25
+ return fleet;
26
+ }
27
+ }
28
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/fleets/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,WAA6B;IAClE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,yBAAyB,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC1E,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;0EAE0C,CAAA;IAExE,MAAM,CAAU,QAAQ,GAAG;QACzB,yCAAyC;QACzC,gDAAgD;KACjD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,mBAAmB,CAAA;IAEtC,KAAK,CAAC,GAAG;QACd,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,UAAU,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;YACvF,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAC5C,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;YAC7B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,KAAK,CAAA;IACd,CAAC"}