@myrobotaxi/contracts 0.2.0 → 0.4.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/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthOkPayload, AuthPayload, ConnectivityPayload, DriveEndedPayload, DriveStartedPayload, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, SubscribePayload, UnsubscribePayload, VehicleState, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.cjs';
1
+ export { AuthOkPayload, AuthPayload, ConnectivityPayload, DriveEndedPayload, DriveStartedPayload, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, SubscribePayload, UnsubscribePayload, VehicleListResponse, VehicleState, VehicleSummary, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.cjs';
2
2
 
3
3
  declare const schemas: {
4
4
  readonly vehicleState: {
@@ -284,6 +284,104 @@ declare const schemas: {
284
284
  originLongitude: string[];
285
285
  };
286
286
  };
287
+ readonly vehicleSummary: {
288
+ $schema: string;
289
+ $id: string;
290
+ title: string;
291
+ description: string;
292
+ type: string;
293
+ additionalProperties: boolean;
294
+ required: string[];
295
+ properties: {
296
+ items: {
297
+ type: string;
298
+ description: string;
299
+ items: {
300
+ $ref: string;
301
+ };
302
+ };
303
+ };
304
+ $defs: {
305
+ VehicleSummary: {
306
+ title: string;
307
+ description: string;
308
+ type: string;
309
+ additionalProperties: boolean;
310
+ required: string[];
311
+ properties: {
312
+ vehicleId: {
313
+ type: string;
314
+ description: string;
315
+ "x-classification": string;
316
+ examples: string[];
317
+ };
318
+ name: {
319
+ type: string;
320
+ description: string;
321
+ "x-classification": string;
322
+ examples: string[];
323
+ };
324
+ model: {
325
+ type: string;
326
+ description: string;
327
+ "x-classification": string;
328
+ examples: string[];
329
+ };
330
+ year: {
331
+ type: string;
332
+ description: string;
333
+ "x-classification": string;
334
+ examples: number[];
335
+ };
336
+ color: {
337
+ type: string;
338
+ description: string;
339
+ "x-classification": string;
340
+ examples: string[];
341
+ };
342
+ vinLast4: {
343
+ type: string;
344
+ description: string;
345
+ "x-classification": string;
346
+ examples: string[];
347
+ };
348
+ status: {
349
+ type: string;
350
+ enum: string[];
351
+ description: string;
352
+ "x-classification": string;
353
+ };
354
+ chargeLevel: {
355
+ type: string;
356
+ description: string;
357
+ "x-classification": string;
358
+ "x-unit": string;
359
+ minimum: number;
360
+ maximum: number;
361
+ };
362
+ estimatedRange: {
363
+ type: string;
364
+ description: string;
365
+ "x-classification": string;
366
+ "x-unit": string;
367
+ minimum: number;
368
+ };
369
+ lastUpdated: {
370
+ type: string;
371
+ format: string;
372
+ description: string;
373
+ "x-classification": string;
374
+ };
375
+ role: {
376
+ type: string;
377
+ enum: string[];
378
+ description: string;
379
+ "x-classification": string;
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
287
385
  readonly wsMessages: {
288
386
  $schema: string;
289
387
  $id: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthOkPayload, AuthPayload, ConnectivityPayload, DriveEndedPayload, DriveStartedPayload, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, SubscribePayload, UnsubscribePayload, VehicleState, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.js';
1
+ export { AuthOkPayload, AuthPayload, ConnectivityPayload, DriveEndedPayload, DriveStartedPayload, ErrorPayload, HeartbeatPayload, MessageType, PingPayload, PongPayload, SubscribePayload, UnsubscribePayload, VehicleListResponse, VehicleState, VehicleSummary, VehicleUpdatePayload, WebSocketEnvelope, WebSocketMessages } from './types.js';
2
2
 
3
3
  declare const schemas: {
4
4
  readonly vehicleState: {
@@ -284,6 +284,104 @@ declare const schemas: {
284
284
  originLongitude: string[];
285
285
  };
286
286
  };
287
+ readonly vehicleSummary: {
288
+ $schema: string;
289
+ $id: string;
290
+ title: string;
291
+ description: string;
292
+ type: string;
293
+ additionalProperties: boolean;
294
+ required: string[];
295
+ properties: {
296
+ items: {
297
+ type: string;
298
+ description: string;
299
+ items: {
300
+ $ref: string;
301
+ };
302
+ };
303
+ };
304
+ $defs: {
305
+ VehicleSummary: {
306
+ title: string;
307
+ description: string;
308
+ type: string;
309
+ additionalProperties: boolean;
310
+ required: string[];
311
+ properties: {
312
+ vehicleId: {
313
+ type: string;
314
+ description: string;
315
+ "x-classification": string;
316
+ examples: string[];
317
+ };
318
+ name: {
319
+ type: string;
320
+ description: string;
321
+ "x-classification": string;
322
+ examples: string[];
323
+ };
324
+ model: {
325
+ type: string;
326
+ description: string;
327
+ "x-classification": string;
328
+ examples: string[];
329
+ };
330
+ year: {
331
+ type: string;
332
+ description: string;
333
+ "x-classification": string;
334
+ examples: number[];
335
+ };
336
+ color: {
337
+ type: string;
338
+ description: string;
339
+ "x-classification": string;
340
+ examples: string[];
341
+ };
342
+ vinLast4: {
343
+ type: string;
344
+ description: string;
345
+ "x-classification": string;
346
+ examples: string[];
347
+ };
348
+ status: {
349
+ type: string;
350
+ enum: string[];
351
+ description: string;
352
+ "x-classification": string;
353
+ };
354
+ chargeLevel: {
355
+ type: string;
356
+ description: string;
357
+ "x-classification": string;
358
+ "x-unit": string;
359
+ minimum: number;
360
+ maximum: number;
361
+ };
362
+ estimatedRange: {
363
+ type: string;
364
+ description: string;
365
+ "x-classification": string;
366
+ "x-unit": string;
367
+ minimum: number;
368
+ };
369
+ lastUpdated: {
370
+ type: string;
371
+ format: string;
372
+ description: string;
373
+ "x-classification": string;
374
+ };
375
+ role: {
376
+ type: string;
377
+ enum: string[];
378
+ description: string;
379
+ "x-classification": string;
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
287
385
  readonly wsMessages: {
288
386
  $schema: string;
289
387
  $id: string;
package/dist/index.js CHANGED
@@ -343,6 +343,116 @@ var vehicle_state_schema_default = {
343
343
  }
344
344
  };
345
345
 
346
+ // schemas/vehicle-summary.schema.json
347
+ var vehicle_summary_schema_default = {
348
+ $schema: "https://json-schema.org/draft/2020-12/schema",
349
+ $id: "https://myrobotaxi.com/schemas/vehicle-summary.schema.json",
350
+ title: "VehicleListResponse",
351
+ description: "Envelope returned by GET /api/vehicles. Wraps an array of VehicleSummary rows under the `items` key. Pagination fields are reserved per rest-api.md \xA77.0 and intentionally absent in v1. The envelope itself is part of the wire contract: consumers MUST NOT strip it silently.",
352
+ type: "object",
353
+ additionalProperties: false,
354
+ required: ["items"],
355
+ properties: {
356
+ items: {
357
+ type: "array",
358
+ description: "Per-vehicle summary rows for vehicles the caller has access to. Order is server-defined (currently ORDER BY Vehicle.createdAt ASC in the telemetry list query). An empty array means the caller has no vehicles (or is a v1 viewer-tier caller \u2014 see rest-api.md \xA77.0 RBAC v1 implementation note).",
359
+ items: { $ref: "#/$defs/VehicleSummary" }
360
+ }
361
+ },
362
+ $defs: {
363
+ VehicleSummary: {
364
+ title: "VehicleSummary",
365
+ description: "Lean per-vehicle row returned by GET /api/vehicles. A list-view projection of VehicleState containing only the fields the catalog UI needs (identity, model/year/color, status, charge headline, last-updated). No GPS, no navigation, no climate, no encrypted-at-rest fields. Mirrors the Go `vehicleSummary` struct in telemetry/internal/telemetry/vehicles_list_handler.go and the `VehicleSummary` shape in telemetry/specs/rest.openapi.yaml. Use VehicleState for the full snapshot/WebSocket payload; use VehicleSummary for list endpoints.",
366
+ type: "object",
367
+ additionalProperties: false,
368
+ required: [
369
+ "vehicleId",
370
+ "name",
371
+ "model",
372
+ "year",
373
+ "color",
374
+ "vinLast4",
375
+ "status",
376
+ "chargeLevel",
377
+ "estimatedRange",
378
+ "lastUpdated",
379
+ "role"
380
+ ],
381
+ properties: {
382
+ vehicleId: {
383
+ type: "string",
384
+ description: "Opaque database identifier (cuid). NOT the VIN. All SDK API calls use this ID (FR-4.2). Matches VehicleState.vehicleId.",
385
+ "x-classification": "P0",
386
+ examples: ["clxyz1234567890abcdef"]
387
+ },
388
+ name: {
389
+ type: "string",
390
+ description: "User-assigned vehicle name from DB Vehicle.name. Matches VehicleState.name.",
391
+ "x-classification": "P0",
392
+ examples: ["Optimus"]
393
+ },
394
+ model: {
395
+ type: "string",
396
+ description: "Vehicle model (e.g., 'Model 3', 'Model Y'). Sourced from DB Vehicle.model. Matches VehicleState.model.",
397
+ "x-classification": "P0",
398
+ examples: ["Model 3"]
399
+ },
400
+ year: {
401
+ type: "integer",
402
+ description: "Model year. Sourced from DB Vehicle.year. Matches VehicleState.year.",
403
+ "x-classification": "P0",
404
+ examples: [2024]
405
+ },
406
+ color: {
407
+ type: "string",
408
+ description: "Vehicle exterior color. Sourced from DB Vehicle.color. Matches VehicleState.color.",
409
+ "x-classification": "P0",
410
+ examples: ["Midnight Silver Metallic"]
411
+ },
412
+ vinLast4: {
413
+ type: "string",
414
+ description: "Last 4 characters of the vehicle's 17-character VIN. The full VIN is never emitted on the list endpoint \u2014 vinLast4 is sufficient for human disambiguation in the catalog UI without exposing the full identifier. Empty string when the VIN is unknown.",
415
+ "x-classification": "P1",
416
+ examples: ["3F5A"]
417
+ },
418
+ status: {
419
+ type: "string",
420
+ enum: ["driving", "parked", "charging", "offline", "in_service"],
421
+ description: "Derived vehicle status snapshot at the time of the last telemetry update. Same enum as VehicleState.status.",
422
+ "x-classification": "P0"
423
+ },
424
+ chargeLevel: {
425
+ type: "integer",
426
+ description: "Battery state of charge snapshot at the time of the last telemetry update. Same semantics as VehicleState.chargeLevel.",
427
+ "x-classification": "P0",
428
+ "x-unit": "percent",
429
+ minimum: 0,
430
+ maximum: 100
431
+ },
432
+ estimatedRange: {
433
+ type: "integer",
434
+ description: "Estimated remaining driving range snapshot at the time of the last telemetry update. Same semantics as VehicleState.estimatedRange.",
435
+ "x-classification": "P0",
436
+ "x-unit": "miles",
437
+ minimum: 0
438
+ },
439
+ lastUpdated: {
440
+ type: "string",
441
+ format: "date-time",
442
+ description: "ISO 8601 timestamp of the most recent telemetry update applied to this vehicle. Same semantics as VehicleState.lastUpdated. Telemetry emits RFC 3339 UTC strings (e.g., '2026-05-25T17:30:00Z').",
443
+ "x-classification": "P0"
444
+ },
445
+ role: {
446
+ type: "string",
447
+ enum: ["owner", "viewer"],
448
+ description: "RBAC role the caller holds against this vehicle. v1 only emits 'owner' rows (every vehicle returned is one the caller owns via Vehicle.userId). The 'viewer' value is reserved for the viewer-merged invite-read pathway tracked as a follow-up \u2014 see rest-api.md \xA77.0 RBAC v1 implementation note.",
449
+ "x-classification": "P0"
450
+ }
451
+ }
452
+ }
453
+ }
454
+ };
455
+
346
456
  // schemas/ws-messages.schema.json
347
457
  var ws_messages_schema_default = {
348
458
  $schema: "https://json-schema.org/draft/2020-12/schema",
@@ -712,6 +822,7 @@ var ws_envelope_schema_default = {
712
822
  // src/index.ts
713
823
  var schemas = {
714
824
  vehicleState: vehicle_state_schema_default,
825
+ vehicleSummary: vehicle_summary_schema_default,
715
826
  wsMessages: ws_messages_schema_default,
716
827
  wsEnvelope: ws_envelope_schema_default
717
828
  };