@trash-streamers/contracts 1.1.58 → 1.1.60

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,3 +1,2 @@
1
1
  export * from "./avatar-requsted.interface";
2
- export * from "./video-downloaded";
3
2
  export * from "./video-created.interface";
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./avatar-requsted.interface"), exports);
18
- __exportStar(require("./video-downloaded"), exports);
19
18
  __exportStar(require("./video-created.interface"), exports);
@@ -3,3 +3,4 @@ export * from "./encoding-director";
3
3
  export * from "./encoder";
4
4
  export * from "./uploader";
5
5
  export * from "./playlist-sticher";
6
+ export * from "./video-downloaded.interface";
@@ -19,3 +19,4 @@ __exportStar(require("./encoding-director"), exports);
19
19
  __exportStar(require("./encoder"), exports);
20
20
  __exportStar(require("./uploader"), exports);
21
21
  __exportStar(require("./playlist-sticher"), exports);
22
+ __exportStar(require("./video-downloaded.interface"), exports);
@@ -2,4 +2,5 @@ export interface VideoDownloadedEvent {
2
2
  videoId: string;
3
3
  videoUrl: string;
4
4
  videoContainer: string;
5
+ ownerId: string;
5
6
  }
@@ -1,5 +1,18 @@
1
1
  import { Observable } from "rxjs";
2
2
  export declare const protobufPackage = "video.v1";
3
+ export declare enum AccessType {
4
+ PUBLIC = "PUBLIC",
5
+ PRIVATE = "PRIVATE",
6
+ BYLINK = "BYLINK",
7
+ UNRECOGNIZED = "UNRECOGNIZED"
8
+ }
9
+ export declare enum StatusType {
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: AccessType;
37
+ status: StatusType;
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.StatusType = exports.AccessType = 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 AccessType;
15
+ (function (AccessType) {
16
+ AccessType["PUBLIC"] = "PUBLIC";
17
+ AccessType["PRIVATE"] = "PRIVATE";
18
+ AccessType["BYLINK"] = "BYLINK";
19
+ AccessType["UNRECOGNIZED"] = "UNRECOGNIZED";
20
+ })(AccessType || (exports.AccessType = AccessType = {}));
21
+ var StatusType;
22
+ (function (StatusType) {
23
+ StatusType["PENDING"] = "PENDING";
24
+ StatusType["PROCESSING"] = "PROCESSING";
25
+ StatusType["READY"] = "READY";
26
+ StatusType["FAILED"] = "FAILED";
27
+ StatusType["UNRECOGNIZED"] = "UNRECOGNIZED";
28
+ })(StatusType || (exports.StatusType = StatusType = {}));
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.58",
3
+ "version": "1.1.60",
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
+ AccessType access = 5;
35
+ StatusType 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 AccessType {
44
+ PUBLIC = 0;
45
+ PRIVATE = 1;
46
+ BYLINK = 2;
47
+ }
48
+
49
+ enum StatusType {
50
+ PENDING = 0;
51
+ PROCESSING = 1;
52
+ READY = 2;
53
+ FAILED = 3;
54
+ }