@eyenest/contracts 1.5.6 → 1.6.1

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.
@@ -2,4 +2,5 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly CAMERA: string;
4
4
  readonly VIDEO: string;
5
+ readonly EVENTS: string;
5
6
  };
@@ -6,4 +6,5 @@ exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  CAMERA: (0, path_1.join)(__dirname, '../../proto/camera.proto'),
8
8
  VIDEO: (0, path_1.join)(__dirname, '../../proto/video.proto'),
9
+ EVENTS: (0, path_1.join)(__dirname, '../../proto/events.proto'),
9
10
  };
@@ -0,0 +1,56 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.5
4
+ // protoc v3.21.12
5
+ // source: events.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "events.v1";
12
+
13
+ export interface GetEventsByCameraIdRequest {
14
+ cameraId: string;
15
+ }
16
+
17
+ export interface GetEventsByCameraIdResponse {
18
+ events: Event[];
19
+ }
20
+
21
+ export interface Event {
22
+ id: string;
23
+ cameraId: string;
24
+ userId: string;
25
+ eventType: string;
26
+ createdAt: string;
27
+ }
28
+
29
+ export const EVENTS_V1_PACKAGE_NAME = "events.v1";
30
+
31
+ export interface EventsServiceClient {
32
+ getEventsByCameraId(request: GetEventsByCameraIdRequest): Observable<GetEventsByCameraIdResponse>;
33
+ }
34
+
35
+ export interface EventsServiceController {
36
+ getEventsByCameraId(
37
+ request: GetEventsByCameraIdRequest,
38
+ ): Promise<GetEventsByCameraIdResponse> | Observable<GetEventsByCameraIdResponse> | GetEventsByCameraIdResponse;
39
+ }
40
+
41
+ export function EventsServiceControllerMethods() {
42
+ return function (constructor: Function) {
43
+ const grpcMethods: string[] = ["getEventsByCameraId"];
44
+ for (const method of grpcMethods) {
45
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
46
+ GrpcMethod("EventsService", method)(constructor.prototype[method], method, descriptor);
47
+ }
48
+ const grpcStreamMethods: string[] = [];
49
+ for (const method of grpcStreamMethods) {
50
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
51
+ GrpcStreamMethod("EventsService", method)(constructor.prototype[method], method, descriptor);
52
+ }
53
+ };
54
+ }
55
+
56
+ export const EVENTS_SERVICE_NAME = "EventsService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyenest/contracts",
3
- "version": "1.5.6",
3
+ "version": "1.6.1",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,23 @@
1
+ syntax = "proto3";
2
+
3
+ package events.v1;
4
+
5
+ service EventsService {
6
+ rpc GetEventsByCameraId (GetEventsByCameraIdRequest) returns (GetEventsByCameraIdResponse);
7
+ }
8
+
9
+ message GetEventsByCameraIdRequest {
10
+ string cameraId = 1;
11
+ }
12
+
13
+ message GetEventsByCameraIdResponse {
14
+ repeated Event events = 1;
15
+ }
16
+
17
+ message Event {
18
+ string id = 1;
19
+ string cameraId = 2;
20
+ string userId = 3;
21
+ string eventType = 4;
22
+ string createdAt = 5;
23
+ }