@bueno-analytics/fleet-command 0.3.0 → 0.5.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/copelandsoftware/bueno_js_sdk/compare/@bueno-analytics/fleet-command@0.4.0...@bueno-analytics/fleet-command@0.5.0) (2026-11-26)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **fleet-command:** SendGatewayCommandRequest is now a union keyed on command. Build the request with a literal command, or make the builder generic on the command name, so set-ui-password gets its payload.
9
+
10
+ ### Features
11
+
12
+ * **fleet-command:** add set-ui-password command and command payload ([6d3ee2e](https://github.com/copelandsoftware/bueno_js_sdk/commit/6d3ee2ec999757dbdb64bb3c72557f60d8e11acc))
13
+
14
+ ## [0.4.0](https://github.com/copelandsoftware/bueno_js_sdk/compare/@bueno-analytics/fleet-command@0.3.0...@bueno-analytics/fleet-command@0.4.0) (2026-11-09)
15
+
16
+
17
+ ### Features
18
+
19
+ * **fleet-command:** add gateway command schemas and publish-streams ([d39c416](https://github.com/copelandsoftware/bueno_js_sdk/commit/d39c416d1a7e2ea4baf92907bce0ee82542d1323))
20
+ * **fleet-command:** add gateway-info and dns-check command schemas ([6b3d4b2](https://github.com/copelandsoftware/bueno_js_sdk/commit/6b3d4b2bfe571324f3ff2f8e8ef99803d93b1e3e))
21
+ * **fleet-command:** add the sync-plugins command schema ([26dbcf4](https://github.com/copelandsoftware/bueno_js_sdk/commit/26dbcf45b36f6f4121e5e68521d3b48158d9e29a))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **fleet-command:** accept only REPLY messages as gateway command replies ([87d23c1](https://github.com/copelandsoftware/bueno_js_sdk/commit/87d23c193b3a5bbb6dab4ceb904204db845cac73))
27
+
3
28
  ## [0.3.0](https://github.com/copelandsoftware/bueno_js_sdk/compare/@bueno-analytics/fleet-command@0.2.0...@bueno-analytics/fleet-command@0.3.0) (2026-10-20)
4
29
 
5
30
 
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const dnsCheckRequest: z.ZodObject<{}, z.core.$strip>;
3
+ export declare const dnsCheckReply: z.ZodObject<{
4
+ configuredServers: z.ZodArray<z.ZodString>;
5
+ testResolution: z.ZodObject<{
6
+ domain: z.ZodString;
7
+ ip: z.ZodNullable<z.ZodString>;
8
+ latencyMs: z.ZodNumber;
9
+ status: z.ZodEnum<{
10
+ degraded: "degraded";
11
+ resolved: "resolved";
12
+ }>;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>;
15
+ export type DnsCheckRequest = z.infer<typeof dnsCheckRequest>;
16
+ export type DnsCheckReply = z.infer<typeof dnsCheckReply>;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export const dnsCheckRequest = z.object({});
3
+ export const dnsCheckReply = z.object({
4
+ configuredServers: z.array(z.string()),
5
+ // A lookup of the Bueno API host from the gateway.
6
+ testResolution: z.object({
7
+ domain: z.string(),
8
+ ip: z.string().nullable(),
9
+ latencyMs: z.number(),
10
+ status: z.enum(['resolved', 'degraded']),
11
+ }),
12
+ });
@@ -6,8 +6,58 @@ export declare const fleetCommands: {
6
6
  id: import("zod").ZodString;
7
7
  name: import("zod").ZodString;
8
8
  version: import("zod").ZodString;
9
+ integrationId: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
9
10
  }, import("zod/v4/core").$strip>>;
10
11
  }, import("zod/v4/core").$strip>;
11
12
  };
13
+ readonly 'publish-streams': {
14
+ readonly request: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
15
+ readonly reply: import("zod").ZodObject<{
16
+ queued: import("zod").ZodBoolean;
17
+ }, import("zod/v4/core").$strip>;
18
+ };
19
+ readonly 'gateway-info': {
20
+ readonly request: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
21
+ readonly reply: import("zod").ZodObject<{
22
+ versions: import("zod").ZodObject<{
23
+ appVersion: import("zod").ZodString;
24
+ appBuildDate: import("zod").ZodNumber;
25
+ node: import("zod").ZodString;
26
+ v8: import("zod").ZodString;
27
+ openssl: import("zod").ZodString;
28
+ }, import("zod/v4/core").$strip>;
29
+ host: import("zod").ZodObject<{
30
+ hostname: import("zod").ZodString;
31
+ platform: import("zod").ZodString;
32
+ }, import("zod/v4/core").$strip>;
33
+ }, import("zod/v4/core").$strip>;
34
+ };
35
+ readonly 'dns-check': {
36
+ readonly request: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
37
+ readonly reply: import("zod").ZodObject<{
38
+ configuredServers: import("zod").ZodArray<import("zod").ZodString>;
39
+ testResolution: import("zod").ZodObject<{
40
+ domain: import("zod").ZodString;
41
+ ip: import("zod").ZodNullable<import("zod").ZodString>;
42
+ latencyMs: import("zod").ZodNumber;
43
+ status: import("zod").ZodEnum<{
44
+ degraded: "degraded";
45
+ resolved: "resolved";
46
+ }>;
47
+ }, import("zod/v4/core").$strip>;
48
+ }, import("zod/v4/core").$strip>;
49
+ };
50
+ readonly 'sync-plugins': {
51
+ readonly request: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
52
+ readonly reply: import("zod").ZodObject<{
53
+ queued: import("zod").ZodArray<import("zod").ZodString>;
54
+ }, import("zod/v4/core").$strip>;
55
+ };
56
+ readonly 'set-ui-password': {
57
+ readonly request: import("zod").ZodObject<{
58
+ password: import("zod").ZodString;
59
+ }, import("zod/v4/core").$strip>;
60
+ readonly reply: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
61
+ };
12
62
  };
13
63
  export type FleetCommandName = keyof typeof fleetCommands;
@@ -1,7 +1,32 @@
1
+ import { dnsCheckReply, dnsCheckRequest } from './dnsCheck.js';
2
+ import { gatewayInfoReply, gatewayInfoRequest } from './gatewayInfo.js';
1
3
  import { listPluginsReply, listPluginsRequest } from './listPlugins.js';
4
+ import { publishStreamsReply, publishStreamsRequest } from './publishStreams.js';
5
+ import { setUiPasswordReply, setUiPasswordRequest } from './setUiPassword.js';
6
+ import { syncPluginsReply, syncPluginsRequest } from './syncPlugins.js';
2
7
  export const fleetCommands = {
3
8
  'list-plugins': {
4
9
  request: listPluginsRequest,
5
10
  reply: listPluginsReply,
6
11
  },
12
+ 'publish-streams': {
13
+ request: publishStreamsRequest,
14
+ reply: publishStreamsReply,
15
+ },
16
+ 'gateway-info': {
17
+ request: gatewayInfoRequest,
18
+ reply: gatewayInfoReply,
19
+ },
20
+ 'dns-check': {
21
+ request: dnsCheckRequest,
22
+ reply: dnsCheckReply,
23
+ },
24
+ 'sync-plugins': {
25
+ request: syncPluginsRequest,
26
+ reply: syncPluginsReply,
27
+ },
28
+ 'set-ui-password': {
29
+ request: setUiPasswordRequest,
30
+ reply: setUiPasswordReply,
31
+ },
7
32
  };
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export declare const sendGatewayCommandRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ command: z.ZodLiteral<"list-plugins">;
4
+ payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ command: z.ZodLiteral<"publish-streams">;
7
+ payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ command: z.ZodLiteral<"gateway-info">;
10
+ payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
11
+ }, z.core.$strip>, z.ZodObject<{
12
+ command: z.ZodLiteral<"dns-check">;
13
+ payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ command: z.ZodLiteral<"sync-plugins">;
16
+ payload: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
17
+ }, z.core.$strip>, z.ZodObject<{
18
+ command: z.ZodLiteral<"set-ui-password">;
19
+ payload: z.ZodObject<{
20
+ password: z.ZodString;
21
+ }, z.core.$strip>;
22
+ }, z.core.$strip>], "command">;
23
+ export declare const gatewayCommandReply: z.ZodObject<{
24
+ messageId: z.ZodString;
25
+ correlationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ payload: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
28
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
29
+ code: z.ZodString;
30
+ message: z.ZodString;
31
+ }, z.core.$strip>>>;
32
+ ts: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
33
+ type: z.ZodLiteral<"REPLY">;
34
+ }, z.core.$strip>;
35
+ export type SendGatewayCommandRequest = z.infer<typeof sendGatewayCommandRequest>;
36
+ export type GatewayCommandReply = z.infer<typeof gatewayCommandReply>;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { fleetCommands } from './fleetCommands.js';
3
+ import { fleetMessage } from './fleetMessage.js';
4
+ // Typed per command; a bare fleetCommands[command] widens to every request schema.
5
+ const request = (command) => fleetCommands[command].request;
6
+ const withOptionalPayload = (command) => z.object({
7
+ command: z.literal(command),
8
+ payload: z.nullish(request(command)),
9
+ });
10
+ const withPayload = (command) => z.object({
11
+ command: z.literal(command),
12
+ payload: request(command),
13
+ });
14
+ export const sendGatewayCommandRequest = z.discriminatedUnion('command', [
15
+ withOptionalPayload('list-plugins'),
16
+ withOptionalPayload('publish-streams'),
17
+ withOptionalPayload('gateway-info'),
18
+ withOptionalPayload('dns-check'),
19
+ withOptionalPayload('sync-plugins'),
20
+ withPayload('set-ui-password'),
21
+ ]);
22
+ // A refused command arrives as a successful response with error set and payload null.
23
+ export const gatewayCommandReply = fleetMessage
24
+ .omit({ replyTo: true })
25
+ .extend({ type: z.literal('REPLY') });
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const gatewayInfoRequest: z.ZodObject<{}, z.core.$strip>;
3
+ export declare const gatewayInfoReply: z.ZodObject<{
4
+ versions: z.ZodObject<{
5
+ appVersion: z.ZodString;
6
+ appBuildDate: z.ZodNumber;
7
+ node: z.ZodString;
8
+ v8: z.ZodString;
9
+ openssl: z.ZodString;
10
+ }, z.core.$strip>;
11
+ host: z.ZodObject<{
12
+ hostname: z.ZodString;
13
+ platform: z.ZodString;
14
+ }, z.core.$strip>;
15
+ }, z.core.$strip>;
16
+ export type GatewayInfoRequest = z.infer<typeof gatewayInfoRequest>;
17
+ export type GatewayInfoReply = z.infer<typeof gatewayInfoReply>;
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export const gatewayInfoRequest = z.object({});
3
+ export const gatewayInfoReply = z.object({
4
+ versions: z.object({
5
+ // 'Unknown' and 0 when the gateway build carries no version file.
6
+ appVersion: z.string(),
7
+ // Unix seconds, 0 when unknown.
8
+ appBuildDate: z.number(),
9
+ node: z.string(),
10
+ v8: z.string(),
11
+ openssl: z.string(),
12
+ }),
13
+ host: z.object({
14
+ hostname: z.string(),
15
+ platform: z.string(),
16
+ }),
17
+ });
package/dist/index.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ export { type DnsCheckReply, dnsCheckReply, type DnsCheckRequest, dnsCheckRequest, } from './dnsCheck.js';
1
2
  export { type FleetCommandName, fleetCommands } from './fleetCommands.js';
3
+ export { type GatewayInfoReply, gatewayInfoReply, type GatewayInfoRequest, gatewayInfoRequest, } from './gatewayInfo.js';
4
+ export { type GatewayCommandReply, gatewayCommandReply, type SendGatewayCommandRequest, sendGatewayCommandRequest, } from './gatewayCommand.js';
2
5
  export { type FleetError, fleetError, type FleetErrorCode, type FleetMessage, fleetMessage, type MessageType, } from './fleetMessage.js';
3
6
  export { type ListPluginsReply, listPluginsReply, type ListPluginsRequest, listPluginsRequest, } from './listPlugins.js';
7
+ export { type PublishStreamsReply, publishStreamsReply, type PublishStreamsRequest, publishStreamsRequest, } from './publishStreams.js';
8
+ export { type SetUiPasswordReply, setUiPasswordReply, type SetUiPasswordRequest, setUiPasswordRequest, } from './setUiPassword.js';
9
+ export { type SyncPluginsReply, syncPluginsReply, type SyncPluginsRequest, syncPluginsRequest, } from './syncPlugins.js';
package/dist/index.js CHANGED
@@ -1,3 +1,9 @@
1
+ export { dnsCheckReply, dnsCheckRequest, } from './dnsCheck.js';
1
2
  export { fleetCommands } from './fleetCommands.js';
3
+ export { gatewayInfoReply, gatewayInfoRequest, } from './gatewayInfo.js';
4
+ export { gatewayCommandReply, sendGatewayCommandRequest, } from './gatewayCommand.js';
2
5
  export { fleetError, fleetMessage, } from './fleetMessage.js';
3
6
  export { listPluginsReply, listPluginsRequest, } from './listPlugins.js';
7
+ export { publishStreamsReply, publishStreamsRequest, } from './publishStreams.js';
8
+ export { setUiPasswordReply, setUiPasswordRequest, } from './setUiPassword.js';
9
+ export { syncPluginsReply, syncPluginsRequest, } from './syncPlugins.js';
@@ -5,6 +5,7 @@ export declare const listPluginsReply: z.ZodObject<{
5
5
  id: z.ZodString;
6
6
  name: z.ZodString;
7
7
  version: z.ZodString;
8
+ integrationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
9
  }, z.core.$strip>>;
9
10
  }, z.core.$strip>;
10
11
  export type ListPluginsRequest = z.infer<typeof listPluginsRequest>;
@@ -5,5 +5,7 @@ export const listPluginsReply = z.object({
5
5
  id: z.string(),
6
6
  name: z.string(),
7
7
  version: z.string(),
8
+ // string: linked to an integration; null: not linked; absent: not reported.
9
+ integrationId: z.string().nullable().optional(),
8
10
  })),
9
11
  });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const publishStreamsRequest: z.ZodObject<{}, z.core.$strip>;
3
+ export declare const publishStreamsReply: z.ZodObject<{
4
+ queued: z.ZodBoolean;
5
+ }, z.core.$strip>;
6
+ export type PublishStreamsRequest = z.infer<typeof publishStreamsRequest>;
7
+ export type PublishStreamsReply = z.infer<typeof publishStreamsReply>;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export const publishStreamsRequest = z.object({});
3
+ export const publishStreamsReply = z.object({
4
+ queued: z.boolean(),
5
+ });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const setUiPasswordRequest: z.ZodObject<{
3
+ password: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export declare const setUiPasswordReply: z.ZodObject<{}, z.core.$strip>;
6
+ export type SetUiPasswordRequest = z.infer<typeof setUiPasswordRequest>;
7
+ export type SetUiPasswordReply = z.infer<typeof setUiPasswordReply>;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export const setUiPasswordRequest = z.object({
3
+ // Plaintext: relays must not log or persist it, or publish it retained.
4
+ // Length counts UTF-16 code units, like Kotlin String.length; zod's min/max count code points.
5
+ password: z
6
+ .string()
7
+ .refine(p => p.length >= 12 && p.length <= 128, {
8
+ message: 'Must be 12 to 128 UTF-16 code units',
9
+ })
10
+ .regex(/\S/, { message: 'Must not be only whitespace' }),
11
+ });
12
+ export const setUiPasswordReply = z.object({});
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export declare const syncPluginsRequest: z.ZodObject<{}, z.core.$strip>;
3
+ export declare const syncPluginsReply: z.ZodObject<{
4
+ queued: z.ZodArray<z.ZodString>;
5
+ }, z.core.$strip>;
6
+ export type SyncPluginsRequest = z.infer<typeof syncPluginsRequest>;
7
+ export type SyncPluginsReply = z.infer<typeof syncPluginsReply>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ export const syncPluginsRequest = z.object({});
3
+ export const syncPluginsReply = z.object({
4
+ // The plugins whose sync was queued. A daemon plugin, or one with a sync
5
+ // already queued or running, is left out.
6
+ queued: z.array(z.string()),
7
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bueno-analytics/fleet-command",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Zod schemas and types for the Bueno fleet command message contract",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -38,17 +38,17 @@
38
38
  "zod": "^4.6.7"
39
39
  },
40
40
  "devDependencies": {
41
- "@tsconfig/node24": "^24.0.5",
42
- "@tsconfig/strictest": "^2.0.8",
41
+ "@tsconfig/node24": "^24.0.6",
42
+ "@tsconfig/strictest": "^2.0.9",
43
43
  "@types/node": "^24.19.2",
44
- "@vitest/coverage-v8": "^5.0.5",
45
- "oxfmt": "^0.73.0",
46
- "oxlint": "^1.88.0",
47
- "oxlint-tsgolint": "^7.0.2004",
48
- "rimraf": "^6.1.3",
44
+ "@vitest/coverage-v8": "^5.1.0",
45
+ "oxfmt": "^0.78.0",
46
+ "oxlint": "^1.93.0",
47
+ "oxlint-tsgolint": "^7.0.2006",
48
+ "rimraf": "^6.1.4",
49
49
  "typescript": "^7.0.2",
50
- "vite": "^8.3.4",
51
- "vitest": "^5.0.5"
50
+ "vite": "^8.3.8",
51
+ "vitest": "^5.1.0"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=24.0.0"