@eyenest/contracts 1.1.3 → 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.
@@ -1,4 +1,4 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
- readonly USER: string;
3
+ readonly CAMERA: string;
4
4
  };
@@ -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
- USER: (0, path_1.join)(__dirname, '../../proto/user.proto'),
7
+ CAMERA: (0, path_1.join)(__dirname, '../../proto/camera.proto'),
8
8
  };
package/gen/ts/auth.ts CHANGED
@@ -30,23 +30,36 @@ export interface LoginResponse {
30
30
  refreshToken: string;
31
31
  }
32
32
 
33
+ export interface RefreshRequest {
34
+ refreshToken: string;
35
+ }
36
+
37
+ export interface RefreshResponse {
38
+ accessToken: string;
39
+ refreshToken: string;
40
+ }
41
+
33
42
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
34
43
 
35
44
  export interface AuthServiceClient {
36
45
  register(request: RegisterRequest): Observable<RegisterResponse>;
37
46
 
38
47
  login(request: LoginRequest): Observable<LoginResponse>;
48
+
49
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
39
50
  }
40
51
 
41
52
  export interface AuthServiceController {
42
53
  register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
43
54
 
44
55
  login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
56
+
57
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
45
58
  }
46
59
 
47
60
  export function AuthServiceControllerMethods() {
48
61
  return function (constructor: Function) {
49
- const grpcMethods: string[] = ["register", "login"];
62
+ const grpcMethods: string[] = ["register", "login", "refresh"];
50
63
  for (const method of grpcMethods) {
51
64
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
65
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -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 v3.21.12
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyenest/contracts",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -6,6 +6,7 @@ package auth.v1;
6
6
  service AuthService {
7
7
  rpc register (RegisterRequest) returns (RegisterResponse);
8
8
  rpc login (LoginRequest) returns (LoginResponse);
9
+ rpc refresh (RefreshRequest) returns (RefreshResponse);
9
10
  }
10
11
 
11
12
  message RegisterRequest {
@@ -28,3 +29,13 @@ message LoginResponse {
28
29
  string refreshToken = 2;
29
30
  }
30
31
 
32
+ message RefreshRequest {
33
+ string refreshToken = 1;
34
+ }
35
+
36
+ message RefreshResponse {
37
+ string accessToken = 1;
38
+ string refreshToken = 2;
39
+ }
40
+
41
+
@@ -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
- }