@eyenest/contracts 1.1.4 → 1.2.0
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/proto/paths.d.ts +1 -1
- package/dist/proto/paths.js +1 -1
- package/gen/ts/camera.ts +72 -0
- package/gen/ts/user.ts +5 -1
- package/package.json +1 -1
- package/proto/camera.proto +39 -0
- package/proto/user.proto +0 -17
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -4,5 +4,5 @@ exports.PROTO_PATHS = void 0;
|
|
|
4
4
|
const path_1 = require("path");
|
|
5
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
|
};
|
package/gen/ts/camera.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: camera.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "camera.v1";
|
|
12
|
+
|
|
13
|
+
export enum Status {
|
|
14
|
+
ON = 0,
|
|
15
|
+
OFF = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GetLocationsByUserIdRequest {
|
|
20
|
+
userId: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface GetLocationsByUserIdResponse {
|
|
24
|
+
locations: Location[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface Location {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
userId: string;
|
|
31
|
+
cameras: Camera[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Camera {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
cameraSettings: CameraSettings | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface CameraSettings {
|
|
41
|
+
id: string;
|
|
42
|
+
aiStatus: Status;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const CAMERA_V1_PACKAGE_NAME = "camera.v1";
|
|
46
|
+
|
|
47
|
+
export interface CameraServiceClient {
|
|
48
|
+
getLocationsByUserId(request: GetLocationsByUserIdRequest): Observable<GetLocationsByUserIdResponse>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface CameraServiceController {
|
|
52
|
+
getLocationsByUserId(
|
|
53
|
+
request: GetLocationsByUserIdRequest,
|
|
54
|
+
): Promise<GetLocationsByUserIdResponse> | Observable<GetLocationsByUserIdResponse> | GetLocationsByUserIdResponse;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function CameraServiceControllerMethods() {
|
|
58
|
+
return function (constructor: Function) {
|
|
59
|
+
const grpcMethods: string[] = ["getLocationsByUserId"];
|
|
60
|
+
for (const method of grpcMethods) {
|
|
61
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
62
|
+
GrpcMethod("CameraService", method)(constructor.prototype[method], method, descriptor);
|
|
63
|
+
}
|
|
64
|
+
const grpcStreamMethods: string[] = [];
|
|
65
|
+
for (const method of grpcStreamMethods) {
|
|
66
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
67
|
+
GrpcStreamMethod("CameraService", method)(constructor.prototype[method], method, descriptor);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const CAMERA_SERVICE_NAME = "CameraService";
|
package/gen/ts/user.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc
|
|
4
|
+
// protoc v6.33.2
|
|
5
5
|
// source: user.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
10
11
|
|
|
11
12
|
export const protobufPackage = "user.v1";
|
|
12
13
|
|
|
@@ -17,6 +18,9 @@ export interface GetByEmailRequest {
|
|
|
17
18
|
export interface GetByEmailResponse {
|
|
18
19
|
id: string;
|
|
19
20
|
email: string;
|
|
21
|
+
password: string;
|
|
22
|
+
createdAt: Timestamp | undefined;
|
|
23
|
+
updatedAt: Timestamp | undefined;
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
export const USER_V1_PACKAGE_NAME = "user.v1";
|
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package camera.v1;
|
|
4
|
+
|
|
5
|
+
service CameraService {
|
|
6
|
+
rpc GetLocationsByUserId (GetLocationsByUserIdRequest)
|
|
7
|
+
returns (GetLocationsByUserIdResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message GetLocationsByUserIdRequest {
|
|
11
|
+
string userId = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message GetLocationsByUserIdResponse {
|
|
15
|
+
repeated Location locations = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message Location {
|
|
19
|
+
string id = 1;
|
|
20
|
+
string name = 2;
|
|
21
|
+
string userId = 3;
|
|
22
|
+
repeated Camera cameras = 4;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message Camera {
|
|
26
|
+
string id = 1;
|
|
27
|
+
string name = 2;
|
|
28
|
+
CameraSettings cameraSettings = 3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message CameraSettings {
|
|
32
|
+
string id = 1;
|
|
33
|
+
Status aiStatus = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
enum Status {
|
|
37
|
+
ON = 0;
|
|
38
|
+
OFF = 1;
|
|
39
|
+
}
|
package/proto/user.proto
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package user.v1;
|
|
4
|
-
|
|
5
|
-
service UserService {
|
|
6
|
-
rpc getByEmail(GetByEmailRequest) returns (GetByEmailResponse);
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
message GetByEmailRequest {
|
|
11
|
-
string email = 1;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
message GetByEmailResponse {
|
|
15
|
-
string id = 1;
|
|
16
|
-
string email = 2;
|
|
17
|
-
}
|