src/messages builds Response, StateReport, DeferredResponse, ErrorResponse, ChangeReport and the scene, doorbell and simple events from plain values; messageId and times are parameters, so a test compares whole objects. StateBuilder collects properties checked by the descriptors, AlexaError and AlexaErrors carry the payload fields of an error type. AlexaStatusMessage and AlexaErrorResponse move to src/compat and are written on the builders. On the wire, against 1.5.2: a DeferredResponse has no context key, a ChangeReport has no correlationToken, the namespace of an ErrorResponse follows its type, and a ChangeReport without a changed property is not published: send() resolves "" and the bridge reports an error that names the endpoint. 143 tests pass (108 before). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
16 lines
896 B
TypeScript
16 lines
896 B
TypeScript
import type { Property } from "./types.js";
|
|
export interface PropertyOptions {
|
|
/** The instance of a generic controller: "Blind.Lift". */
|
|
instance?: string;
|
|
/**
|
|
* When the value last changed. Default: now. message-guide.html, "Property object": "don't set the same
|
|
* timeOfSample value for all properties", so a device that knows when each value changed passes it.
|
|
*/
|
|
timeOfSample?: string | Date;
|
|
/** How old the value may be, for a device that is polled. Default: 0. */
|
|
uncertaintyInMilliseconds?: number;
|
|
}
|
|
/** A time as Alexa wants it: ISO 8601 in UTC. Text is taken as given. */
|
|
export declare function isoTime(time?: string | Date): string;
|
|
/** One property of a context or of a change, its fields in the order of the examples. */
|
|
export declare function property(namespace: string, name: string, value: unknown, options?: PropertyOptions): Property;
|