@m1kad0/hannah-proto 0.3.6 → 0.3.8
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/automation.d.ts +54 -0
- package/dist/automation.js +253 -0
- package/dist/hannah.d.ts +109 -1
- package/dist/hannah.js +56 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/timer_admin.d.ts +42 -0
- package/dist/timer_admin.js +233 -0
- package/dist/user_registry.d.ts +12 -0
- package/dist/user_registry.js +76 -1
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "hannah";
|
|
3
|
+
/** Sent by an automation service (e.g. telegram_autoresponder) over the AutomationConnect stream. */
|
|
4
|
+
export interface AutomationMessage {
|
|
5
|
+
/** sent once, right after connecting */
|
|
6
|
+
register?: AutomationRegister | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Identifies which automation this connection represents. */
|
|
9
|
+
export interface AutomationRegister {
|
|
10
|
+
/** e.g. "telegram_autoresponder" */
|
|
11
|
+
automation: string;
|
|
12
|
+
}
|
|
13
|
+
/** Sent by Hannah Core over the AutomationConnect stream. */
|
|
14
|
+
export interface AutomationCommand {
|
|
15
|
+
/** sent once, right after register */
|
|
16
|
+
snapshot?: AutomationSnapshot | undefined;
|
|
17
|
+
/** live delta */
|
|
18
|
+
stateChanged?: AutomationStateChanged | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Full list of users with the registered automation currently enabled.
|
|
22
|
+
* Sent once per connection, right after AutomationRegister — the recovery
|
|
23
|
+
* mechanism for state changes that happened while the service was offline.
|
|
24
|
+
*/
|
|
25
|
+
export interface AutomationSnapshot {
|
|
26
|
+
userIds: number[];
|
|
27
|
+
}
|
|
28
|
+
/** A single user's enabled/disabled state changed for the registered automation. */
|
|
29
|
+
export interface AutomationStateChanged {
|
|
30
|
+
userId: number;
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const AutomationMessage: MessageFns<AutomationMessage>;
|
|
34
|
+
export declare const AutomationRegister: MessageFns<AutomationRegister>;
|
|
35
|
+
export declare const AutomationCommand: MessageFns<AutomationCommand>;
|
|
36
|
+
export declare const AutomationSnapshot: MessageFns<AutomationSnapshot>;
|
|
37
|
+
export declare const AutomationStateChanged: MessageFns<AutomationStateChanged>;
|
|
38
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
39
|
+
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 {} ? {
|
|
40
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
41
|
+
} : Partial<T>;
|
|
42
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
43
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
44
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
45
|
+
} & {
|
|
46
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
47
|
+
};
|
|
48
|
+
export interface MessageFns<T> {
|
|
49
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
50
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
51
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
52
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,253 @@
|
|
|
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: automation.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AutomationStateChanged = exports.AutomationSnapshot = exports.AutomationCommand = exports.AutomationRegister = exports.AutomationMessage = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
exports.protobufPackage = "hannah";
|
|
12
|
+
function createBaseAutomationMessage() {
|
|
13
|
+
return { register: undefined };
|
|
14
|
+
}
|
|
15
|
+
exports.AutomationMessage = {
|
|
16
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
17
|
+
if (message.register !== undefined) {
|
|
18
|
+
exports.AutomationRegister.encode(message.register, writer.uint32(10).fork()).join();
|
|
19
|
+
}
|
|
20
|
+
return writer;
|
|
21
|
+
},
|
|
22
|
+
decode(input, length) {
|
|
23
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
24
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
25
|
+
const message = createBaseAutomationMessage();
|
|
26
|
+
while (reader.pos < end) {
|
|
27
|
+
const tag = reader.uint32();
|
|
28
|
+
switch (tag >>> 3) {
|
|
29
|
+
case 1: {
|
|
30
|
+
if (tag !== 10) {
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
message.register = exports.AutomationRegister.decode(reader, reader.uint32());
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
reader.skip(tag & 7);
|
|
41
|
+
}
|
|
42
|
+
return message;
|
|
43
|
+
},
|
|
44
|
+
create(base) {
|
|
45
|
+
return exports.AutomationMessage.fromPartial(base ?? {});
|
|
46
|
+
},
|
|
47
|
+
fromPartial(object) {
|
|
48
|
+
const message = createBaseAutomationMessage();
|
|
49
|
+
message.register = (object.register !== undefined && object.register !== null)
|
|
50
|
+
? exports.AutomationRegister.fromPartial(object.register)
|
|
51
|
+
: undefined;
|
|
52
|
+
return message;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
function createBaseAutomationRegister() {
|
|
56
|
+
return { automation: "" };
|
|
57
|
+
}
|
|
58
|
+
exports.AutomationRegister = {
|
|
59
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
60
|
+
if (message.automation !== "") {
|
|
61
|
+
writer.uint32(10).string(message.automation);
|
|
62
|
+
}
|
|
63
|
+
return writer;
|
|
64
|
+
},
|
|
65
|
+
decode(input, length) {
|
|
66
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
67
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
68
|
+
const message = createBaseAutomationRegister();
|
|
69
|
+
while (reader.pos < end) {
|
|
70
|
+
const tag = reader.uint32();
|
|
71
|
+
switch (tag >>> 3) {
|
|
72
|
+
case 1: {
|
|
73
|
+
if (tag !== 10) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
message.automation = reader.string();
|
|
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.AutomationRegister.fromPartial(base ?? {});
|
|
89
|
+
},
|
|
90
|
+
fromPartial(object) {
|
|
91
|
+
const message = createBaseAutomationRegister();
|
|
92
|
+
message.automation = object.automation ?? "";
|
|
93
|
+
return message;
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
function createBaseAutomationCommand() {
|
|
97
|
+
return { snapshot: undefined, stateChanged: undefined };
|
|
98
|
+
}
|
|
99
|
+
exports.AutomationCommand = {
|
|
100
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
101
|
+
if (message.snapshot !== undefined) {
|
|
102
|
+
exports.AutomationSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
|
|
103
|
+
}
|
|
104
|
+
if (message.stateChanged !== undefined) {
|
|
105
|
+
exports.AutomationStateChanged.encode(message.stateChanged, writer.uint32(18).fork()).join();
|
|
106
|
+
}
|
|
107
|
+
return writer;
|
|
108
|
+
},
|
|
109
|
+
decode(input, length) {
|
|
110
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
111
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
112
|
+
const message = createBaseAutomationCommand();
|
|
113
|
+
while (reader.pos < end) {
|
|
114
|
+
const tag = reader.uint32();
|
|
115
|
+
switch (tag >>> 3) {
|
|
116
|
+
case 1: {
|
|
117
|
+
if (tag !== 10) {
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
message.snapshot = exports.AutomationSnapshot.decode(reader, reader.uint32());
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
case 2: {
|
|
124
|
+
if (tag !== 18) {
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
message.stateChanged = exports.AutomationStateChanged.decode(reader, reader.uint32());
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
reader.skip(tag & 7);
|
|
135
|
+
}
|
|
136
|
+
return message;
|
|
137
|
+
},
|
|
138
|
+
create(base) {
|
|
139
|
+
return exports.AutomationCommand.fromPartial(base ?? {});
|
|
140
|
+
},
|
|
141
|
+
fromPartial(object) {
|
|
142
|
+
const message = createBaseAutomationCommand();
|
|
143
|
+
message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
|
|
144
|
+
? exports.AutomationSnapshot.fromPartial(object.snapshot)
|
|
145
|
+
: undefined;
|
|
146
|
+
message.stateChanged = (object.stateChanged !== undefined && object.stateChanged !== null)
|
|
147
|
+
? exports.AutomationStateChanged.fromPartial(object.stateChanged)
|
|
148
|
+
: undefined;
|
|
149
|
+
return message;
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
function createBaseAutomationSnapshot() {
|
|
153
|
+
return { userIds: [] };
|
|
154
|
+
}
|
|
155
|
+
exports.AutomationSnapshot = {
|
|
156
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
157
|
+
writer.uint32(10).fork();
|
|
158
|
+
for (const v of message.userIds) {
|
|
159
|
+
writer.int32(v);
|
|
160
|
+
}
|
|
161
|
+
writer.join();
|
|
162
|
+
return writer;
|
|
163
|
+
},
|
|
164
|
+
decode(input, length) {
|
|
165
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
166
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
167
|
+
const message = createBaseAutomationSnapshot();
|
|
168
|
+
while (reader.pos < end) {
|
|
169
|
+
const tag = reader.uint32();
|
|
170
|
+
switch (tag >>> 3) {
|
|
171
|
+
case 1: {
|
|
172
|
+
if (tag === 8) {
|
|
173
|
+
message.userIds.push(reader.int32());
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
if (tag === 10) {
|
|
177
|
+
const end2 = reader.uint32() + reader.pos;
|
|
178
|
+
while (reader.pos < end2) {
|
|
179
|
+
message.userIds.push(reader.int32());
|
|
180
|
+
}
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
reader.skip(tag & 7);
|
|
190
|
+
}
|
|
191
|
+
return message;
|
|
192
|
+
},
|
|
193
|
+
create(base) {
|
|
194
|
+
return exports.AutomationSnapshot.fromPartial(base ?? {});
|
|
195
|
+
},
|
|
196
|
+
fromPartial(object) {
|
|
197
|
+
const message = createBaseAutomationSnapshot();
|
|
198
|
+
message.userIds = object.userIds?.map((e) => e) || [];
|
|
199
|
+
return message;
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
function createBaseAutomationStateChanged() {
|
|
203
|
+
return { userId: 0, enabled: false };
|
|
204
|
+
}
|
|
205
|
+
exports.AutomationStateChanged = {
|
|
206
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
207
|
+
if (message.userId !== 0) {
|
|
208
|
+
writer.uint32(8).int32(message.userId);
|
|
209
|
+
}
|
|
210
|
+
if (message.enabled !== false) {
|
|
211
|
+
writer.uint32(16).bool(message.enabled);
|
|
212
|
+
}
|
|
213
|
+
return writer;
|
|
214
|
+
},
|
|
215
|
+
decode(input, length) {
|
|
216
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
217
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
218
|
+
const message = createBaseAutomationStateChanged();
|
|
219
|
+
while (reader.pos < end) {
|
|
220
|
+
const tag = reader.uint32();
|
|
221
|
+
switch (tag >>> 3) {
|
|
222
|
+
case 1: {
|
|
223
|
+
if (tag !== 8) {
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
message.userId = reader.int32();
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
case 2: {
|
|
230
|
+
if (tag !== 16) {
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
message.enabled = reader.bool();
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
reader.skip(tag & 7);
|
|
241
|
+
}
|
|
242
|
+
return message;
|
|
243
|
+
},
|
|
244
|
+
create(base) {
|
|
245
|
+
return exports.AutomationStateChanged.fromPartial(base ?? {});
|
|
246
|
+
},
|
|
247
|
+
fromPartial(object) {
|
|
248
|
+
const message = createBaseAutomationStateChanged();
|
|
249
|
+
message.userId = object.userId ?? 0;
|
|
250
|
+
message.enabled = object.enabled ?? false;
|
|
251
|
+
return message;
|
|
252
|
+
},
|
|
253
|
+
};
|
package/dist/hannah.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CallOptions, type ChannelCredentials, Client, type ClientDuplexStream, type ClientOptions, type ClientReadableStream, type ClientUnaryCall, type handleBidiStreamingCall, type handleServerStreamingCall, type handleUnaryCall, type Metadata, type ServiceError, type UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
2
2
|
import { AgentCommand, AgentMessage, AgentNotification } from "./agent";
|
|
3
|
+
import { AutomationCommand, AutomationMessage } from "./automation";
|
|
3
4
|
import { CarStateResponse, GetAllCarStatesResponse } from "./car_state";
|
|
4
5
|
import { AnnounceRequest, CreateAlarmRequest, CreateAlarmResponse, CreateBleTagRequest, CreateBleTagResponse, CreateCarRequest, CreateCarResponse, CreateGroupRequest, CreateRoutineRequest, CreateRoutineResponse, CreateTriggerRequest, DeleteAlarmRequest, DeleteBleTagRequest, DeleteCarRequest, DeleteGroupRequest, DeleteRoutineRequest, DeleteSatelliteRequest, DeleteTriggerRequest, GetAlarmsResponse, GetBleTagsResponse, GetCarsResponse, GetGroupsResponse, GetRoomsResponse, GetRoutinesResponse, GetSatellitesResponse, GetSettingsResponse, GetTriggersResponse, SetGroupRoomsRequest, SetSatelliteDisplayNameRequest, SetSatelliteOwnerRequest, SetSatelliteRoomRequest, SubmitTextRequest, SubmitTextResponse, SubmitVoiceRequest, SubmitVoiceResponse, UpdateAlarmRequest, UpdateBleTagRequest, UpdateCarRequest, UpdateConfigRequest, UpdateGroupRequest, UpdateRoutineRequest, UpdateTriggerRequest } from "./control";
|
|
5
6
|
import { ControlDeviceRequest, GetDevicesResponse } from "./device_control_menu";
|
|
@@ -8,8 +9,9 @@ import { ProvisionSatelliteRequest } from "./satellite_provisioning";
|
|
|
8
9
|
import { ProxyCommand, ProxyHeartbeat, SatelliteRegistration, SubmitSatelliteAudioRequest, SubmitSatelliteAudioResponse } from "./satellite_proxy";
|
|
9
10
|
import { Empty, StatusResponse } from "./shared";
|
|
10
11
|
import { EnrollVoiceprintRequest } from "./speaker_enrollment";
|
|
12
|
+
import { DeleteTimerRequest, GetTimersRequest, GetTimersResponse } from "./timer_admin";
|
|
11
13
|
import { TimerCommand, TimerMessage } from "./timer_service";
|
|
12
|
-
import { CreateUserRequest, CreateUserResponse, DeleteUserRequest, GetResidentsResponse, GetUserRequest, GetUsersRequest, GetUsersResponse, LinkAccountRequest, LoginRequest, SetSystemMessagesRequest, SetTrustLevelRequest, UnlinkAccountRequest, UpdateUserRequest, UserResponse } from "./user_registry";
|
|
14
|
+
import { CreateUserRequest, CreateUserResponse, DeleteUserRequest, GetResidentsResponse, GetUserRequest, GetUsersRequest, GetUsersResponse, LinkAccountRequest, LoginRequest, SetAutomationRequest, SetSystemMessagesRequest, SetTrustLevelRequest, UnlinkAccountRequest, UpdateUserRequest, UserResponse } from "./user_registry";
|
|
13
15
|
import { SatelliteAudioChunk, SatelliteCaptureRequest, SatelliteCaptureResponse, TriggerPlinkRequest } from "./wakeword_capture";
|
|
14
16
|
export declare const protobufPackage = "hannah";
|
|
15
17
|
export type HannahServiceService = typeof HannahServiceService;
|
|
@@ -69,6 +71,19 @@ export declare const HannahServiceService: {
|
|
|
69
71
|
readonly responseSerialize: (value: StatusResponse) => Buffer;
|
|
70
72
|
readonly responseDeserialize: (value: Buffer) => StatusResponse;
|
|
71
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Enable/disable an automation service (e.g. "telegram_autoresponder") for a user.
|
|
76
|
+
* Pushes a live update to any connected AutomationConnect stream registered for it.
|
|
77
|
+
*/
|
|
78
|
+
readonly setAutomation: {
|
|
79
|
+
readonly path: "/hannah.HannahService/SetAutomation";
|
|
80
|
+
readonly requestStream: false;
|
|
81
|
+
readonly responseStream: false;
|
|
82
|
+
readonly requestSerialize: (value: SetAutomationRequest) => Buffer;
|
|
83
|
+
readonly requestDeserialize: (value: Buffer) => SetAutomationRequest;
|
|
84
|
+
readonly responseSerialize: (value: StatusResponse) => Buffer;
|
|
85
|
+
readonly responseDeserialize: (value: Buffer) => StatusResponse;
|
|
86
|
+
};
|
|
72
87
|
readonly login: {
|
|
73
88
|
readonly path: "/hannah.HannahService/Login";
|
|
74
89
|
readonly requestStream: false;
|
|
@@ -685,6 +700,29 @@ export declare const HannahServiceService: {
|
|
|
685
700
|
readonly responseSerialize: (value: TimerCommand) => Buffer;
|
|
686
701
|
readonly responseDeserialize: (value: Buffer) => TimerCommand;
|
|
687
702
|
};
|
|
703
|
+
/**
|
|
704
|
+
* --- Timer Admin ---
|
|
705
|
+
* Query and cancel timers independent of the TimerConnect stream — e.g. for an
|
|
706
|
+
* Admin-UI or Telegram bot listing/cancelling a user's active timers.
|
|
707
|
+
*/
|
|
708
|
+
readonly getTimers: {
|
|
709
|
+
readonly path: "/hannah.HannahService/GetTimers";
|
|
710
|
+
readonly requestStream: false;
|
|
711
|
+
readonly responseStream: false;
|
|
712
|
+
readonly requestSerialize: (value: GetTimersRequest) => Buffer;
|
|
713
|
+
readonly requestDeserialize: (value: Buffer) => GetTimersRequest;
|
|
714
|
+
readonly responseSerialize: (value: GetTimersResponse) => Buffer;
|
|
715
|
+
readonly responseDeserialize: (value: Buffer) => GetTimersResponse;
|
|
716
|
+
};
|
|
717
|
+
readonly deleteTimer: {
|
|
718
|
+
readonly path: "/hannah.HannahService/DeleteTimer";
|
|
719
|
+
readonly requestStream: false;
|
|
720
|
+
readonly responseStream: false;
|
|
721
|
+
readonly requestSerialize: (value: DeleteTimerRequest) => Buffer;
|
|
722
|
+
readonly requestDeserialize: (value: Buffer) => DeleteTimerRequest;
|
|
723
|
+
readonly responseSerialize: (value: StatusResponse) => Buffer;
|
|
724
|
+
readonly responseDeserialize: (value: Buffer) => StatusResponse;
|
|
725
|
+
};
|
|
688
726
|
/**
|
|
689
727
|
* --- ioBroker Agent ---
|
|
690
728
|
* Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
|
|
@@ -701,6 +739,24 @@ export declare const HannahServiceService: {
|
|
|
701
739
|
readonly responseSerialize: (value: AgentCommand) => Buffer;
|
|
702
740
|
readonly responseDeserialize: (value: Buffer) => AgentCommand;
|
|
703
741
|
};
|
|
742
|
+
/**
|
|
743
|
+
* --- Automations ---
|
|
744
|
+
* Bidirectional stream for external automation services (e.g. telegram_autoresponder).
|
|
745
|
+
* The service sends an AutomationRegister identifying itself, then Hannah replies with
|
|
746
|
+
* an AutomationSnapshot (all users with it currently enabled) followed by live
|
|
747
|
+
* AutomationStateChanged deltas as users toggle it via SetAutomation/voice.
|
|
748
|
+
* Chosen over SubscribeEvents so a reconnecting service always gets a fresh snapshot
|
|
749
|
+
* instead of missing state changes that happened while it was offline.
|
|
750
|
+
*/
|
|
751
|
+
readonly automationConnect: {
|
|
752
|
+
readonly path: "/hannah.HannahService/AutomationConnect";
|
|
753
|
+
readonly requestStream: true;
|
|
754
|
+
readonly responseStream: true;
|
|
755
|
+
readonly requestSerialize: (value: AutomationMessage) => Buffer;
|
|
756
|
+
readonly requestDeserialize: (value: Buffer) => AutomationMessage;
|
|
757
|
+
readonly responseSerialize: (value: AutomationCommand) => Buffer;
|
|
758
|
+
readonly responseDeserialize: (value: Buffer) => AutomationCommand;
|
|
759
|
+
};
|
|
704
760
|
};
|
|
705
761
|
export interface HannahServiceServer extends UntypedServiceImplementation {
|
|
706
762
|
/** --- User Registry --- */
|
|
@@ -710,6 +766,11 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
|
|
|
710
766
|
unlinkAccount: handleUnaryCall<UnlinkAccountRequest, StatusResponse>;
|
|
711
767
|
setTrustLevel: handleUnaryCall<SetTrustLevelRequest, StatusResponse>;
|
|
712
768
|
setSystemMessages: handleUnaryCall<SetSystemMessagesRequest, StatusResponse>;
|
|
769
|
+
/**
|
|
770
|
+
* Enable/disable an automation service (e.g. "telegram_autoresponder") for a user.
|
|
771
|
+
* Pushes a live update to any connected AutomationConnect stream registered for it.
|
|
772
|
+
*/
|
|
773
|
+
setAutomation: handleUnaryCall<SetAutomationRequest, StatusResponse>;
|
|
713
774
|
login: handleUnaryCall<LoginRequest, UserResponse>;
|
|
714
775
|
/** --- User-Verwaltung (Admin-UI, #27 Phase 6) --- */
|
|
715
776
|
createUser: handleUnaryCall<CreateUserRequest, CreateUserResponse>;
|
|
@@ -854,6 +915,13 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
|
|
|
854
915
|
* Hannah sends timer commands (create, cancel, list); the service fires events when timers expire.
|
|
855
916
|
*/
|
|
856
917
|
timerConnect: handleBidiStreamingCall<TimerMessage, TimerCommand>;
|
|
918
|
+
/**
|
|
919
|
+
* --- Timer Admin ---
|
|
920
|
+
* Query and cancel timers independent of the TimerConnect stream — e.g. for an
|
|
921
|
+
* Admin-UI or Telegram bot listing/cancelling a user's active timers.
|
|
922
|
+
*/
|
|
923
|
+
getTimers: handleUnaryCall<GetTimersRequest, GetTimersResponse>;
|
|
924
|
+
deleteTimer: handleUnaryCall<DeleteTimerRequest, StatusResponse>;
|
|
857
925
|
/**
|
|
858
926
|
* --- ioBroker Agent ---
|
|
859
927
|
* Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
|
|
@@ -862,6 +930,16 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
|
|
|
862
930
|
* The adapter initiates the connection; if Hannah restarts, the adapter reconnects.
|
|
863
931
|
*/
|
|
864
932
|
agentConnect: handleBidiStreamingCall<AgentMessage, AgentCommand>;
|
|
933
|
+
/**
|
|
934
|
+
* --- Automations ---
|
|
935
|
+
* Bidirectional stream for external automation services (e.g. telegram_autoresponder).
|
|
936
|
+
* The service sends an AutomationRegister identifying itself, then Hannah replies with
|
|
937
|
+
* an AutomationSnapshot (all users with it currently enabled) followed by live
|
|
938
|
+
* AutomationStateChanged deltas as users toggle it via SetAutomation/voice.
|
|
939
|
+
* Chosen over SubscribeEvents so a reconnecting service always gets a fresh snapshot
|
|
940
|
+
* instead of missing state changes that happened while it was offline.
|
|
941
|
+
*/
|
|
942
|
+
automationConnect: handleBidiStreamingCall<AutomationMessage, AutomationCommand>;
|
|
865
943
|
}
|
|
866
944
|
export interface HannahServiceClient extends Client {
|
|
867
945
|
/** --- User Registry --- */
|
|
@@ -883,6 +961,13 @@ export interface HannahServiceClient extends Client {
|
|
|
883
961
|
setSystemMessages(request: SetSystemMessagesRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
884
962
|
setSystemMessages(request: SetSystemMessagesRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
885
963
|
setSystemMessages(request: SetSystemMessagesRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
964
|
+
/**
|
|
965
|
+
* Enable/disable an automation service (e.g. "telegram_autoresponder") for a user.
|
|
966
|
+
* Pushes a live update to any connected AutomationConnect stream registered for it.
|
|
967
|
+
*/
|
|
968
|
+
setAutomation(request: SetAutomationRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
969
|
+
setAutomation(request: SetAutomationRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
970
|
+
setAutomation(request: SetAutomationRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
886
971
|
login(request: LoginRequest, callback: (error: ServiceError | null, response: UserResponse) => void): ClientUnaryCall;
|
|
887
972
|
login(request: LoginRequest, metadata: Metadata, callback: (error: ServiceError | null, response: UserResponse) => void): ClientUnaryCall;
|
|
888
973
|
login(request: LoginRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: UserResponse) => void): ClientUnaryCall;
|
|
@@ -1143,6 +1228,17 @@ export interface HannahServiceClient extends Client {
|
|
|
1143
1228
|
timerConnect(): ClientDuplexStream<TimerMessage, TimerCommand>;
|
|
1144
1229
|
timerConnect(options: Partial<CallOptions>): ClientDuplexStream<TimerMessage, TimerCommand>;
|
|
1145
1230
|
timerConnect(metadata: Metadata, options?: Partial<CallOptions>): ClientDuplexStream<TimerMessage, TimerCommand>;
|
|
1231
|
+
/**
|
|
1232
|
+
* --- Timer Admin ---
|
|
1233
|
+
* Query and cancel timers independent of the TimerConnect stream — e.g. for an
|
|
1234
|
+
* Admin-UI or Telegram bot listing/cancelling a user's active timers.
|
|
1235
|
+
*/
|
|
1236
|
+
getTimers(request: GetTimersRequest, callback: (error: ServiceError | null, response: GetTimersResponse) => void): ClientUnaryCall;
|
|
1237
|
+
getTimers(request: GetTimersRequest, metadata: Metadata, callback: (error: ServiceError | null, response: GetTimersResponse) => void): ClientUnaryCall;
|
|
1238
|
+
getTimers(request: GetTimersRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: GetTimersResponse) => void): ClientUnaryCall;
|
|
1239
|
+
deleteTimer(request: DeleteTimerRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
1240
|
+
deleteTimer(request: DeleteTimerRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
1241
|
+
deleteTimer(request: DeleteTimerRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
1146
1242
|
/**
|
|
1147
1243
|
* --- ioBroker Agent ---
|
|
1148
1244
|
* Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
|
|
@@ -1153,6 +1249,18 @@ export interface HannahServiceClient extends Client {
|
|
|
1153
1249
|
agentConnect(): ClientDuplexStream<AgentMessage, AgentCommand>;
|
|
1154
1250
|
agentConnect(options: Partial<CallOptions>): ClientDuplexStream<AgentMessage, AgentCommand>;
|
|
1155
1251
|
agentConnect(metadata: Metadata, options?: Partial<CallOptions>): ClientDuplexStream<AgentMessage, AgentCommand>;
|
|
1252
|
+
/**
|
|
1253
|
+
* --- Automations ---
|
|
1254
|
+
* Bidirectional stream for external automation services (e.g. telegram_autoresponder).
|
|
1255
|
+
* The service sends an AutomationRegister identifying itself, then Hannah replies with
|
|
1256
|
+
* an AutomationSnapshot (all users with it currently enabled) followed by live
|
|
1257
|
+
* AutomationStateChanged deltas as users toggle it via SetAutomation/voice.
|
|
1258
|
+
* Chosen over SubscribeEvents so a reconnecting service always gets a fresh snapshot
|
|
1259
|
+
* instead of missing state changes that happened while it was offline.
|
|
1260
|
+
*/
|
|
1261
|
+
automationConnect(): ClientDuplexStream<AutomationMessage, AutomationCommand>;
|
|
1262
|
+
automationConnect(options: Partial<CallOptions>): ClientDuplexStream<AutomationMessage, AutomationCommand>;
|
|
1263
|
+
automationConnect(metadata: Metadata, options?: Partial<CallOptions>): ClientDuplexStream<AutomationMessage, AutomationCommand>;
|
|
1156
1264
|
}
|
|
1157
1265
|
export declare const HannahServiceClient: {
|
|
1158
1266
|
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): HannahServiceClient;
|
package/dist/hannah.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.HannahServiceClient = exports.HannahServiceService = exports.protobufPac
|
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const grpc_js_1 = require("@grpc/grpc-js");
|
|
11
11
|
const agent_1 = require("./agent");
|
|
12
|
+
const automation_1 = require("./automation");
|
|
12
13
|
const car_state_1 = require("./car_state");
|
|
13
14
|
const control_1 = require("./control");
|
|
14
15
|
const device_control_menu_1 = require("./device_control_menu");
|
|
@@ -17,6 +18,7 @@ const satellite_provisioning_1 = require("./satellite_provisioning");
|
|
|
17
18
|
const satellite_proxy_1 = require("./satellite_proxy");
|
|
18
19
|
const shared_1 = require("./shared");
|
|
19
20
|
const speaker_enrollment_1 = require("./speaker_enrollment");
|
|
21
|
+
const timer_admin_1 = require("./timer_admin");
|
|
20
22
|
const timer_service_1 = require("./timer_service");
|
|
21
23
|
const user_registry_1 = require("./user_registry");
|
|
22
24
|
const wakeword_capture_1 = require("./wakeword_capture");
|
|
@@ -77,6 +79,19 @@ exports.HannahServiceService = {
|
|
|
77
79
|
responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
|
|
78
80
|
responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
|
|
79
81
|
},
|
|
82
|
+
/**
|
|
83
|
+
* Enable/disable an automation service (e.g. "telegram_autoresponder") for a user.
|
|
84
|
+
* Pushes a live update to any connected AutomationConnect stream registered for it.
|
|
85
|
+
*/
|
|
86
|
+
setAutomation: {
|
|
87
|
+
path: "/hannah.HannahService/SetAutomation",
|
|
88
|
+
requestStream: false,
|
|
89
|
+
responseStream: false,
|
|
90
|
+
requestSerialize: (value) => Buffer.from(user_registry_1.SetAutomationRequest.encode(value).finish()),
|
|
91
|
+
requestDeserialize: (value) => user_registry_1.SetAutomationRequest.decode(value),
|
|
92
|
+
responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
|
|
93
|
+
responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
|
|
94
|
+
},
|
|
80
95
|
login: {
|
|
81
96
|
path: "/hannah.HannahService/Login",
|
|
82
97
|
requestStream: false,
|
|
@@ -693,6 +708,29 @@ exports.HannahServiceService = {
|
|
|
693
708
|
responseSerialize: (value) => Buffer.from(timer_service_1.TimerCommand.encode(value).finish()),
|
|
694
709
|
responseDeserialize: (value) => timer_service_1.TimerCommand.decode(value),
|
|
695
710
|
},
|
|
711
|
+
/**
|
|
712
|
+
* --- Timer Admin ---
|
|
713
|
+
* Query and cancel timers independent of the TimerConnect stream — e.g. for an
|
|
714
|
+
* Admin-UI or Telegram bot listing/cancelling a user's active timers.
|
|
715
|
+
*/
|
|
716
|
+
getTimers: {
|
|
717
|
+
path: "/hannah.HannahService/GetTimers",
|
|
718
|
+
requestStream: false,
|
|
719
|
+
responseStream: false,
|
|
720
|
+
requestSerialize: (value) => Buffer.from(timer_admin_1.GetTimersRequest.encode(value).finish()),
|
|
721
|
+
requestDeserialize: (value) => timer_admin_1.GetTimersRequest.decode(value),
|
|
722
|
+
responseSerialize: (value) => Buffer.from(timer_admin_1.GetTimersResponse.encode(value).finish()),
|
|
723
|
+
responseDeserialize: (value) => timer_admin_1.GetTimersResponse.decode(value),
|
|
724
|
+
},
|
|
725
|
+
deleteTimer: {
|
|
726
|
+
path: "/hannah.HannahService/DeleteTimer",
|
|
727
|
+
requestStream: false,
|
|
728
|
+
responseStream: false,
|
|
729
|
+
requestSerialize: (value) => Buffer.from(timer_admin_1.DeleteTimerRequest.encode(value).finish()),
|
|
730
|
+
requestDeserialize: (value) => timer_admin_1.DeleteTimerRequest.decode(value),
|
|
731
|
+
responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
|
|
732
|
+
responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
|
|
733
|
+
},
|
|
696
734
|
/**
|
|
697
735
|
* --- ioBroker Agent ---
|
|
698
736
|
* Single bidirectional stream between the HannahAgent ioBroker adapter and Hannah Core.
|
|
@@ -709,5 +747,23 @@ exports.HannahServiceService = {
|
|
|
709
747
|
responseSerialize: (value) => Buffer.from(agent_1.AgentCommand.encode(value).finish()),
|
|
710
748
|
responseDeserialize: (value) => agent_1.AgentCommand.decode(value),
|
|
711
749
|
},
|
|
750
|
+
/**
|
|
751
|
+
* --- Automations ---
|
|
752
|
+
* Bidirectional stream for external automation services (e.g. telegram_autoresponder).
|
|
753
|
+
* The service sends an AutomationRegister identifying itself, then Hannah replies with
|
|
754
|
+
* an AutomationSnapshot (all users with it currently enabled) followed by live
|
|
755
|
+
* AutomationStateChanged deltas as users toggle it via SetAutomation/voice.
|
|
756
|
+
* Chosen over SubscribeEvents so a reconnecting service always gets a fresh snapshot
|
|
757
|
+
* instead of missing state changes that happened while it was offline.
|
|
758
|
+
*/
|
|
759
|
+
automationConnect: {
|
|
760
|
+
path: "/hannah.HannahService/AutomationConnect",
|
|
761
|
+
requestStream: true,
|
|
762
|
+
responseStream: true,
|
|
763
|
+
requestSerialize: (value) => Buffer.from(automation_1.AutomationMessage.encode(value).finish()),
|
|
764
|
+
requestDeserialize: (value) => automation_1.AutomationMessage.decode(value),
|
|
765
|
+
responseSerialize: (value) => Buffer.from(automation_1.AutomationCommand.encode(value).finish()),
|
|
766
|
+
responseDeserialize: (value) => automation_1.AutomationCommand.decode(value),
|
|
767
|
+
},
|
|
712
768
|
};
|
|
713
769
|
exports.HannahServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.HannahServiceService, "hannah.HannahService");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './version';
|
|
2
2
|
export * as agent from './agent';
|
|
3
|
+
export * as automation from './automation';
|
|
3
4
|
export * as car_state from './car_state';
|
|
4
5
|
export * as control from './control';
|
|
5
6
|
export * as device_control_menu from './device_control_menu';
|
|
@@ -9,6 +10,7 @@ export * as satellite_provisioning from './satellite_provisioning';
|
|
|
9
10
|
export * as satellite_proxy from './satellite_proxy';
|
|
10
11
|
export * as shared from './shared';
|
|
11
12
|
export * as speaker_enrollment from './speaker_enrollment';
|
|
13
|
+
export * as timer_admin from './timer_admin';
|
|
12
14
|
export * as timer_service from './timer_service';
|
|
13
15
|
export * as user_registry from './user_registry';
|
|
14
16
|
export * as wakeword_capture from './wakeword_capture';
|
package/dist/index.js
CHANGED
|
@@ -36,9 +36,10 @@ 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.automation = exports.agent = void 0;
|
|
40
40
|
__exportStar(require("./version"), exports);
|
|
41
41
|
exports.agent = __importStar(require("./agent"));
|
|
42
|
+
exports.automation = __importStar(require("./automation"));
|
|
42
43
|
exports.car_state = __importStar(require("./car_state"));
|
|
43
44
|
exports.control = __importStar(require("./control"));
|
|
44
45
|
exports.device_control_menu = __importStar(require("./device_control_menu"));
|
|
@@ -48,6 +49,7 @@ exports.satellite_provisioning = __importStar(require("./satellite_provisioning"
|
|
|
48
49
|
exports.satellite_proxy = __importStar(require("./satellite_proxy"));
|
|
49
50
|
exports.shared = __importStar(require("./shared"));
|
|
50
51
|
exports.speaker_enrollment = __importStar(require("./speaker_enrollment"));
|
|
52
|
+
exports.timer_admin = __importStar(require("./timer_admin"));
|
|
51
53
|
exports.timer_service = __importStar(require("./timer_service"));
|
|
52
54
|
exports.user_registry = __importStar(require("./user_registry"));
|
|
53
55
|
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/dist/user_registry.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export interface User {
|
|
|
17
17
|
email: string;
|
|
18
18
|
/** "roomie" | "guest" | "pet", #27 Phase 6 */
|
|
19
19
|
type: string;
|
|
20
|
+
/**
|
|
21
|
+
* Keys of automation services (e.g. "telegram_autoresponder") currently enabled for
|
|
22
|
+
* this user. Presence-based: a key is only listed here when enabled, absent = disabled.
|
|
23
|
+
*/
|
|
24
|
+
enabledAutomations: string[];
|
|
20
25
|
}
|
|
21
26
|
export interface User_LinkedAccountsEntry {
|
|
22
27
|
key: string;
|
|
@@ -80,6 +85,12 @@ export interface SetSystemMessagesRequest {
|
|
|
80
85
|
userId: number;
|
|
81
86
|
enabled: boolean;
|
|
82
87
|
}
|
|
88
|
+
export interface SetAutomationRequest {
|
|
89
|
+
userId: number;
|
|
90
|
+
/** e.g. "telegram_autoresponder" */
|
|
91
|
+
automation: string;
|
|
92
|
+
enabled: boolean;
|
|
93
|
+
}
|
|
83
94
|
export interface CreateUserRequest {
|
|
84
95
|
username: string;
|
|
85
96
|
/** Klartext, wird serverseitig gehasht — gleicher akzeptierter Constraint wie LoginRequest */
|
|
@@ -131,6 +142,7 @@ export declare const LinkAccountRequest: MessageFns<LinkAccountRequest>;
|
|
|
131
142
|
export declare const UnlinkAccountRequest: MessageFns<UnlinkAccountRequest>;
|
|
132
143
|
export declare const SetTrustLevelRequest: MessageFns<SetTrustLevelRequest>;
|
|
133
144
|
export declare const SetSystemMessagesRequest: MessageFns<SetSystemMessagesRequest>;
|
|
145
|
+
export declare const SetAutomationRequest: MessageFns<SetAutomationRequest>;
|
|
134
146
|
export declare const CreateUserRequest: MessageFns<CreateUserRequest>;
|
|
135
147
|
export declare const CreateUserResponse: MessageFns<CreateUserResponse>;
|
|
136
148
|
export declare const UpdateUserRequest: MessageFns<UpdateUserRequest>;
|
package/dist/user_registry.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: user_registry.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.GetResidentsResponse = exports.Resident = exports.DeleteUserRequest = exports.UpdateUserRequest = exports.CreateUserResponse = exports.CreateUserRequest = exports.SetSystemMessagesRequest = exports.SetTrustLevelRequest = exports.UnlinkAccountRequest = exports.LinkAccountRequest = exports.LoginRequest = exports.UserResponse = exports.LinkedAccountLookup = exports.GetUserRequest = exports.GetUsersResponse = exports.GetUsersRequest = exports.User_LinkedAccountsEntry = exports.User = exports.protobufPackage = void 0;
|
|
8
|
+
exports.GetResidentsResponse = exports.Resident = exports.DeleteUserRequest = exports.UpdateUserRequest = exports.CreateUserResponse = exports.CreateUserRequest = exports.SetAutomationRequest = exports.SetSystemMessagesRequest = exports.SetTrustLevelRequest = exports.UnlinkAccountRequest = exports.LinkAccountRequest = exports.LoginRequest = exports.UserResponse = exports.LinkedAccountLookup = exports.GetUserRequest = exports.GetUsersResponse = exports.GetUsersRequest = exports.User_LinkedAccountsEntry = exports.User = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
exports.protobufPackage = "hannah";
|
|
@@ -20,6 +20,7 @@ function createBaseUser() {
|
|
|
20
20
|
systemMessages: false,
|
|
21
21
|
email: "",
|
|
22
22
|
type: "",
|
|
23
|
+
enabledAutomations: [],
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
exports.User = {
|
|
@@ -51,6 +52,9 @@ exports.User = {
|
|
|
51
52
|
if (message.type !== "") {
|
|
52
53
|
writer.uint32(74).string(message.type);
|
|
53
54
|
}
|
|
55
|
+
for (const v of message.enabledAutomations) {
|
|
56
|
+
writer.uint32(82).string(v);
|
|
57
|
+
}
|
|
54
58
|
return writer;
|
|
55
59
|
},
|
|
56
60
|
decode(input, length) {
|
|
@@ -126,6 +130,13 @@ exports.User = {
|
|
|
126
130
|
message.type = reader.string();
|
|
127
131
|
continue;
|
|
128
132
|
}
|
|
133
|
+
case 10: {
|
|
134
|
+
if (tag !== 82) {
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
message.enabledAutomations.push(reader.string());
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
129
140
|
}
|
|
130
141
|
if ((tag & 7) === 4 || tag === 0) {
|
|
131
142
|
break;
|
|
@@ -153,6 +164,7 @@ exports.User = {
|
|
|
153
164
|
message.systemMessages = object.systemMessages ?? false;
|
|
154
165
|
message.email = object.email ?? "";
|
|
155
166
|
message.type = object.type ?? "";
|
|
167
|
+
message.enabledAutomations = object.enabledAutomations?.map((e) => e) || [];
|
|
156
168
|
return message;
|
|
157
169
|
},
|
|
158
170
|
};
|
|
@@ -774,6 +786,69 @@ exports.SetSystemMessagesRequest = {
|
|
|
774
786
|
return message;
|
|
775
787
|
},
|
|
776
788
|
};
|
|
789
|
+
function createBaseSetAutomationRequest() {
|
|
790
|
+
return { userId: 0, automation: "", enabled: false };
|
|
791
|
+
}
|
|
792
|
+
exports.SetAutomationRequest = {
|
|
793
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
794
|
+
if (message.userId !== 0) {
|
|
795
|
+
writer.uint32(8).int32(message.userId);
|
|
796
|
+
}
|
|
797
|
+
if (message.automation !== "") {
|
|
798
|
+
writer.uint32(18).string(message.automation);
|
|
799
|
+
}
|
|
800
|
+
if (message.enabled !== false) {
|
|
801
|
+
writer.uint32(24).bool(message.enabled);
|
|
802
|
+
}
|
|
803
|
+
return writer;
|
|
804
|
+
},
|
|
805
|
+
decode(input, length) {
|
|
806
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
807
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
808
|
+
const message = createBaseSetAutomationRequest();
|
|
809
|
+
while (reader.pos < end) {
|
|
810
|
+
const tag = reader.uint32();
|
|
811
|
+
switch (tag >>> 3) {
|
|
812
|
+
case 1: {
|
|
813
|
+
if (tag !== 8) {
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
message.userId = reader.int32();
|
|
817
|
+
continue;
|
|
818
|
+
}
|
|
819
|
+
case 2: {
|
|
820
|
+
if (tag !== 18) {
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
message.automation = reader.string();
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
case 3: {
|
|
827
|
+
if (tag !== 24) {
|
|
828
|
+
break;
|
|
829
|
+
}
|
|
830
|
+
message.enabled = reader.bool();
|
|
831
|
+
continue;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
reader.skip(tag & 7);
|
|
838
|
+
}
|
|
839
|
+
return message;
|
|
840
|
+
},
|
|
841
|
+
create(base) {
|
|
842
|
+
return exports.SetAutomationRequest.fromPartial(base ?? {});
|
|
843
|
+
},
|
|
844
|
+
fromPartial(object) {
|
|
845
|
+
const message = createBaseSetAutomationRequest();
|
|
846
|
+
message.userId = object.userId ?? 0;
|
|
847
|
+
message.automation = object.automation ?? "";
|
|
848
|
+
message.enabled = object.enabled ?? false;
|
|
849
|
+
return message;
|
|
850
|
+
},
|
|
851
|
+
};
|
|
777
852
|
function createBaseCreateUserRequest() {
|
|
778
853
|
return { username: "", password: "", email: "", displayName: "", type: "" };
|
|
779
854
|
}
|
package/package.json
CHANGED