@trash-streamers/contracts 1.1.59 → 1.1.61

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,5 +1,18 @@
1
1
  import { Observable } from "rxjs";
2
2
  export declare const protobufPackage = "video.v1";
3
+ export declare enum Access {
4
+ PUBLIC = "PUBLIC",
5
+ PRIVATE = "PRIVATE",
6
+ BYLINK = "BYLINK",
7
+ UNRECOGNIZED = "UNRECOGNIZED"
8
+ }
9
+ export declare enum Status {
10
+ PENDING = "PENDING",
11
+ PROCESSING = "PROCESSING",
12
+ READY = "READY",
13
+ FAILED = "FAILED",
14
+ UNRECOGNIZED = "UNRECOGNIZED"
15
+ }
3
16
  export interface ConfirmVideoUploadRequest {
4
17
  videoId: string;
5
18
  fileKey: string;
@@ -9,12 +22,33 @@ export interface ConfirmVideoUploadRequest {
9
22
  export interface ConfirmVideoUploadResponse {
10
23
  success: boolean;
11
24
  }
25
+ export interface GetAllVideosOwnerRequest {
26
+ ownerId: string;
27
+ }
28
+ export interface GetAllVideosOwnerResponse {
29
+ videos: Video[];
30
+ }
31
+ export interface Video {
32
+ id: string;
33
+ ownerId: string;
34
+ title: string;
35
+ description?: string | undefined;
36
+ access: Access;
37
+ status: Status;
38
+ slug: string;
39
+ thumbnailUrl?: string | undefined;
40
+ path?: string | undefined;
41
+ updatedAt: Date | undefined;
42
+ createdAt: Date | undefined;
43
+ }
12
44
  export declare const VIDEO_V1_PACKAGE_NAME = "video.v1";
13
45
  export interface VideoServiceClient {
14
46
  confirmVideoUpload(request: ConfirmVideoUploadRequest): Observable<ConfirmVideoUploadResponse>;
47
+ getAllVideosOwner(request: GetAllVideosOwnerRequest): Observable<GetAllVideosOwnerResponse>;
15
48
  }
16
49
  export interface VideoServiceController {
17
50
  confirmVideoUpload(request: ConfirmVideoUploadRequest): Promise<ConfirmVideoUploadResponse> | Observable<ConfirmVideoUploadResponse> | ConfirmVideoUploadResponse;
51
+ getAllVideosOwner(request: GetAllVideosOwnerRequest): Promise<GetAllVideosOwnerResponse> | Observable<GetAllVideosOwnerResponse> | GetAllVideosOwnerResponse;
18
52
  }
19
53
  export declare function VideoServiceControllerMethods(): (constructor: Function) => void;
20
54
  export declare const VIDEO_SERVICE_NAME = "VideoService";
@@ -5,15 +5,39 @@
5
5
  // protoc v6.33.5
6
6
  // source: video.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.VIDEO_SERVICE_NAME = exports.VIDEO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.VIDEO_SERVICE_NAME = exports.VIDEO_V1_PACKAGE_NAME = exports.Status = exports.Access = exports.protobufPackage = void 0;
9
9
  exports.VideoServiceControllerMethods = VideoServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
+ const protobufjs_1 = require("protobufjs");
12
13
  exports.protobufPackage = "video.v1";
14
+ var Access;
15
+ (function (Access) {
16
+ Access["PUBLIC"] = "PUBLIC";
17
+ Access["PRIVATE"] = "PRIVATE";
18
+ Access["BYLINK"] = "BYLINK";
19
+ Access["UNRECOGNIZED"] = "UNRECOGNIZED";
20
+ })(Access || (exports.Access = Access = {}));
21
+ var Status;
22
+ (function (Status) {
23
+ Status["PENDING"] = "PENDING";
24
+ Status["PROCESSING"] = "PROCESSING";
25
+ Status["READY"] = "READY";
26
+ Status["FAILED"] = "FAILED";
27
+ Status["UNRECOGNIZED"] = "UNRECOGNIZED";
28
+ })(Status || (exports.Status = Status = {}));
13
29
  exports.VIDEO_V1_PACKAGE_NAME = "video.v1";
30
+ protobufjs_1.wrappers[".google.protobuf.Timestamp"] = {
31
+ fromObject(value) {
32
+ return { seconds: value.getTime() / 1000, nanos: (value.getTime() % 1000) * 1e6 };
33
+ },
34
+ toObject(message) {
35
+ return new Date(message.seconds * 1000 + message.nanos / 1e6);
36
+ },
37
+ };
14
38
  function VideoServiceControllerMethods() {
15
39
  return function (constructor) {
16
- const grpcMethods = ["confirmVideoUpload"];
40
+ const grpcMethods = ["confirmVideoUpload", "getAllVideosOwner"];
17
41
  for (const method of grpcMethods) {
18
42
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
43
  (0, microservices_1.GrpcMethod)("VideoService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trash-streamers/contracts",
3
- "version": "1.1.59",
3
+ "version": "1.1.61",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "scripts": {
package/proto/video.proto CHANGED
@@ -2,8 +2,10 @@ syntax = "proto3";
2
2
 
3
3
  package video.v1;
4
4
 
5
+ import "google/protobuf/timestamp.proto";
5
6
  service VideoService {
6
7
  rpc ConfirmVideoUpload (ConfirmVideoUploadRequest) returns (ConfirmVideoUploadResponse);
8
+ rpc GetAllVideosOwner (GetAllVideosOwnerRequest) returns (GetAllVideosOwnerResponse);
7
9
  }
8
10
 
9
11
  message ConfirmVideoUploadRequest {
@@ -13,7 +15,40 @@ message ConfirmVideoUploadRequest {
13
15
  string owner_id = 4;
14
16
  }
15
17
 
16
-
17
18
  message ConfirmVideoUploadResponse {
18
19
  bool success = 1;
19
- }
20
+ }
21
+
22
+ message GetAllVideosOwnerRequest {
23
+ string owner_id = 1;
24
+ }
25
+
26
+ message GetAllVideosOwnerResponse {
27
+ repeated Video videos = 1;
28
+ }
29
+ message Video {
30
+ string id = 1;
31
+ string owner_id = 2;
32
+ string title = 3;
33
+ optional string description = 4;
34
+ Access access = 5;
35
+ Status status= 6;
36
+ string slug = 7;
37
+ optional string thumbnail_url = 8;
38
+ optional string path = 9;
39
+ google.protobuf.Timestamp updated_at = 10;
40
+ google.protobuf.Timestamp created_at = 11;
41
+ }
42
+
43
+ enum Access {
44
+ PUBLIC = 0;
45
+ PRIVATE = 1;
46
+ BYLINK = 2;
47
+ }
48
+
49
+ enum Status {
50
+ PENDING = 0;
51
+ PROCESSING = 1;
52
+ READY = 2;
53
+ FAILED = 3;
54
+ }