@bueno-analytics/fleet-command 0.0.0-stage → 0.2.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 ADDED
@@ -0,0 +1,11 @@
1
+ ## 0.2.0
2
+
3
+ ### 🚀 Features
4
+
5
+ - **fleet-command:** add an error field to the envelope
6
+
7
+ ## 0.1.0
8
+
9
+ ### 🚀 Features
10
+
11
+ - **fleet-command:** add the fleet command message schemas
package/LICENSE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) 2026 Built Environment Optimisation Pty Ltd. All rights reserved.
package/README.md CHANGED
@@ -1,3 +1,19 @@
1
- # Temporary Holding Version
1
+ # fleet-command
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Zod schemas and types for the Bueno fleet command message contract.
4
+
5
+ ---
6
+
7
+ 🌏 [Bueno Website](https://buenoanalytics.com/) | 📗 [Changelog](./CHANGELOG.md) | 💳 [License](./LICENSE)
8
+
9
+ ## Prerequisites
10
+
11
+ - Node.js >=20.19.x <25
12
+
13
+ ## Install
14
+
15
+ ```shell
16
+ yarn add @bueno-analytics/fleet-command
17
+
18
+ npm install @bueno-analytics/fleet-command
19
+ ```
@@ -0,0 +1,13 @@
1
+ export declare const fleetCommands: {
2
+ readonly 'list-plugins': {
3
+ readonly request: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
4
+ readonly reply: import("zod").ZodObject<{
5
+ plugins: import("zod").ZodArray<import("zod").ZodObject<{
6
+ id: import("zod").ZodString;
7
+ name: import("zod").ZodString;
8
+ version: import("zod").ZodString;
9
+ }, import("zod/v4/core").$strip>>;
10
+ }, import("zod/v4/core").$strip>;
11
+ };
12
+ };
13
+ export type FleetCommandName = keyof typeof fleetCommands;
@@ -0,0 +1,7 @@
1
+ import { listPluginsReply, listPluginsRequest } from './listPlugins.js';
2
+ export const fleetCommands = {
3
+ 'list-plugins': {
4
+ request: listPluginsRequest,
5
+ reply: listPluginsReply,
6
+ },
7
+ };
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const fleetError: z.ZodObject<{
3
+ code: z.ZodString;
4
+ message: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type FleetError = z.infer<typeof fleetError>;
7
+ export type FleetErrorCode = 'UNKNOWN_COMMAND' | 'INVALID_REQUEST' | 'HANDLER_FAILED';
8
+ export declare const fleetMessage: z.ZodObject<{
9
+ messageId: z.ZodString;
10
+ type: z.ZodEnum<{
11
+ REQUEST: "REQUEST";
12
+ REPLY: "REPLY";
13
+ NOTIFICATION: "NOTIFICATION";
14
+ }>;
15
+ correlationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
+ replyTo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ command: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ payload: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
19
+ error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
20
+ code: z.ZodString;
21
+ message: z.ZodString;
22
+ }, z.core.$strip>>>;
23
+ ts: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
24
+ }, z.core.$strip>;
25
+ export type FleetMessage = z.infer<typeof fleetMessage>;
26
+ export type MessageType = FleetMessage['type'];
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export const fleetError = z.object({
3
+ // Open string, not an enum: a gateway can ship a new code before its readers upgrade.
4
+ code: z.string(),
5
+ message: z.string(),
6
+ });
7
+ // Envelope shared with forge-fleet's Kotlin `FleetMessage`; keep the two in step.
8
+ export const fleetMessage = z.object({
9
+ messageId: z.string(),
10
+ type: z.enum(['REQUEST', 'REPLY', 'NOTIFICATION']),
11
+ correlationId: z.string().nullish(),
12
+ // Per-pod routing token, not a topic; gateways append it to v1/gateway/{id}/reply/.
13
+ replyTo: z.string().nullish(),
14
+ command: z.string().nullish(),
15
+ payload: z.unknown().nullish(),
16
+ error: fleetError.nullish(),
17
+ // Null on offline: the LWT is frozen at connect and can't self-timestamp.
18
+ ts: z.iso.datetime({ offset: true }).nullish(),
19
+ });
@@ -0,0 +1,3 @@
1
+ export { type FleetCommandName, fleetCommands } from './fleetCommands.js';
2
+ export { type FleetError, fleetError, type FleetErrorCode, type FleetMessage, fleetMessage, type MessageType, } from './fleetMessage.js';
3
+ export { type ListPluginsReply, listPluginsReply, type ListPluginsRequest, listPluginsRequest, } from './listPlugins.js';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { fleetCommands } from './fleetCommands.js';
2
+ export { fleetError, fleetMessage, } from './fleetMessage.js';
3
+ export { listPluginsReply, listPluginsRequest, } from './listPlugins.js';
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const listPluginsRequest: z.ZodObject<{}, z.core.$strip>;
3
+ export declare const listPluginsReply: z.ZodObject<{
4
+ plugins: z.ZodArray<z.ZodObject<{
5
+ id: z.ZodString;
6
+ name: z.ZodString;
7
+ version: z.ZodString;
8
+ }, z.core.$strip>>;
9
+ }, z.core.$strip>;
10
+ export type ListPluginsRequest = z.infer<typeof listPluginsRequest>;
11
+ export type ListPluginsReply = z.infer<typeof listPluginsReply>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export const listPluginsRequest = z.object({});
3
+ export const listPluginsReply = z.object({
4
+ plugins: z.array(z.object({
5
+ id: z.string(),
6
+ name: z.string(),
7
+ version: z.string(),
8
+ })),
9
+ });
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@bueno-analytics/fleet-command",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Zod schemas and types for the Bueno fleet command message contract",
5
+ "keywords": [],
6
+ "license": "UNLICENSED",
7
+ "author": "Shriram Devanathan <sdevanathan@buenosystems.com.au>",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/copelandsoftware/bueno_js_sdk.git",
11
+ "directory": "packages/fleet-command"
12
+ },
13
+ "files": [
14
+ "dist/*",
15
+ "CHANGELOG.md",
16
+ "LICENSE",
17
+ "README.md"
18
+ ],
19
+ "type": "module",
20
+ "main": "dist/index.js",
21
+ "types": "dist/index.d.ts",
22
+ "exports": {
23
+ ".": "./dist/index.js"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "scripts": {
29
+ "test": "vitest --run",
30
+ "build": "rimraf dist && tsc",
31
+ "dev": "rimraf dist && tsc -w",
32
+ "format": "oxfmt",
33
+ "format:check": "oxfmt --check",
34
+ "lint": "oxlint .",
35
+ "prepublishOnly": "npm run build"
36
+ },
37
+ "dependencies": {
38
+ "zod": "^4.4.3"
39
+ },
40
+ "devDependencies": {
41
+ "@tsconfig/node22": "^22.0.2",
42
+ "@tsconfig/strictest": "^2.0.5",
43
+ "@types/node": "^22.15.32",
44
+ "@vitest/coverage-v8": "^4.0.15",
45
+ "oxfmt": "^0.59.0",
46
+ "oxlint": "^1.74.0",
47
+ "oxlint-tsgolint": "^7.0.2001",
48
+ "rimraf": "^6.1.2",
49
+ "typescript": "^5.8.3",
50
+ "vitest": "^4.0.15"
51
+ },
52
+ "engines": {
53
+ "node": ">=20.19.0 <25.0.0"
54
+ },
55
+ "engineStrict": true
56
+ }