@m1kad0/hannah-proto 0.3.6 → 0.3.7

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/hannah.d.ts CHANGED
@@ -8,6 +8,7 @@ import { ProvisionSatelliteRequest } from "./satellite_provisioning";
8
8
  import { ProxyCommand, ProxyHeartbeat, SatelliteRegistration, SubmitSatelliteAudioRequest, SubmitSatelliteAudioResponse } from "./satellite_proxy";
9
9
  import { Empty, StatusResponse } from "./shared";
10
10
  import { EnrollVoiceprintRequest } from "./speaker_enrollment";
11
+ import { DeleteTimerRequest, GetTimersRequest, GetTimersResponse } from "./timer_admin";
11
12
  import { TimerCommand, TimerMessage } from "./timer_service";
12
13
  import { CreateUserRequest, CreateUserResponse, DeleteUserRequest, GetResidentsResponse, GetUserRequest, GetUsersRequest, GetUsersResponse, LinkAccountRequest, LoginRequest, SetSystemMessagesRequest, SetTrustLevelRequest, UnlinkAccountRequest, UpdateUserRequest, UserResponse } from "./user_registry";
13
14
  import { SatelliteAudioChunk, SatelliteCaptureRequest, SatelliteCaptureResponse, TriggerPlinkRequest } from "./wakeword_capture";
@@ -685,6 +686,29 @@ export declare const HannahServiceService: {
685
686
  readonly responseSerialize: (value: TimerCommand) => Buffer;
686
687
  readonly responseDeserialize: (value: Buffer) => TimerCommand;
687
688
  };
689
+ /**
690
+ * --- Timer Admin ---
691
+ * Query and cancel timers independent of the TimerConnect stream — e.g. for an
692
+ * Admin-UI or Telegram bot listing/cancelling a user's active timers.
693
+ */
694
+ readonly getTimers: {
695
+ readonly path: "/hannah.HannahService/GetTimers";
696
+ readonly requestStream: false;
697
+ readonly responseStream: false;
698
+ readonly requestSerialize: (value: GetTimersRequest) => Buffer;
699
+ readonly requestDeserialize: (value: Buffer) => GetTimersRequest;
700
+ readonly responseSerialize: (value: GetTimersResponse) => Buffer;
701
+ readonly responseDeserialize: (value: Buffer) => GetTimersResponse;
702
+ };
703
+ readonly deleteTimer: {
704
+ readonly path: "/hannah.HannahService/DeleteTimer";
705
+ readonly requestStream: false;
706
+ readonly responseStream: false;
707
+ readonly requestSerialize: (value: DeleteTimerRequest) => Buffer;
708
+ readonly requestDeserialize: (value: Buffer) => DeleteTimerRequest;
709
+ readonly responseSerialize: (value: StatusResponse) => Buffer;
710
+ readonly responseDeserialize: (value: Buffer) => StatusResponse;
711
+ };
688
712
  /**
689
713
  * --- ioBroker Agent ---
690
714
  * Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
@@ -854,6 +878,13 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
854
878
  * Hannah sends timer commands (create, cancel, list); the service fires events when timers expire.
855
879
  */
856
880
  timerConnect: handleBidiStreamingCall<TimerMessage, TimerCommand>;
881
+ /**
882
+ * --- Timer Admin ---
883
+ * Query and cancel timers independent of the TimerConnect stream — e.g. for an
884
+ * Admin-UI or Telegram bot listing/cancelling a user's active timers.
885
+ */
886
+ getTimers: handleUnaryCall<GetTimersRequest, GetTimersResponse>;
887
+ deleteTimer: handleUnaryCall<DeleteTimerRequest, StatusResponse>;
857
888
  /**
858
889
  * --- ioBroker Agent ---
859
890
  * Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
@@ -1143,6 +1174,17 @@ export interface HannahServiceClient extends Client {
1143
1174
  timerConnect(): ClientDuplexStream<TimerMessage, TimerCommand>;
1144
1175
  timerConnect(options: Partial<CallOptions>): ClientDuplexStream<TimerMessage, TimerCommand>;
1145
1176
  timerConnect(metadata: Metadata, options?: Partial<CallOptions>): ClientDuplexStream<TimerMessage, TimerCommand>;
1177
+ /**
1178
+ * --- Timer Admin ---
1179
+ * Query and cancel timers independent of the TimerConnect stream — e.g. for an
1180
+ * Admin-UI or Telegram bot listing/cancelling a user's active timers.
1181
+ */
1182
+ getTimers(request: GetTimersRequest, callback: (error: ServiceError | null, response: GetTimersResponse) => void): ClientUnaryCall;
1183
+ getTimers(request: GetTimersRequest, metadata: Metadata, callback: (error: ServiceError | null, response: GetTimersResponse) => void): ClientUnaryCall;
1184
+ getTimers(request: GetTimersRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetTimersResponse) => void): ClientUnaryCall;
1185
+ deleteTimer(request: DeleteTimerRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1186
+ deleteTimer(request: DeleteTimerRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1187
+ deleteTimer(request: DeleteTimerRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1146
1188
  /**
1147
1189
  * --- ioBroker Agent ---
1148
1190
  * Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
package/dist/hannah.js CHANGED
@@ -17,6 +17,7 @@ const satellite_provisioning_1 = require("./satellite_provisioning");
17
17
  const satellite_proxy_1 = require("./satellite_proxy");
18
18
  const shared_1 = require("./shared");
19
19
  const speaker_enrollment_1 = require("./speaker_enrollment");
20
+ const timer_admin_1 = require("./timer_admin");
20
21
  const timer_service_1 = require("./timer_service");
21
22
  const user_registry_1 = require("./user_registry");
22
23
  const wakeword_capture_1 = require("./wakeword_capture");
@@ -693,6 +694,29 @@ exports.HannahServiceService = {
693
694
  responseSerialize: (value) => Buffer.from(timer_service_1.TimerCommand.encode(value).finish()),
694
695
  responseDeserialize: (value) => timer_service_1.TimerCommand.decode(value),
695
696
  },
697
+ /**
698
+ * --- Timer Admin ---
699
+ * Query and cancel timers independent of the TimerConnect stream — e.g. for an
700
+ * Admin-UI or Telegram bot listing/cancelling a user's active timers.
701
+ */
702
+ getTimers: {
703
+ path: "/hannah.HannahService/GetTimers",
704
+ requestStream: false,
705
+ responseStream: false,
706
+ requestSerialize: (value) => Buffer.from(timer_admin_1.GetTimersRequest.encode(value).finish()),
707
+ requestDeserialize: (value) => timer_admin_1.GetTimersRequest.decode(value),
708
+ responseSerialize: (value) => Buffer.from(timer_admin_1.GetTimersResponse.encode(value).finish()),
709
+ responseDeserialize: (value) => timer_admin_1.GetTimersResponse.decode(value),
710
+ },
711
+ deleteTimer: {
712
+ path: "/hannah.HannahService/DeleteTimer",
713
+ requestStream: false,
714
+ responseStream: false,
715
+ requestSerialize: (value) => Buffer.from(timer_admin_1.DeleteTimerRequest.encode(value).finish()),
716
+ requestDeserialize: (value) => timer_admin_1.DeleteTimerRequest.decode(value),
717
+ responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
718
+ responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
719
+ },
696
720
  /**
697
721
  * --- ioBroker Agent ---
698
722
  * Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * as satellite_provisioning from './satellite_provisioning';
9
9
  export * as satellite_proxy from './satellite_proxy';
10
10
  export * as shared from './shared';
11
11
  export * as speaker_enrollment from './speaker_enrollment';
12
+ export * as timer_admin from './timer_admin';
12
13
  export * as timer_service from './timer_service';
13
14
  export * as user_registry from './user_registry';
14
15
  export * as wakeword_capture from './wakeword_capture';
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.wakeword_capture = exports.user_registry = exports.timer_service = exports.speaker_enrollment = exports.shared = exports.satellite_proxy = exports.satellite_provisioning = exports.hannah = exports.event_stream = exports.device_control_menu = exports.control = exports.car_state = exports.agent = void 0;
39
+ exports.wakeword_capture = exports.user_registry = exports.timer_service = exports.timer_admin = exports.speaker_enrollment = exports.shared = exports.satellite_proxy = exports.satellite_provisioning = exports.hannah = exports.event_stream = exports.device_control_menu = exports.control = exports.car_state = exports.agent = void 0;
40
40
  __exportStar(require("./version"), exports);
41
41
  exports.agent = __importStar(require("./agent"));
42
42
  exports.car_state = __importStar(require("./car_state"));
@@ -48,6 +48,7 @@ exports.satellite_provisioning = __importStar(require("./satellite_provisioning"
48
48
  exports.satellite_proxy = __importStar(require("./satellite_proxy"));
49
49
  exports.shared = __importStar(require("./shared"));
50
50
  exports.speaker_enrollment = __importStar(require("./speaker_enrollment"));
51
+ exports.timer_admin = __importStar(require("./timer_admin"));
51
52
  exports.timer_service = __importStar(require("./timer_service"));
52
53
  exports.user_registry = __importStar(require("./user_registry"));
53
54
  exports.wakeword_capture = __importStar(require("./wakeword_capture"));
@@ -0,0 +1,42 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "hannah";
3
+ export interface Timer {
4
+ timerId: string;
5
+ label: string;
6
+ /** remaining seconds until fire, computed relative to now */
7
+ seconds: bigint;
8
+ roomId: string;
9
+ userId: number;
10
+ }
11
+ export interface GetTimersRequest {
12
+ userId: number;
13
+ }
14
+ export interface GetTimersResponse {
15
+ timers: Timer[];
16
+ }
17
+ export interface DeleteTimerRequest {
18
+ timerId: string;
19
+ /** caller performing the deletion, may differ from the timer's owner */
20
+ requestorId: number;
21
+ }
22
+ export declare const Timer: MessageFns<Timer>;
23
+ export declare const GetTimersRequest: MessageFns<GetTimersRequest>;
24
+ export declare const GetTimersResponse: MessageFns<GetTimersResponse>;
25
+ export declare const DeleteTimerRequest: MessageFns<DeleteTimerRequest>;
26
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
27
+ export type DeepPartial<T> = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
28
+ [K in keyof T]?: DeepPartial<T[K]>;
29
+ } : Partial<T>;
30
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
31
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
32
+ [K in keyof P]: Exact<P[K], I[K]>;
33
+ } & {
34
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
35
+ };
36
+ export interface MessageFns<T> {
37
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
38
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
39
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
40
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
41
+ }
42
+ export {};
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.12.0
5
+ // protoc unknown
6
+ // source: timer_admin.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DeleteTimerRequest = exports.GetTimersResponse = exports.GetTimersRequest = exports.Timer = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ exports.protobufPackage = "hannah";
12
+ function createBaseTimer() {
13
+ return { timerId: "", label: "", seconds: 0n, roomId: "", userId: 0 };
14
+ }
15
+ exports.Timer = {
16
+ encode(message, writer = new wire_1.BinaryWriter()) {
17
+ if (message.timerId !== "") {
18
+ writer.uint32(10).string(message.timerId);
19
+ }
20
+ if (message.label !== "") {
21
+ writer.uint32(18).string(message.label);
22
+ }
23
+ if (message.seconds !== 0n) {
24
+ if (BigInt.asIntN(64, message.seconds) !== message.seconds) {
25
+ throw new globalThis.Error("value provided for field message.seconds of type int64 too large");
26
+ }
27
+ writer.uint32(24).int64(message.seconds);
28
+ }
29
+ if (message.roomId !== "") {
30
+ writer.uint32(34).string(message.roomId);
31
+ }
32
+ if (message.userId !== 0) {
33
+ writer.uint32(40).int32(message.userId);
34
+ }
35
+ return writer;
36
+ },
37
+ decode(input, length) {
38
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
39
+ const end = length === undefined ? reader.len : reader.pos + length;
40
+ const message = createBaseTimer();
41
+ while (reader.pos < end) {
42
+ const tag = reader.uint32();
43
+ switch (tag >>> 3) {
44
+ case 1: {
45
+ if (tag !== 10) {
46
+ break;
47
+ }
48
+ message.timerId = reader.string();
49
+ continue;
50
+ }
51
+ case 2: {
52
+ if (tag !== 18) {
53
+ break;
54
+ }
55
+ message.label = reader.string();
56
+ continue;
57
+ }
58
+ case 3: {
59
+ if (tag !== 24) {
60
+ break;
61
+ }
62
+ message.seconds = reader.int64();
63
+ continue;
64
+ }
65
+ case 4: {
66
+ if (tag !== 34) {
67
+ break;
68
+ }
69
+ message.roomId = reader.string();
70
+ continue;
71
+ }
72
+ case 5: {
73
+ if (tag !== 40) {
74
+ break;
75
+ }
76
+ message.userId = reader.int32();
77
+ continue;
78
+ }
79
+ }
80
+ if ((tag & 7) === 4 || tag === 0) {
81
+ break;
82
+ }
83
+ reader.skip(tag & 7);
84
+ }
85
+ return message;
86
+ },
87
+ create(base) {
88
+ return exports.Timer.fromPartial(base ?? {});
89
+ },
90
+ fromPartial(object) {
91
+ const message = createBaseTimer();
92
+ message.timerId = object.timerId ?? "";
93
+ message.label = object.label ?? "";
94
+ message.seconds = (object.seconds !== undefined && object.seconds !== null) ? BigInt(object.seconds) : 0n;
95
+ message.roomId = object.roomId ?? "";
96
+ message.userId = object.userId ?? 0;
97
+ return message;
98
+ },
99
+ };
100
+ function createBaseGetTimersRequest() {
101
+ return { userId: 0 };
102
+ }
103
+ exports.GetTimersRequest = {
104
+ encode(message, writer = new wire_1.BinaryWriter()) {
105
+ if (message.userId !== 0) {
106
+ writer.uint32(8).int32(message.userId);
107
+ }
108
+ return writer;
109
+ },
110
+ decode(input, length) {
111
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
112
+ const end = length === undefined ? reader.len : reader.pos + length;
113
+ const message = createBaseGetTimersRequest();
114
+ while (reader.pos < end) {
115
+ const tag = reader.uint32();
116
+ switch (tag >>> 3) {
117
+ case 1: {
118
+ if (tag !== 8) {
119
+ break;
120
+ }
121
+ message.userId = reader.int32();
122
+ continue;
123
+ }
124
+ }
125
+ if ((tag & 7) === 4 || tag === 0) {
126
+ break;
127
+ }
128
+ reader.skip(tag & 7);
129
+ }
130
+ return message;
131
+ },
132
+ create(base) {
133
+ return exports.GetTimersRequest.fromPartial(base ?? {});
134
+ },
135
+ fromPartial(object) {
136
+ const message = createBaseGetTimersRequest();
137
+ message.userId = object.userId ?? 0;
138
+ return message;
139
+ },
140
+ };
141
+ function createBaseGetTimersResponse() {
142
+ return { timers: [] };
143
+ }
144
+ exports.GetTimersResponse = {
145
+ encode(message, writer = new wire_1.BinaryWriter()) {
146
+ for (const v of message.timers) {
147
+ exports.Timer.encode(v, writer.uint32(10).fork()).join();
148
+ }
149
+ return writer;
150
+ },
151
+ decode(input, length) {
152
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
153
+ const end = length === undefined ? reader.len : reader.pos + length;
154
+ const message = createBaseGetTimersResponse();
155
+ while (reader.pos < end) {
156
+ const tag = reader.uint32();
157
+ switch (tag >>> 3) {
158
+ case 1: {
159
+ if (tag !== 10) {
160
+ break;
161
+ }
162
+ message.timers.push(exports.Timer.decode(reader, reader.uint32()));
163
+ continue;
164
+ }
165
+ }
166
+ if ((tag & 7) === 4 || tag === 0) {
167
+ break;
168
+ }
169
+ reader.skip(tag & 7);
170
+ }
171
+ return message;
172
+ },
173
+ create(base) {
174
+ return exports.GetTimersResponse.fromPartial(base ?? {});
175
+ },
176
+ fromPartial(object) {
177
+ const message = createBaseGetTimersResponse();
178
+ message.timers = object.timers?.map((e) => exports.Timer.fromPartial(e)) || [];
179
+ return message;
180
+ },
181
+ };
182
+ function createBaseDeleteTimerRequest() {
183
+ return { timerId: "", requestorId: 0 };
184
+ }
185
+ exports.DeleteTimerRequest = {
186
+ encode(message, writer = new wire_1.BinaryWriter()) {
187
+ if (message.timerId !== "") {
188
+ writer.uint32(10).string(message.timerId);
189
+ }
190
+ if (message.requestorId !== 0) {
191
+ writer.uint32(16).int32(message.requestorId);
192
+ }
193
+ return writer;
194
+ },
195
+ decode(input, length) {
196
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
197
+ const end = length === undefined ? reader.len : reader.pos + length;
198
+ const message = createBaseDeleteTimerRequest();
199
+ while (reader.pos < end) {
200
+ const tag = reader.uint32();
201
+ switch (tag >>> 3) {
202
+ case 1: {
203
+ if (tag !== 10) {
204
+ break;
205
+ }
206
+ message.timerId = reader.string();
207
+ continue;
208
+ }
209
+ case 2: {
210
+ if (tag !== 16) {
211
+ break;
212
+ }
213
+ message.requestorId = reader.int32();
214
+ continue;
215
+ }
216
+ }
217
+ if ((tag & 7) === 4 || tag === 0) {
218
+ break;
219
+ }
220
+ reader.skip(tag & 7);
221
+ }
222
+ return message;
223
+ },
224
+ create(base) {
225
+ return exports.DeleteTimerRequest.fromPartial(base ?? {});
226
+ },
227
+ fromPartial(object) {
228
+ const message = createBaseDeleteTimerRequest();
229
+ message.timerId = object.timerId ?? "";
230
+ message.requestorId = object.requestorId ?? 0;
231
+ return message;
232
+ },
233
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kad0/hannah-proto",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Generated TypeScript gRPC-js client stubs for the Hannah voice assistant proto schema",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",