Skip to content

Commit

Permalink
Merge pull request #91 from infinimesh/dev-eventbus
Browse files Browse the repository at this point in the history
Dev eventbus
  • Loading branch information
loathedrobot authored Feb 20, 2024
2 parents ebc91d8 + 0b030b7 commit 856836e
Show file tree
Hide file tree
Showing 10 changed files with 1,199 additions and 4 deletions.
47 changes: 43 additions & 4 deletions api.swagger.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"swagger": "2.0",
"info": {
"title": "handsfree/handsfree.proto",
"title": "node/access/access.proto",
"version": "version not set"
},
"tags": [
{
"name": "HandsfreeService"
},
{
"name": "ShadowService"
},
Expand All @@ -26,6 +23,12 @@
{
"name": "InternalService"
},
{
"name": "EventsService"
},
{
"name": "HandsfreeService"
},
{
"name": "PluginsService"
},
Expand Down Expand Up @@ -3039,6 +3042,42 @@
}
}
},
"eventbusEvent": {
"type": "object",
"properties": {
"eventKind": {
"$ref": "#/definitions/eventbusEventKind"
},
"account": {
"$ref": "#/definitions/accountsAccount"
},
"namespace": {
"$ref": "#/definitions/namespacesNamespace"
},
"device": {
"$ref": "#/definitions/devicesDevice"
},
"meta": {
"type": "object"
}
}
},
"eventbusEventKind": {
"type": "string",
"enum": [
"NONE",
"ACCOUNT_CREATE",
"ACCOUNT_UPDATE",
"ACCOUNT_DELETE",
"NAMESPACE_CREATE",
"NAMESPACE_UPDATE",
"NAMESPACE_DELETE",
"DEVICE_CREATE",
"DEVICE_UPDATE",
"DEVICE_DELETE"
],
"default": "NONE"
},
"handsfreeCode": {
"type": "string",
"enum": [
Expand Down
27 changes: 27 additions & 0 deletions build/es/eventbus/eventbus_connect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js+dts"
// @generated from file eventbus/eventbus.proto (package infinimesh.eventbus, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { EmptyMessage } from "../node/node_pb.js";
import { Event } from "./eventbus_pb.js";
import { MethodKind } from "@bufbuild/protobuf";

/**
* @generated from service infinimesh.eventbus.EventsService
*/
export declare const EventsService: {
readonly typeName: "infinimesh.eventbus.EventsService",
readonly methods: {
/**
* @generated from rpc infinimesh.eventbus.EventsService.Subscribe
*/
readonly subscribe: {
readonly name: "Subscribe",
readonly I: typeof EmptyMessage,
readonly O: typeof Event,
readonly kind: MethodKind.ServerStreaming,
},
}
};

27 changes: 27 additions & 0 deletions build/es/eventbus/eventbus_connect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js+dts"
// @generated from file eventbus/eventbus.proto (package infinimesh.eventbus, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { EmptyMessage } from "../node/node_pb.js";
import { Event } from "./eventbus_pb.js";
import { MethodKind } from "@bufbuild/protobuf";

/**
* @generated from service infinimesh.eventbus.EventsService
*/
export const EventsService = {
typeName: "infinimesh.eventbus.EventsService",
methods: {
/**
* @generated from rpc infinimesh.eventbus.EventsService.Subscribe
*/
subscribe: {
name: "Subscribe",
I: EmptyMessage,
O: Event,
kind: MethodKind.ServerStreaming,
},
}
};

118 changes: 118 additions & 0 deletions build/es/eventbus/eventbus_pb.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// @generated by protoc-gen-es v1.7.2 with parameter "target=js+dts"
// @generated from file eventbus/eventbus.proto (package infinimesh.eventbus, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Struct } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type { Account } from "../node/accounts/accounts_pb.js";
import type { Namespace } from "../node/namespaces/namespaces_pb.js";
import type { Device } from "../node/devices/devices_pb.js";

/**
* @generated from enum infinimesh.eventbus.EventKind
*/
export declare enum EventKind {
/**
* @generated from enum value: NONE = 0;
*/
NONE = 0,

/**
* @generated from enum value: ACCOUNT_CREATE = 1;
*/
ACCOUNT_CREATE = 1,

/**
* @generated from enum value: ACCOUNT_UPDATE = 2;
*/
ACCOUNT_UPDATE = 2,

/**
* @generated from enum value: ACCOUNT_DELETE = 3;
*/
ACCOUNT_DELETE = 3,

/**
* @generated from enum value: NAMESPACE_CREATE = 4;
*/
NAMESPACE_CREATE = 4,

/**
* @generated from enum value: NAMESPACE_UPDATE = 5;
*/
NAMESPACE_UPDATE = 5,

/**
* @generated from enum value: NAMESPACE_DELETE = 6;
*/
NAMESPACE_DELETE = 6,

/**
* @generated from enum value: DEVICE_CREATE = 7;
*/
DEVICE_CREATE = 7,

/**
* @generated from enum value: DEVICE_UPDATE = 8;
*/
DEVICE_UPDATE = 8,

/**
* @generated from enum value: DEVICE_DELETE = 9;
*/
DEVICE_DELETE = 9,
}

/**
* @generated from message infinimesh.eventbus.Event
*/
export declare class Event extends Message<Event> {
/**
* @generated from field: infinimesh.eventbus.EventKind event_kind = 1;
*/
eventKind: EventKind;

/**
* @generated from oneof infinimesh.eventbus.Event.entity
*/
entity: {
/**
* @generated from field: infinimesh.node.accounts.Account account = 2;
*/
value: Account;
case: "account";
} | {
/**
* @generated from field: infinimesh.node.namespaces.Namespace namespace = 3;
*/
value: Namespace;
case: "namespace";
} | {
/**
* @generated from field: infinimesh.node.devices.Device device = 4;
*/
value: Device;
case: "device";
} | { case: undefined; value?: undefined };

/**
* @generated from field: google.protobuf.Struct meta = 5;
*/
meta?: Struct;

constructor(data?: PartialMessage<Event>);

static readonly runtime: typeof proto3;
static readonly typeName = "infinimesh.eventbus.Event";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Event;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Event;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Event;

static equals(a: Event | PlainMessage<Event> | undefined, b: Event | PlainMessage<Event> | undefined): boolean;
}

43 changes: 43 additions & 0 deletions build/es/eventbus/eventbus_pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @generated by protoc-gen-es v1.7.2 with parameter "target=js+dts"
// @generated from file eventbus/eventbus.proto (package infinimesh.eventbus, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { proto3, Struct } from "@bufbuild/protobuf";
import { Account } from "../node/accounts/accounts_pb.js";
import { Namespace } from "../node/namespaces/namespaces_pb.js";
import { Device } from "../node/devices/devices_pb.js";

/**
* @generated from enum infinimesh.eventbus.EventKind
*/
export const EventKind = proto3.makeEnum(
"infinimesh.eventbus.EventKind",
[
{no: 0, name: "NONE"},
{no: 1, name: "ACCOUNT_CREATE"},
{no: 2, name: "ACCOUNT_UPDATE"},
{no: 3, name: "ACCOUNT_DELETE"},
{no: 4, name: "NAMESPACE_CREATE"},
{no: 5, name: "NAMESPACE_UPDATE"},
{no: 6, name: "NAMESPACE_DELETE"},
{no: 7, name: "DEVICE_CREATE"},
{no: 8, name: "DEVICE_UPDATE"},
{no: 9, name: "DEVICE_DELETE"},
],
);

/**
* @generated from message infinimesh.eventbus.Event
*/
export const Event = proto3.makeMessageType(
"infinimesh.eventbus.Event",
() => [
{ no: 1, name: "event_kind", kind: "enum", T: proto3.getEnumType(EventKind) },
{ no: 2, name: "account", kind: "message", T: Account, oneof: "entity" },
{ no: 3, name: "namespace", kind: "message", T: Namespace, oneof: "entity" },
{ no: 4, name: "device", kind: "message", T: Device, oneof: "entity" },
{ no: 5, name: "meta", kind: "message", T: Struct },
],
);

Loading

0 comments on commit 856836e

Please sign in to comment.