@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,11 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class CommandsGet extends BaseCommand<typeof CommandsGet> {
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
+ private parseSchema;
11
+ }
@@ -0,0 +1,133 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class CommandsGet extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Command template ID (UUID)', required: true }),
7
+ };
8
+ static description = `Get detailed information about a command template.
9
+
10
+ Shows the full template configuration including command string, parameter schema,
11
+ device targeting filters, and delivery settings. If the template has structured
12
+ parameters (schema), they are displayed in a readable format.`;
13
+ static examples = [
14
+ '<%= config.bin %> commands get <template-id>',
15
+ '<%= config.bin %> commands get <template-id> --json',
16
+ ];
17
+ static summary = 'Get command template details';
18
+ async run() {
19
+ const template = await this.api('admin', `command-templates/${this.args.id}`, {
20
+ method: 'GET',
21
+ });
22
+ if (!this.jsonEnabled()) {
23
+ this.log(`\nCommand Template (${this.env}):\n`);
24
+ // Core info
25
+ this.log(` Name: ${template.name}`);
26
+ this.log(` Command: ${template.command}`);
27
+ this.log(` ID: ${template.id}`);
28
+ this.log(` Description: ${template.description || '—'}`);
29
+ this.log(` Enabled: ${template.enabled}`);
30
+ this.log(` Parameters: ${template.parameterEnabled ? 'yes' : 'no'}`);
31
+ if (template.parameterEnabled) {
32
+ this.log(` Override Allowed: ${template.allowParameterOverride !== false ? 'yes' : 'no'}`);
33
+ }
34
+ if (template.lambdaUri) {
35
+ this.log(` Lambda URI: ${template.lambdaUri}`);
36
+ }
37
+ // Delivery settings
38
+ const delivery = template.deliverySettings;
39
+ if (delivery) {
40
+ const ttl = delivery.ttlMs ? `${Number(delivery.ttlMs) / 1000}s` : 'default (3 days)';
41
+ this.log(` TTL: ${ttl}`);
42
+ this.log(` Retryable: ${delivery.retryable ?? '—'}`);
43
+ }
44
+ // Device filter
45
+ const deviceFilter = template.deviceFilter;
46
+ if (deviceFilter) {
47
+ this.log(`\n Device Filter:`);
48
+ if (deviceFilter.deviceIds) {
49
+ this.log(` Device IDs: ${deviceFilter.deviceIds.join(', ')}`);
50
+ }
51
+ if (deviceFilter.tags) {
52
+ this.log(` Tags: ${JSON.stringify(deviceFilter.tags)}`);
53
+ }
54
+ }
55
+ // Tags
56
+ const tags = template.tags;
57
+ if (tags && Object.keys(tags).length > 0) {
58
+ this.log(`\n Tags: ${JSON.stringify(tags)}`);
59
+ }
60
+ // Unstructured default value
61
+ if (template.parameterEnabled && template.parameterValue) {
62
+ this.log(`\n Default Value: ${template.parameterValue}`);
63
+ }
64
+ // Structured schema
65
+ const schema = this.parseSchema(template.schema);
66
+ if (schema?.parameters && Object.keys(schema.parameters).length > 0) {
67
+ this.log(`\n Parameters Schema:\n`);
68
+ const rows = Object.values(schema.parameters).map((p) => {
69
+ let defaultVal = String(p.value ?? '—');
70
+ if (p.type === 'options' && p.options) {
71
+ defaultVal = p.options.find((o) => o.value === String(p.value))?.label ?? defaultVal;
72
+ }
73
+ let validationStr = '—';
74
+ const v = p.validations;
75
+ if (v) {
76
+ const parts = [];
77
+ if (v.min !== undefined)
78
+ parts.push(`min=${v.min}`);
79
+ if (v.max !== undefined)
80
+ parts.push(`max=${v.max}`);
81
+ if (v.minLength !== undefined)
82
+ parts.push(`minLen=${v.minLength}`);
83
+ if (v.maxLength !== undefined)
84
+ parts.push(`maxLen=${v.maxLength}`);
85
+ if (v.regexp)
86
+ parts.push(`pattern=${v.regexp}`);
87
+ if (parts.length > 0)
88
+ validationStr = parts.join(', ');
89
+ }
90
+ return {
91
+ name: p.name,
92
+ type: p.type,
93
+ default: defaultVal,
94
+ required: p.required ? 'yes' : 'no',
95
+ override: p.allowOverride ? 'yes' : 'no',
96
+ validation: validationStr,
97
+ };
98
+ });
99
+ const columns = [
100
+ { key: 'name', label: 'NAME', width: 20 },
101
+ { key: 'type', label: 'TYPE', width: 10 },
102
+ { key: 'default', label: 'DEFAULT', width: 20 },
103
+ { key: 'required', label: 'REQUIRED', width: 10 },
104
+ { key: 'override', label: 'OVERRIDE', width: 10 },
105
+ { key: 'validation', label: 'VALIDATION', width: 25 },
106
+ ];
107
+ this.log(formatTable(rows, columns));
108
+ // Show options for "options" type params
109
+ for (const p of Object.values(schema.parameters)) {
110
+ if (p.type === 'options' && p.options && p.options.length > 0) {
111
+ this.log(`\n Options for "${p.name}":`);
112
+ for (const opt of p.options) {
113
+ this.log(` - ${opt.label}: ${opt.value}${opt.description ? ` (${opt.description})` : ''}`);
114
+ }
115
+ }
116
+ }
117
+ }
118
+ this.log('');
119
+ }
120
+ return template;
121
+ }
122
+ parseSchema(schemaStr) {
123
+ if (!schemaStr)
124
+ return null;
125
+ try {
126
+ return JSON.parse(schemaStr);
127
+ }
128
+ catch {
129
+ return null;
130
+ }
131
+ }
132
+ }
133
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/commands/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAA4B,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAE9E,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,WAA+B;IACtE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC7E,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;;;8DAI8B,CAAA;IAE5D,MAAM,CAAU,QAAQ,GAAG;QACzB,8CAA8C;QAC9C,qDAAqD;KACtD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,8BAA8B,CAAA;IAEjD,KAAK,CAAC,GAAG;QACd,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAA0B,OAAO,EAAE,qBAAqB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE;YACrG,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAE/C,YAAY;YACZ,IAAI,CAAC,GAAG,CAAC,wBAAwB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;YACjD,IAAI,CAAC,GAAG,CAAC,wBAAwB,QAA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CAAC,IAAI,IAAI,CAAC,CAAA;wBAC1C,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;4BAC5B,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;wBACjG,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEO,WAAW,CAAC,SAAoC;QACtD,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAA;QAC3B,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class CommandsHistory extends BaseCommand<typeof CommandsHistory> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ device: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ static summary: string;
10
+ run(): Promise<{
11
+ items: unknown[];
12
+ }>;
13
+ }
@@ -0,0 +1,49 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class CommandsHistory extends BaseCommand {
5
+ static description = `Query command history for a device.
6
+
7
+ Shows commands that have been sent to a device, including delivery status and responses.
8
+ Use this to check if commands were delivered and executed successfully.`;
9
+ static examples = [
10
+ '<%= config.bin %> commands history --device <device-id>',
11
+ '<%= config.bin %> commands history --device <device-id> --limit 50',
12
+ '<%= config.bin %> commands history --device <device-id> --json',
13
+ ];
14
+ static flags = {
15
+ device: Flags.string({
16
+ char: 'd',
17
+ description: 'Device ID (UUID)',
18
+ required: true,
19
+ }),
20
+ limit: Flags.integer({
21
+ char: 'l',
22
+ default: 25,
23
+ description: 'Maximum number of commands to return',
24
+ }),
25
+ };
26
+ static summary = 'Query command history';
27
+ async run() {
28
+ const result = await this.api('admin', 'commands/query', {
29
+ body: {
30
+ deviceId: this.flags.device,
31
+ limit: this.flags.limit,
32
+ },
33
+ });
34
+ if (!this.jsonEnabled()) {
35
+ const columns = [
36
+ { key: 'command', label: 'COMMAND', width: 30 },
37
+ { key: 'id', label: 'ID', width: 40 },
38
+ { key: 'deliveredAt', label: 'DELIVERED', width: 26 },
39
+ { key: 'respondedAt', label: 'RESPONDED', width: 26 },
40
+ { key: 'success', label: 'SUCCESS', width: 8 },
41
+ ];
42
+ this.log(`\nCommand History (${this.env}):\n`);
43
+ this.log(formatTable(result.items ?? [], columns));
44
+ this.log('');
45
+ }
46
+ return result;
47
+ }
48
+ }
49
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/commands/commands/history.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,eAAgB,SAAQ,WAAmC;IAC9E,MAAM,CAAU,WAAW,GAAG;;;wEAGwC,CAAA;IAEtE,MAAM,CAAU,QAAQ,GAAG;QACzB,yDAAyD;QACzD,oEAAoE;QACpE,gEAAgE;KACjE,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;Y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C,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class CommandsList extends BaseCommand<typeof CommandsList> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static summary: string;
6
+ run(): Promise<{
7
+ items: unknown[];
8
+ }>;
9
+ }
@@ -0,0 +1,31 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ import { formatTable } from '../../lib/formatters.js';
3
+ export default class CommandsList extends BaseCommand {
4
+ static description = `List all command templates defined in your organization.
5
+
6
+ Command templates define the commands that can be sent to devices. Each template
7
+ specifies the command string, parameters, delivery settings, and device targeting.`;
8
+ static examples = [
9
+ '<%= config.bin %> commands list',
10
+ '<%= config.bin %> commands list --json',
11
+ ];
12
+ static summary = 'List command templates';
13
+ async run() {
14
+ const result = await this.api('admin', 'command-templates', { method: 'GET' });
15
+ const items = (result.items ?? []).filter((t) => t.enabled !== false);
16
+ if (!this.jsonEnabled()) {
17
+ const columns = [
18
+ { key: 'name', label: 'NAME', width: 30 },
19
+ { key: 'command', label: 'COMMAND', width: 30 },
20
+ { key: 'id', label: 'ID', width: 40 },
21
+ { key: 'parameterEnabled', label: 'PARAMS', width: 8 },
22
+ { key: 'description', label: 'DESCRIPTION', width: 30 },
23
+ ];
24
+ this.log(`\nCommand Templates (${this.env}):\n`);
25
+ this.log(formatTable(items, columns));
26
+ this.log('');
27
+ }
28
+ return { items };
29
+ }
30
+ }
31
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/commands/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,YAAa,SAAQ,WAAgC;IACxE,MAAM,CAAU,WAAW,GAAG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37 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class CommandsSend extends BaseCommand<typeof CommandsSend> {
3
+ static args: {
4
+ deviceId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ templateId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ 'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ param: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ 'raw-value': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ static summary: string;
15
+ run(): Promise<Record<string, unknown>>;
16
+ /**
17
+ * Build the parameter value string, handling both structured (schema) and
18
+ * unstructured (parameterValue) parameter systems.
19
+ */
20
+ private buildParameterValue;
21
+ /**
22
+ * Build parameters from a structured schema with validation.
23
+ */
24
+ private buildStructuredParams;
25
+ /**
26
+ * Coerce a string value to the correct type and validate against rules.
27
+ */
28
+ private coerceAndValidate;
29
+ /**
30
+ * Build unstructured parameter value (legacy path).
31
+ */
32
+ private buildUnstructuredParams;
33
+ /**
34
+ * Parse the schema JSON string from a template.
35
+ */
36
+ private parseSchema;
37
+ }
@@ -0,0 +1,260 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class CommandsSend extends BaseCommand {
5
+ static args = {
6
+ deviceId: Args.string({ description: 'Device ID (UUID)', required: true }),
7
+ templateId: Args.string({ description: 'Command template ID (UUID)', required: true }),
8
+ };
9
+ static description = `Send a command to a device using a command template.
10
+
11
+ Fetches the template, validates parameters against its schema, and sends the command
12
+ to the specified device. Use --param flags to override parameter values.
13
+
14
+ For templates with structured parameters (schema), parameter names and types are
15
+ validated. For unstructured parameters, the raw value is sent as-is.
16
+
17
+ Use --dry-run to preview the payload without actually sending.`;
18
+ static examples = [
19
+ '<%= config.bin %> commands send <device-id> <template-id>',
20
+ '<%= config.bin %> commands send <device-id> <template-id> --param speed=5 --param mode=fast',
21
+ '<%= config.bin %> commands send <device-id> <template-id> --dry-run',
22
+ '<%= config.bin %> commands send <device-id> <template-id> --raw-value \'{"x":1,"y":2}\'',
23
+ '<%= config.bin %> commands send <device-id> <template-id> --json',
24
+ ];
25
+ static flags = {
26
+ 'dry-run': Flags.boolean({
27
+ description: 'Preview the command payload without sending',
28
+ }),
29
+ param: Flags.string({
30
+ char: 'p',
31
+ description: 'Parameter override (name=value), can be specified multiple times',
32
+ multiple: true,
33
+ }),
34
+ 'raw-value': Flags.string({
35
+ description: 'Send a raw parameter value string (bypasses schema validation)',
36
+ }),
37
+ };
38
+ static summary = 'Send a command to a device';
39
+ async run() {
40
+ const { deviceId, templateId } = this.args;
41
+ // Fetch the command template
42
+ const template = await this.api('admin', `command-templates/${templateId}`, {
43
+ method: 'GET',
44
+ });
45
+ // Parse parameter overrides from --param flags
46
+ const paramOverrides = {};
47
+ if (this.flags.param) {
48
+ for (const p of this.flags.param) {
49
+ const eqIdx = p.indexOf('=');
50
+ if (eqIdx < 1) {
51
+ this.error(`Invalid parameter format: "${p}". Use name=value.`);
52
+ }
53
+ const key = p.slice(0, eqIdx);
54
+ const value = p.slice(eqIdx + 1);
55
+ paramOverrides[key] = value;
56
+ }
57
+ }
58
+ // Check if overrides are allowed
59
+ const hasOverrides = Object.keys(paramOverrides).length > 0 || this.flags['raw-value'];
60
+ if (hasOverrides && template.parameterEnabled && template.allowParameterOverride === false) {
61
+ this.error('This command template does not allow parameter overrides.');
62
+ }
63
+ // Build the parameter value
64
+ const parameterValue = this.buildParameterValue(template, paramOverrides);
65
+ // Build the command payload
66
+ const commandPayload = {
67
+ command: template.command,
68
+ commandTemplateId: templateId,
69
+ deviceId,
70
+ organizationId: template.organizationId,
71
+ parameter: {
72
+ scrubberTime: new Date().toISOString(),
73
+ value: parameterValue,
74
+ },
75
+ tags: template.tags || {},
76
+ };
77
+ // Dry run - just show what would be sent
78
+ if (this.flags['dry-run']) {
79
+ if (!this.jsonEnabled()) {
80
+ this.log(`\nDry Run - Command Payload (${this.env}):\n`);
81
+ this.log(formatDetail(commandPayload));
82
+ this.log('');
83
+ }
84
+ return commandPayload;
85
+ }
86
+ // Send the command
87
+ const result = await this.api('admin', 'commands', {
88
+ body: commandPayload,
89
+ method: 'POST',
90
+ });
91
+ if (!this.jsonEnabled()) {
92
+ this.log(`\nCommand Sent (${this.env}):\n`);
93
+ this.log(` Command: ${template.command}`);
94
+ this.log(` Template: ${template.name}`);
95
+ this.log(` Device: ${deviceId}`);
96
+ this.log(` Command ID: ${result.id}`);
97
+ if (parameterValue) {
98
+ this.log(` Parameters: ${parameterValue}`);
99
+ }
100
+ this.log(`\n Use 'fcli commands history --device ${deviceId}' to check delivery status.\n`);
101
+ }
102
+ return result;
103
+ }
104
+ /**
105
+ * Build the parameter value string, handling both structured (schema) and
106
+ * unstructured (parameterValue) parameter systems.
107
+ */
108
+ buildParameterValue(template, overrides) {
109
+ // If --raw-value was provided, use it directly
110
+ if (this.flags['raw-value']) {
111
+ return this.flags['raw-value'];
112
+ }
113
+ // If parameters are not enabled, no value
114
+ if (!template.parameterEnabled) {
115
+ if (Object.keys(overrides).length > 0) {
116
+ this.error('This command template does not accept parameters.');
117
+ }
118
+ return '';
119
+ }
120
+ // Try to parse the structured schema
121
+ const schema = this.parseSchema(template.schema);
122
+ if (schema?.parameters && Object.keys(schema.parameters).length > 0) {
123
+ // Structured parameter path
124
+ return this.buildStructuredParams(schema, overrides);
125
+ }
126
+ // Unstructured parameter path
127
+ return this.buildUnstructuredParams(template, overrides);
128
+ }
129
+ /**
130
+ * Build parameters from a structured schema with validation.
131
+ */
132
+ buildStructuredParams(schema, overrides) {
133
+ const params = {};
134
+ const schemaParams = schema.parameters;
135
+ // Build a name-to-param lookup for user-friendly --param name=value
136
+ const byName = {};
137
+ for (const [id, param] of Object.entries(schemaParams)) {
138
+ byName[param.name.toLowerCase()] = [id, param];
139
+ // Also allow lookup by ID
140
+ byName[id.toLowerCase()] = [id, param];
141
+ }
142
+ // Check all overrides are valid
143
+ for (const [key, value] of Object.entries(overrides)) {
144
+ const entry = byName[key.toLowerCase()];
145
+ if (!entry) {
146
+ const available = Object.values(schemaParams).map((p) => p.name).join(', ');
147
+ this.error(`Unknown parameter "${key}". Available: ${available}`);
148
+ }
149
+ const [, paramDef] = entry;
150
+ if (!paramDef.allowOverride) {
151
+ this.error(`Parameter "${paramDef.name}" does not allow overrides.`);
152
+ }
153
+ // Validate and coerce the value
154
+ params[paramDef.name] = this.coerceAndValidate(paramDef, value);
155
+ }
156
+ // Fill in defaults for parameters not overridden
157
+ for (const param of Object.values(schemaParams)) {
158
+ if (!(param.name in params)) {
159
+ if (param.required && param.value === undefined) {
160
+ this.error(`Required parameter "${param.name}" is missing. Use --param ${param.name}=<value>`);
161
+ }
162
+ params[param.name] = param.value;
163
+ }
164
+ }
165
+ return JSON.stringify(params);
166
+ }
167
+ /**
168
+ * Coerce a string value to the correct type and validate against rules.
169
+ */
170
+ coerceAndValidate(param, rawValue) {
171
+ const validations = param.validations;
172
+ switch (param.type) {
173
+ case 'number': {
174
+ const num = Number(rawValue);
175
+ if (Number.isNaN(num)) {
176
+ this.error(`Parameter "${param.name}" requires a number, got "${rawValue}".`);
177
+ }
178
+ if (validations?.min !== undefined && num < validations.min) {
179
+ this.error(`Parameter "${param.name}" must be >= ${validations.min}.`);
180
+ }
181
+ if (validations?.max !== undefined && num > validations.max) {
182
+ this.error(`Parameter "${param.name}" must be <= ${validations.max}.`);
183
+ }
184
+ return num;
185
+ }
186
+ case 'boolean': {
187
+ const lower = rawValue.toLowerCase();
188
+ if (lower === 'true' || lower === '1' || lower === 'yes')
189
+ return true;
190
+ if (lower === 'false' || lower === '0' || lower === 'no')
191
+ return false;
192
+ this.error(`Parameter "${param.name}" requires a boolean (true/false), got "${rawValue}".`);
193
+ break;
194
+ }
195
+ case 'options': {
196
+ if (param.options && param.options.length > 0) {
197
+ const match = param.options.find((o) => o.value === rawValue || o.label.toLowerCase() === rawValue.toLowerCase());
198
+ if (!match) {
199
+ const available = param.options.map((o) => `${o.label} (${o.value})`).join(', ');
200
+ this.error(`Parameter "${param.name}" must be one of: ${available}`);
201
+ }
202
+ return match.value;
203
+ }
204
+ return rawValue;
205
+ }
206
+ case 'string':
207
+ default: {
208
+ if (validations?.minLength !== undefined && rawValue.length < validations.minLength) {
209
+ this.error(`Parameter "${param.name}" must be at least ${validations.minLength} characters.`);
210
+ }
211
+ if (validations?.maxLength !== undefined && rawValue.length > validations.maxLength) {
212
+ this.error(`Parameter "${param.name}" must be at most ${validations.maxLength} characters.`);
213
+ }
214
+ if (validations?.regexp) {
215
+ const re = new RegExp(validations.regexp);
216
+ if (!re.test(rawValue)) {
217
+ this.error(`Parameter "${param.name}" must match pattern: ${validations.regexp}`);
218
+ }
219
+ }
220
+ return rawValue;
221
+ }
222
+ }
223
+ return rawValue;
224
+ }
225
+ /**
226
+ * Build unstructured parameter value (legacy path).
227
+ */
228
+ buildUnstructuredParams(template, overrides) {
229
+ let parameterValue = template.parameterValue;
230
+ if (Object.keys(overrides).length > 0) {
231
+ // Try to merge with existing JSON value
232
+ let params = {};
233
+ if (parameterValue) {
234
+ try {
235
+ params = JSON.parse(parameterValue);
236
+ }
237
+ catch {
238
+ // Not JSON - if overrides are provided, build new JSON from overrides
239
+ }
240
+ }
241
+ params = { ...params, ...overrides };
242
+ parameterValue = JSON.stringify(params);
243
+ }
244
+ return parameterValue || '';
245
+ }
246
+ /**
247
+ * Parse the schema JSON string from a template.
248
+ */
249
+ parseSchema(schemaStr) {
250
+ if (!schemaStr)
251
+ return null;
252
+ try {
253
+ return JSON.parse(schemaStr);
254
+ }
255
+ catch {
256
+ return null;
257
+ }
258
+ }
259
+ }
260
+ //# sourceMappingURL=send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src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S,EAAC,CAAA;YAClC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACzC,CAAC;QAED,OAAO,cAAc,IAAI,EAAE,CAAA;IAC7B,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,SAAoC;QACtD,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAA;QAC3B,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAmB,CAAA;QAChD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class DevicesConfig extends BaseCommand<typeof DevicesConfig> {
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,38 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class DevicesConfig extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Device ID (UUID)', required: true }),
7
+ };
8
+ static description = `Get the device configuration including stream definitions.
9
+
10
+ Shows the device's current configuration including telemetry streams, commands,
11
+ and other settings.`;
12
+ static examples = [
13
+ '<%= config.bin %> devices config <device-id>',
14
+ '<%= config.bin %> devices config <device-id> --json',
15
+ ];
16
+ static summary = 'Get device configuration';
17
+ async run() {
18
+ // First get the device to find its configuration version
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
+ // Fetch the actual configuration
27
+ const config = await this.api('admin', `devices/${this.args.id}/configurations/${configVersion}`, { method: 'GET' });
28
+ if (!this.jsonEnabled()) {
29
+ this.log(`\nDevice Configuration (${this.env}):\n`);
30
+ this.log(` Device: ${device.name} (${this.args.id})`);
31
+ this.log(` Configuration Version: ${configVersion}\n`);
32
+ this.log(formatDetail(config));
33
+ this.log('');
34
+ }
35
+ return { device, config };
36
+ }
37
+ }
38
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/commands/devices/config.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,aAAc,SAAQ,WAAiC;IAC1E,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;;;oBAGZ,CAAA;IAElB,MAAM,CAAU,QAAQ,GAAG;QACzB,8CAA8C;QAC9C,qDAAqD;KACtD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,0BAA0B,CAAA;IAE7C,KAAK,CAAC,GAAG;QACd,yDAAyD;QACzD,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,aAAa,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAA;QACvD,CAAC;QAED,iCAAiC;QACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAC3B,OAAO,EACP,WAAW,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