@myrobotaxi/contracts 0.6.0 → 0.7.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/README.md +1 -0
- package/dist/index.cjs +81 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -1
- package/dist/index.d.ts +81 -1
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.cts +71 -1
- package/dist/types.d.ts +71 -1
- package/package.json +2 -1
- package/schemas/drive-route.schema.json +78 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AuthOkPayload, AuthPayload, ConnectivityPayload, Drive, DriveEndedPayload, DriveStartedPayload, DriveSummary, DrivesListResponse, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, SubscribePayload, UnsubscribePayload, VehicleListResponse, VehicleState, VehicleSummary, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.cjs';
|
|
1
|
+
export { AuthOkPayload, AuthPayload, ConnectivityPayload, Drive, DriveEndedPayload, DriveRoute, DriveStartedPayload, DriveSummary, DrivesListResponse, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, RoutePoint, SubscribePayload, UnsubscribePayload, VehicleListResponse, VehicleState, VehicleSummary, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.cjs';
|
|
2
2
|
|
|
3
3
|
declare const schemas: {
|
|
4
4
|
readonly vehicleState: {
|
|
@@ -710,6 +710,86 @@ declare const schemas: {
|
|
|
710
710
|
};
|
|
711
711
|
};
|
|
712
712
|
};
|
|
713
|
+
readonly driveRoute: {
|
|
714
|
+
$schema: string;
|
|
715
|
+
$id: string;
|
|
716
|
+
title: string;
|
|
717
|
+
description: string;
|
|
718
|
+
type: string;
|
|
719
|
+
additionalProperties: boolean;
|
|
720
|
+
required: string[];
|
|
721
|
+
properties: {
|
|
722
|
+
driveId: {
|
|
723
|
+
type: string;
|
|
724
|
+
description: string;
|
|
725
|
+
"x-classification": string;
|
|
726
|
+
examples: string[];
|
|
727
|
+
};
|
|
728
|
+
routePoints: {
|
|
729
|
+
type: string;
|
|
730
|
+
description: string;
|
|
731
|
+
"x-classification": string;
|
|
732
|
+
items: {
|
|
733
|
+
$ref: string;
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
$defs: {
|
|
738
|
+
RoutePoint: {
|
|
739
|
+
title: string;
|
|
740
|
+
description: string;
|
|
741
|
+
type: string;
|
|
742
|
+
additionalProperties: boolean;
|
|
743
|
+
required: string[];
|
|
744
|
+
properties: {
|
|
745
|
+
lat: {
|
|
746
|
+
type: string;
|
|
747
|
+
description: string;
|
|
748
|
+
"x-classification": string;
|
|
749
|
+
"x-encrypted-at-rest": boolean;
|
|
750
|
+
"x-unit": string;
|
|
751
|
+
minimum: number;
|
|
752
|
+
maximum: number;
|
|
753
|
+
examples: number[];
|
|
754
|
+
};
|
|
755
|
+
lng: {
|
|
756
|
+
type: string;
|
|
757
|
+
description: string;
|
|
758
|
+
"x-classification": string;
|
|
759
|
+
"x-encrypted-at-rest": boolean;
|
|
760
|
+
"x-unit": string;
|
|
761
|
+
minimum: number;
|
|
762
|
+
maximum: number;
|
|
763
|
+
examples: number[];
|
|
764
|
+
};
|
|
765
|
+
speed: {
|
|
766
|
+
type: string;
|
|
767
|
+
description: string;
|
|
768
|
+
"x-classification": string;
|
|
769
|
+
"x-unit": string;
|
|
770
|
+
minimum: number;
|
|
771
|
+
examples: number[];
|
|
772
|
+
};
|
|
773
|
+
heading: {
|
|
774
|
+
type: string;
|
|
775
|
+
description: string;
|
|
776
|
+
"x-classification": string;
|
|
777
|
+
"x-unit": string;
|
|
778
|
+
minimum: number;
|
|
779
|
+
maximum: number;
|
|
780
|
+
examples: number[];
|
|
781
|
+
};
|
|
782
|
+
timestamp: {
|
|
783
|
+
type: string;
|
|
784
|
+
format: string;
|
|
785
|
+
description: string;
|
|
786
|
+
"x-classification": string;
|
|
787
|
+
examples: string[];
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
};
|
|
713
793
|
readonly wsMessages: {
|
|
714
794
|
$schema: string;
|
|
715
795
|
$id: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AuthOkPayload, AuthPayload, ConnectivityPayload, Drive, DriveEndedPayload, DriveStartedPayload, DriveSummary, DrivesListResponse, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, SubscribePayload, UnsubscribePayload, VehicleListResponse, VehicleState, VehicleSummary, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.js';
|
|
1
|
+
export { AuthOkPayload, AuthPayload, ConnectivityPayload, Drive, DriveEndedPayload, DriveRoute, DriveStartedPayload, DriveSummary, DrivesListResponse, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, RoutePoint, SubscribePayload, UnsubscribePayload, VehicleListResponse, VehicleState, VehicleSummary, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.js';
|
|
2
2
|
|
|
3
3
|
declare const schemas: {
|
|
4
4
|
readonly vehicleState: {
|
|
@@ -710,6 +710,86 @@ declare const schemas: {
|
|
|
710
710
|
};
|
|
711
711
|
};
|
|
712
712
|
};
|
|
713
|
+
readonly driveRoute: {
|
|
714
|
+
$schema: string;
|
|
715
|
+
$id: string;
|
|
716
|
+
title: string;
|
|
717
|
+
description: string;
|
|
718
|
+
type: string;
|
|
719
|
+
additionalProperties: boolean;
|
|
720
|
+
required: string[];
|
|
721
|
+
properties: {
|
|
722
|
+
driveId: {
|
|
723
|
+
type: string;
|
|
724
|
+
description: string;
|
|
725
|
+
"x-classification": string;
|
|
726
|
+
examples: string[];
|
|
727
|
+
};
|
|
728
|
+
routePoints: {
|
|
729
|
+
type: string;
|
|
730
|
+
description: string;
|
|
731
|
+
"x-classification": string;
|
|
732
|
+
items: {
|
|
733
|
+
$ref: string;
|
|
734
|
+
};
|
|
735
|
+
};
|
|
736
|
+
};
|
|
737
|
+
$defs: {
|
|
738
|
+
RoutePoint: {
|
|
739
|
+
title: string;
|
|
740
|
+
description: string;
|
|
741
|
+
type: string;
|
|
742
|
+
additionalProperties: boolean;
|
|
743
|
+
required: string[];
|
|
744
|
+
properties: {
|
|
745
|
+
lat: {
|
|
746
|
+
type: string;
|
|
747
|
+
description: string;
|
|
748
|
+
"x-classification": string;
|
|
749
|
+
"x-encrypted-at-rest": boolean;
|
|
750
|
+
"x-unit": string;
|
|
751
|
+
minimum: number;
|
|
752
|
+
maximum: number;
|
|
753
|
+
examples: number[];
|
|
754
|
+
};
|
|
755
|
+
lng: {
|
|
756
|
+
type: string;
|
|
757
|
+
description: string;
|
|
758
|
+
"x-classification": string;
|
|
759
|
+
"x-encrypted-at-rest": boolean;
|
|
760
|
+
"x-unit": string;
|
|
761
|
+
minimum: number;
|
|
762
|
+
maximum: number;
|
|
763
|
+
examples: number[];
|
|
764
|
+
};
|
|
765
|
+
speed: {
|
|
766
|
+
type: string;
|
|
767
|
+
description: string;
|
|
768
|
+
"x-classification": string;
|
|
769
|
+
"x-unit": string;
|
|
770
|
+
minimum: number;
|
|
771
|
+
examples: number[];
|
|
772
|
+
};
|
|
773
|
+
heading: {
|
|
774
|
+
type: string;
|
|
775
|
+
description: string;
|
|
776
|
+
"x-classification": string;
|
|
777
|
+
"x-unit": string;
|
|
778
|
+
minimum: number;
|
|
779
|
+
maximum: number;
|
|
780
|
+
examples: number[];
|
|
781
|
+
};
|
|
782
|
+
timestamp: {
|
|
783
|
+
type: string;
|
|
784
|
+
format: string;
|
|
785
|
+
description: string;
|
|
786
|
+
"x-classification": string;
|
|
787
|
+
examples: string[];
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
};
|
|
713
793
|
readonly wsMessages: {
|
|
714
794
|
$schema: string;
|
|
715
795
|
$id: string;
|
package/dist/index.js
CHANGED
|
@@ -815,6 +815,86 @@ var drive_detail_schema_default = {
|
|
|
815
815
|
}
|
|
816
816
|
};
|
|
817
817
|
|
|
818
|
+
// schemas/drive-route.schema.json
|
|
819
|
+
var drive_route_schema_default = {
|
|
820
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
821
|
+
$id: "https://myrobotaxi.com/schemas/drive-route.schema.json",
|
|
822
|
+
title: "DriveRoute",
|
|
823
|
+
description: "Full GPS polyline for a single completed drive, returned as a bare object by GET /api/drives/{driveId}/route (rest-api.md \xA77.4, FR-3.3). This is the heavy per-drive route payload deliberately excluded from both DriveSummary (\xA77.2) and Drive detail (\xA77.3): the SDK fetches it lazily on tap-through of a drive's map view, NOT eagerly per drive-list row (see \xA77.4 lazy-fetch guidance \u2014 cellular bandwidth / perceived latency, not heap pressure). The polyline is AES-256-GCM encrypted at rest on Drive.routePoints (NFR-3.23, data-classification.md \xA71.5) and decrypted in the store layer (NFR-3.25) before the handler serializes it; the SDK never sees ciphertext. Mirrors the Go `driveRouteResponse` struct in telemetry/internal/telemetry/drive_route_handler.go and the `DriveRoute` component in telemetry/docs/contracts/specs/rest.openapi.yaml. NOTE: the handler passes `routePoints` through as `json.RawMessage` (raw decrypted JSONB) \u2014 the per-point shape is owned by the writer that persisted it (store.RoutePointRecord, telemetry/internal/store/types.go), so RoutePoint below documents that persisted format field-for-field.",
|
|
824
|
+
type: "object",
|
|
825
|
+
additionalProperties: false,
|
|
826
|
+
required: ["driveId", "routePoints"],
|
|
827
|
+
properties: {
|
|
828
|
+
driveId: {
|
|
829
|
+
type: "string",
|
|
830
|
+
description: "Opaque database identifier (cuid) for this drive. Echoes the `driveId` path param and matches Drive.id / DriveSummary.id and the `driveId` carried by `drive_started` / `drive_ended` WebSocket frames. Always present (Go `driveRouteResponse.DriveID`, no omitempty).",
|
|
831
|
+
"x-classification": "P0",
|
|
832
|
+
examples: ["clmno9876543210zyxw0001"]
|
|
833
|
+
},
|
|
834
|
+
routePoints: {
|
|
835
|
+
type: "array",
|
|
836
|
+
description: "Ordered GPS breadcrumb trail for the drive, oldest point first, suitable for rendering the drive's polyline on a map. ALWAYS PRESENT and ALWAYS AN ARRAY, never null: the Go handler substitutes an empty `[]` when the underlying Drive.routePoints column is empty/absent (writeMaskedRoute, telemetry/internal/telemetry/drive_route_handler.go) \u2014 so a very short drive with no captured points, or a route that failed to decrypt, yields `[]` rather than a missing key or null. A 60-minute drive captured at ~1 Hz is roughly 3,600 points (~200-300 KB JSON); no server-side downsampling or paging \u2014 the entire polyline is returned in one response (there is no cursor/limit on this endpoint, unlike the \xA77.2 drives list).",
|
|
837
|
+
"x-classification": "mixed",
|
|
838
|
+
items: { $ref: "#/$defs/RoutePoint" }
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
$defs: {
|
|
842
|
+
RoutePoint: {
|
|
843
|
+
title: "RoutePoint",
|
|
844
|
+
description: "A single GPS sample on a drive's polyline. Matches the `RoutePointRecord` shape from data-classification.md \xA71.5 \u2014 the JSONB element format persisted by the Go writer (store.RoutePointRecord, telemetry/internal/store/types.go) and the legacy Next.js app. lat/lng are P1 (identifying GPS); speed, heading, and timestamp are P0 in isolation but are encrypted at rest as a unit inside the P1 routePoints column (NFR-3.23) and MUST NOT be logged separately. All five fields are always present on the wire (the Go struct carries no omitempty). Mirrors the `RoutePoint` component in telemetry/docs/contracts/specs/rest.openapi.yaml.",
|
|
845
|
+
type: "object",
|
|
846
|
+
additionalProperties: false,
|
|
847
|
+
required: ["lat", "lng", "speed", "heading", "timestamp"],
|
|
848
|
+
properties: {
|
|
849
|
+
lat: {
|
|
850
|
+
type: "number",
|
|
851
|
+
description: "Latitude in degrees at this point. Emitted as a JSON number (Go float64); whole-degree values serialize without a decimal point (Go shortest-float marshaling), so `10` and `10.0000` are the same value on the wire.",
|
|
852
|
+
"x-classification": "P1",
|
|
853
|
+
"x-encrypted-at-rest": true,
|
|
854
|
+
"x-unit": "degrees",
|
|
855
|
+
minimum: -90,
|
|
856
|
+
maximum: 90,
|
|
857
|
+
examples: [37.7749]
|
|
858
|
+
},
|
|
859
|
+
lng: {
|
|
860
|
+
type: "number",
|
|
861
|
+
description: "Longitude in degrees at this point. Emitted as a JSON number (Go float64).",
|
|
862
|
+
"x-classification": "P1",
|
|
863
|
+
"x-encrypted-at-rest": true,
|
|
864
|
+
"x-unit": "degrees",
|
|
865
|
+
minimum: -180,
|
|
866
|
+
maximum: 180,
|
|
867
|
+
examples: [-122.4194]
|
|
868
|
+
},
|
|
869
|
+
speed: {
|
|
870
|
+
type: "number",
|
|
871
|
+
description: "Instantaneous speed at this point, in miles per hour. P0 in isolation but encrypted at rest alongside the parent P1 routePoints column. Emitted as a JSON number (Go float64).",
|
|
872
|
+
"x-classification": "P0",
|
|
873
|
+
"x-unit": "mph",
|
|
874
|
+
minimum: 0,
|
|
875
|
+
examples: [15]
|
|
876
|
+
},
|
|
877
|
+
heading: {
|
|
878
|
+
type: "number",
|
|
879
|
+
description: "Compass heading at this point, in degrees (0-360, 0 = North). P0 in isolation but encrypted at rest alongside the parent P1 routePoints column. Emitted as a JSON number (Go float64).",
|
|
880
|
+
"x-classification": "P0",
|
|
881
|
+
"x-unit": "degrees",
|
|
882
|
+
minimum: 0,
|
|
883
|
+
maximum: 360,
|
|
884
|
+
examples: [175]
|
|
885
|
+
},
|
|
886
|
+
timestamp: {
|
|
887
|
+
type: "string",
|
|
888
|
+
format: "date-time",
|
|
889
|
+
description: "ISO 8601 / RFC 3339 UTC timestamp at which this point was captured. The Go writer renders it as `Timestamp.Format(time.RFC3339)` (telemetry/internal/store/drive_mapper.go). P0 in isolation but encrypted at rest alongside the parent P1 routePoints column.",
|
|
890
|
+
"x-classification": "P0",
|
|
891
|
+
examples: ["2026-04-13T18:22:00Z"]
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
|
|
818
898
|
// schemas/ws-messages.schema.json
|
|
819
899
|
var ws_messages_schema_default = {
|
|
820
900
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -1187,6 +1267,7 @@ var schemas = {
|
|
|
1187
1267
|
vehicleSummary: vehicle_summary_schema_default,
|
|
1188
1268
|
drivesList: drives_list_schema_default,
|
|
1189
1269
|
driveDetail: drive_detail_schema_default,
|
|
1270
|
+
driveRoute: drive_route_schema_default,
|
|
1190
1271
|
wsMessages: ws_messages_schema_default,
|
|
1191
1272
|
wsEnvelope: ws_envelope_schema_default
|
|
1192
1273
|
};
|