@lumina-cinema/contracts 1.1.5 → 1.1.7

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,7 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly USERS: string;
5
+ readonly MEDIA: string;
6
+ readonly MOVIE: string;
7
+ readonly CATEGORY: string;
5
8
  };
@@ -6,4 +6,7 @@ exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
7
7
  ACCOUNT: (0, path_1.join)(__dirname, "../../proto/account.proto"),
8
8
  USERS: (0, path_1.join)(__dirname, "../../proto/users.proto"),
9
+ MEDIA: (0, path_1.join)(__dirname, "../../proto/media.proto"),
10
+ MOVIE: (0, path_1.join)(__dirname, "../../proto/movie.proto"),
11
+ CATEGORY: (0, path_1.join)(__dirname, "../../proto/category.proto"),
9
12
  };
@@ -0,0 +1,425 @@
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-go v1.36.10
4
+ // protoc v6.33.2
5
+ // source: media.proto
6
+
7
+ package media
8
+
9
+ import (
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ reflect "reflect"
13
+ sync "sync"
14
+ unsafe "unsafe"
15
+ )
16
+
17
+ const (
18
+ // Verify that this generated code is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
20
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
21
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
22
+ )
23
+
24
+ type UploadRequest struct {
25
+ state protoimpl.MessageState `protogen:"open.v1"`
26
+ FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
27
+ Folder string `protobuf:"bytes,2,opt,name=folder,proto3" json:"folder,omitempty"`
28
+ ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
29
+ Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
30
+ ResizeWidth *int32 `protobuf:"varint,5,opt,name=resize_width,json=resizeWidth,proto3,oneof" json:"resize_width,omitempty"`
31
+ ResizeHeight *int32 `protobuf:"varint,6,opt,name=resize_height,json=resizeHeight,proto3,oneof" json:"resize_height,omitempty"`
32
+ unknownFields protoimpl.UnknownFields
33
+ sizeCache protoimpl.SizeCache
34
+ }
35
+
36
+ func (x *UploadRequest) Reset() {
37
+ *x = UploadRequest{}
38
+ mi := &file_media_proto_msgTypes[0]
39
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
40
+ ms.StoreMessageInfo(mi)
41
+ }
42
+
43
+ func (x *UploadRequest) String() string {
44
+ return protoimpl.X.MessageStringOf(x)
45
+ }
46
+
47
+ func (*UploadRequest) ProtoMessage() {}
48
+
49
+ func (x *UploadRequest) ProtoReflect() protoreflect.Message {
50
+ mi := &file_media_proto_msgTypes[0]
51
+ if x != nil {
52
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
53
+ if ms.LoadMessageInfo() == nil {
54
+ ms.StoreMessageInfo(mi)
55
+ }
56
+ return ms
57
+ }
58
+ return mi.MessageOf(x)
59
+ }
60
+
61
+ // Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.
62
+ func (*UploadRequest) Descriptor() ([]byte, []int) {
63
+ return file_media_proto_rawDescGZIP(), []int{0}
64
+ }
65
+
66
+ func (x *UploadRequest) GetFileName() string {
67
+ if x != nil {
68
+ return x.FileName
69
+ }
70
+ return ""
71
+ }
72
+
73
+ func (x *UploadRequest) GetFolder() string {
74
+ if x != nil {
75
+ return x.Folder
76
+ }
77
+ return ""
78
+ }
79
+
80
+ func (x *UploadRequest) GetContentType() string {
81
+ if x != nil {
82
+ return x.ContentType
83
+ }
84
+ return ""
85
+ }
86
+
87
+ func (x *UploadRequest) GetData() []byte {
88
+ if x != nil {
89
+ return x.Data
90
+ }
91
+ return nil
92
+ }
93
+
94
+ func (x *UploadRequest) GetResizeWidth() int32 {
95
+ if x != nil && x.ResizeWidth != nil {
96
+ return *x.ResizeWidth
97
+ }
98
+ return 0
99
+ }
100
+
101
+ func (x *UploadRequest) GetResizeHeight() int32 {
102
+ if x != nil && x.ResizeHeight != nil {
103
+ return *x.ResizeHeight
104
+ }
105
+ return 0
106
+ }
107
+
108
+ type UploadResponse struct {
109
+ state protoimpl.MessageState `protogen:"open.v1"`
110
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
111
+ unknownFields protoimpl.UnknownFields
112
+ sizeCache protoimpl.SizeCache
113
+ }
114
+
115
+ func (x *UploadResponse) Reset() {
116
+ *x = UploadResponse{}
117
+ mi := &file_media_proto_msgTypes[1]
118
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
119
+ ms.StoreMessageInfo(mi)
120
+ }
121
+
122
+ func (x *UploadResponse) String() string {
123
+ return protoimpl.X.MessageStringOf(x)
124
+ }
125
+
126
+ func (*UploadResponse) ProtoMessage() {}
127
+
128
+ func (x *UploadResponse) ProtoReflect() protoreflect.Message {
129
+ mi := &file_media_proto_msgTypes[1]
130
+ if x != nil {
131
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
132
+ if ms.LoadMessageInfo() == nil {
133
+ ms.StoreMessageInfo(mi)
134
+ }
135
+ return ms
136
+ }
137
+ return mi.MessageOf(x)
138
+ }
139
+
140
+ // Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.
141
+ func (*UploadResponse) Descriptor() ([]byte, []int) {
142
+ return file_media_proto_rawDescGZIP(), []int{1}
143
+ }
144
+
145
+ func (x *UploadResponse) GetKey() string {
146
+ if x != nil {
147
+ return x.Key
148
+ }
149
+ return ""
150
+ }
151
+
152
+ type GetRequest struct {
153
+ state protoimpl.MessageState `protogen:"open.v1"`
154
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
155
+ unknownFields protoimpl.UnknownFields
156
+ sizeCache protoimpl.SizeCache
157
+ }
158
+
159
+ func (x *GetRequest) Reset() {
160
+ *x = GetRequest{}
161
+ mi := &file_media_proto_msgTypes[2]
162
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
163
+ ms.StoreMessageInfo(mi)
164
+ }
165
+
166
+ func (x *GetRequest) String() string {
167
+ return protoimpl.X.MessageStringOf(x)
168
+ }
169
+
170
+ func (*GetRequest) ProtoMessage() {}
171
+
172
+ func (x *GetRequest) ProtoReflect() protoreflect.Message {
173
+ mi := &file_media_proto_msgTypes[2]
174
+ if x != nil {
175
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
176
+ if ms.LoadMessageInfo() == nil {
177
+ ms.StoreMessageInfo(mi)
178
+ }
179
+ return ms
180
+ }
181
+ return mi.MessageOf(x)
182
+ }
183
+
184
+ // Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
185
+ func (*GetRequest) Descriptor() ([]byte, []int) {
186
+ return file_media_proto_rawDescGZIP(), []int{2}
187
+ }
188
+
189
+ func (x *GetRequest) GetKey() string {
190
+ if x != nil {
191
+ return x.Key
192
+ }
193
+ return ""
194
+ }
195
+
196
+ type GetResponse struct {
197
+ state protoimpl.MessageState `protogen:"open.v1"`
198
+ Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
199
+ ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
200
+ unknownFields protoimpl.UnknownFields
201
+ sizeCache protoimpl.SizeCache
202
+ }
203
+
204
+ func (x *GetResponse) Reset() {
205
+ *x = GetResponse{}
206
+ mi := &file_media_proto_msgTypes[3]
207
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
208
+ ms.StoreMessageInfo(mi)
209
+ }
210
+
211
+ func (x *GetResponse) String() string {
212
+ return protoimpl.X.MessageStringOf(x)
213
+ }
214
+
215
+ func (*GetResponse) ProtoMessage() {}
216
+
217
+ func (x *GetResponse) ProtoReflect() protoreflect.Message {
218
+ mi := &file_media_proto_msgTypes[3]
219
+ if x != nil {
220
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
221
+ if ms.LoadMessageInfo() == nil {
222
+ ms.StoreMessageInfo(mi)
223
+ }
224
+ return ms
225
+ }
226
+ return mi.MessageOf(x)
227
+ }
228
+
229
+ // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
230
+ func (*GetResponse) Descriptor() ([]byte, []int) {
231
+ return file_media_proto_rawDescGZIP(), []int{3}
232
+ }
233
+
234
+ func (x *GetResponse) GetData() []byte {
235
+ if x != nil {
236
+ return x.Data
237
+ }
238
+ return nil
239
+ }
240
+
241
+ func (x *GetResponse) GetContentType() string {
242
+ if x != nil {
243
+ return x.ContentType
244
+ }
245
+ return ""
246
+ }
247
+
248
+ type DeleteRequest struct {
249
+ state protoimpl.MessageState `protogen:"open.v1"`
250
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
251
+ unknownFields protoimpl.UnknownFields
252
+ sizeCache protoimpl.SizeCache
253
+ }
254
+
255
+ func (x *DeleteRequest) Reset() {
256
+ *x = DeleteRequest{}
257
+ mi := &file_media_proto_msgTypes[4]
258
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
259
+ ms.StoreMessageInfo(mi)
260
+ }
261
+
262
+ func (x *DeleteRequest) String() string {
263
+ return protoimpl.X.MessageStringOf(x)
264
+ }
265
+
266
+ func (*DeleteRequest) ProtoMessage() {}
267
+
268
+ func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
269
+ mi := &file_media_proto_msgTypes[4]
270
+ if x != nil {
271
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
272
+ if ms.LoadMessageInfo() == nil {
273
+ ms.StoreMessageInfo(mi)
274
+ }
275
+ return ms
276
+ }
277
+ return mi.MessageOf(x)
278
+ }
279
+
280
+ // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
281
+ func (*DeleteRequest) Descriptor() ([]byte, []int) {
282
+ return file_media_proto_rawDescGZIP(), []int{4}
283
+ }
284
+
285
+ func (x *DeleteRequest) GetKey() string {
286
+ if x != nil {
287
+ return x.Key
288
+ }
289
+ return ""
290
+ }
291
+
292
+ type DeleteResponse struct {
293
+ state protoimpl.MessageState `protogen:"open.v1"`
294
+ Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
295
+ unknownFields protoimpl.UnknownFields
296
+ sizeCache protoimpl.SizeCache
297
+ }
298
+
299
+ func (x *DeleteResponse) Reset() {
300
+ *x = DeleteResponse{}
301
+ mi := &file_media_proto_msgTypes[5]
302
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
303
+ ms.StoreMessageInfo(mi)
304
+ }
305
+
306
+ func (x *DeleteResponse) String() string {
307
+ return protoimpl.X.MessageStringOf(x)
308
+ }
309
+
310
+ func (*DeleteResponse) ProtoMessage() {}
311
+
312
+ func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
313
+ mi := &file_media_proto_msgTypes[5]
314
+ if x != nil {
315
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
316
+ if ms.LoadMessageInfo() == nil {
317
+ ms.StoreMessageInfo(mi)
318
+ }
319
+ return ms
320
+ }
321
+ return mi.MessageOf(x)
322
+ }
323
+
324
+ // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
325
+ func (*DeleteResponse) Descriptor() ([]byte, []int) {
326
+ return file_media_proto_rawDescGZIP(), []int{5}
327
+ }
328
+
329
+ func (x *DeleteResponse) GetOk() bool {
330
+ if x != nil {
331
+ return x.Ok
332
+ }
333
+ return false
334
+ }
335
+
336
+ var File_media_proto protoreflect.FileDescriptor
337
+
338
+ const file_media_proto_rawDesc = "" +
339
+ "\n" +
340
+ "\vmedia.proto\x12\bmedia.v1\"\xf0\x01\n" +
341
+ "\rUploadRequest\x12\x1b\n" +
342
+ "\tfile_name\x18\x01 \x01(\tR\bfileName\x12\x16\n" +
343
+ "\x06folder\x18\x02 \x01(\tR\x06folder\x12!\n" +
344
+ "\fcontent_type\x18\x03 \x01(\tR\vcontentType\x12\x12\n" +
345
+ "\x04data\x18\x04 \x01(\fR\x04data\x12&\n" +
346
+ "\fresize_width\x18\x05 \x01(\x05H\x00R\vresizeWidth\x88\x01\x01\x12(\n" +
347
+ "\rresize_height\x18\x06 \x01(\x05H\x01R\fresizeHeight\x88\x01\x01B\x0f\n" +
348
+ "\r_resize_widthB\x10\n" +
349
+ "\x0e_resize_height\"\"\n" +
350
+ "\x0eUploadResponse\x12\x10\n" +
351
+ "\x03key\x18\x01 \x01(\tR\x03key\"\x1e\n" +
352
+ "\n" +
353
+ "GetRequest\x12\x10\n" +
354
+ "\x03key\x18\x01 \x01(\tR\x03key\"D\n" +
355
+ "\vGetResponse\x12\x12\n" +
356
+ "\x04data\x18\x01 \x01(\fR\x04data\x12!\n" +
357
+ "\fcontent_type\x18\x02 \x01(\tR\vcontentType\"!\n" +
358
+ "\rDeleteRequest\x12\x10\n" +
359
+ "\x03key\x18\x01 \x01(\tR\x03key\" \n" +
360
+ "\x0eDeleteResponse\x12\x0e\n" +
361
+ "\x02ok\x18\x01 \x01(\bR\x02ok2\xbc\x01\n" +
362
+ "\fMediaService\x12;\n" +
363
+ "\x06Upload\x12\x17.media.v1.UploadRequest\x1a\x18.media.v1.UploadResponse\x122\n" +
364
+ "\x03Get\x12\x14.media.v1.GetRequest\x1a\x15.media.v1.GetResponse\x12;\n" +
365
+ "\x06Delete\x12\x17.media.v1.DeleteRequest\x1a\x18.media.v1.DeleteResponseB2P\x01Z.github.com/lumina-cinema/contracts/media;mediab\x06proto3"
366
+
367
+ var (
368
+ file_media_proto_rawDescOnce sync.Once
369
+ file_media_proto_rawDescData []byte
370
+ )
371
+
372
+ func file_media_proto_rawDescGZIP() []byte {
373
+ file_media_proto_rawDescOnce.Do(func() {
374
+ file_media_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_media_proto_rawDesc), len(file_media_proto_rawDesc)))
375
+ })
376
+ return file_media_proto_rawDescData
377
+ }
378
+
379
+ var file_media_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
380
+ var file_media_proto_goTypes = []any{
381
+ (*UploadRequest)(nil), // 0: media.v1.UploadRequest
382
+ (*UploadResponse)(nil), // 1: media.v1.UploadResponse
383
+ (*GetRequest)(nil), // 2: media.v1.GetRequest
384
+ (*GetResponse)(nil), // 3: media.v1.GetResponse
385
+ (*DeleteRequest)(nil), // 4: media.v1.DeleteRequest
386
+ (*DeleteResponse)(nil), // 5: media.v1.DeleteResponse
387
+ }
388
+ var file_media_proto_depIdxs = []int32{
389
+ 0, // 0: media.v1.MediaService.Upload:input_type -> media.v1.UploadRequest
390
+ 2, // 1: media.v1.MediaService.Get:input_type -> media.v1.GetRequest
391
+ 4, // 2: media.v1.MediaService.Delete:input_type -> media.v1.DeleteRequest
392
+ 1, // 3: media.v1.MediaService.Upload:output_type -> media.v1.UploadResponse
393
+ 3, // 4: media.v1.MediaService.Get:output_type -> media.v1.GetResponse
394
+ 5, // 5: media.v1.MediaService.Delete:output_type -> media.v1.DeleteResponse
395
+ 3, // [3:6] is the sub-list for method output_type
396
+ 0, // [0:3] is the sub-list for method input_type
397
+ 0, // [0:0] is the sub-list for extension type_name
398
+ 0, // [0:0] is the sub-list for extension extendee
399
+ 0, // [0:0] is the sub-list for field type_name
400
+ }
401
+
402
+ func init() { file_media_proto_init() }
403
+ func file_media_proto_init() {
404
+ if File_media_proto != nil {
405
+ return
406
+ }
407
+ file_media_proto_msgTypes[0].OneofWrappers = []any{}
408
+ type x struct{}
409
+ out := protoimpl.TypeBuilder{
410
+ File: protoimpl.DescBuilder{
411
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
412
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_media_proto_rawDesc), len(file_media_proto_rawDesc)),
413
+ NumEnums: 0,
414
+ NumMessages: 6,
415
+ NumExtensions: 0,
416
+ NumServices: 1,
417
+ },
418
+ GoTypes: file_media_proto_goTypes,
419
+ DependencyIndexes: file_media_proto_depIdxs,
420
+ MessageInfos: file_media_proto_msgTypes,
421
+ }.Build()
422
+ File_media_proto = out.File
423
+ file_media_proto_goTypes = nil
424
+ file_media_proto_depIdxs = nil
425
+ }
@@ -0,0 +1,197 @@
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+ // versions:
3
+ // - protoc-gen-go-grpc v1.5.1
4
+ // - protoc v6.33.2
5
+ // source: media.proto
6
+
7
+ package media
8
+
9
+ import (
10
+ context "context"
11
+ grpc "google.golang.org/grpc"
12
+ codes "google.golang.org/grpc/codes"
13
+ status "google.golang.org/grpc/status"
14
+ )
15
+
16
+ // This is a compile-time assertion to ensure that this generated file
17
+ // is compatible with the grpc package it is being compiled against.
18
+ // Requires gRPC-Go v1.64.0 or later.
19
+ const _ = grpc.SupportPackageIsVersion9
20
+
21
+ const (
22
+ MediaService_Upload_FullMethodName = "/media.v1.MediaService/Upload"
23
+ MediaService_Get_FullMethodName = "/media.v1.MediaService/Get"
24
+ MediaService_Delete_FullMethodName = "/media.v1.MediaService/Delete"
25
+ )
26
+
27
+ // MediaServiceClient is the client API for MediaService service.
28
+ //
29
+ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
30
+ type MediaServiceClient interface {
31
+ Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error)
32
+ Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
33
+ Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
34
+ }
35
+
36
+ type mediaServiceClient struct {
37
+ cc grpc.ClientConnInterface
38
+ }
39
+
40
+ func NewMediaServiceClient(cc grpc.ClientConnInterface) MediaServiceClient {
41
+ return &mediaServiceClient{cc}
42
+ }
43
+
44
+ func (c *mediaServiceClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) {
45
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
46
+ out := new(UploadResponse)
47
+ err := c.cc.Invoke(ctx, MediaService_Upload_FullMethodName, in, out, cOpts...)
48
+ if err != nil {
49
+ return nil, err
50
+ }
51
+ return out, nil
52
+ }
53
+
54
+ func (c *mediaServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
55
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
56
+ out := new(GetResponse)
57
+ err := c.cc.Invoke(ctx, MediaService_Get_FullMethodName, in, out, cOpts...)
58
+ if err != nil {
59
+ return nil, err
60
+ }
61
+ return out, nil
62
+ }
63
+
64
+ func (c *mediaServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
65
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
66
+ out := new(DeleteResponse)
67
+ err := c.cc.Invoke(ctx, MediaService_Delete_FullMethodName, in, out, cOpts...)
68
+ if err != nil {
69
+ return nil, err
70
+ }
71
+ return out, nil
72
+ }
73
+
74
+ // MediaServiceServer is the server API for MediaService service.
75
+ // All implementations must embed UnimplementedMediaServiceServer
76
+ // for forward compatibility.
77
+ type MediaServiceServer interface {
78
+ Upload(context.Context, *UploadRequest) (*UploadResponse, error)
79
+ Get(context.Context, *GetRequest) (*GetResponse, error)
80
+ Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
81
+ mustEmbedUnimplementedMediaServiceServer()
82
+ }
83
+
84
+ // UnimplementedMediaServiceServer must be embedded to have
85
+ // forward compatible implementations.
86
+ //
87
+ // NOTE: this should be embedded by value instead of pointer to avoid a nil
88
+ // pointer dereference when methods are called.
89
+ type UnimplementedMediaServiceServer struct{}
90
+
91
+ func (UnimplementedMediaServiceServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) {
92
+ return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
93
+ }
94
+ func (UnimplementedMediaServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) {
95
+ return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
96
+ }
97
+ func (UnimplementedMediaServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
98
+ return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
99
+ }
100
+ func (UnimplementedMediaServiceServer) mustEmbedUnimplementedMediaServiceServer() {}
101
+ func (UnimplementedMediaServiceServer) testEmbeddedByValue() {}
102
+
103
+ // UnsafeMediaServiceServer may be embedded to opt out of forward compatibility for this service.
104
+ // Use of this interface is not recommended, as added methods to MediaServiceServer will
105
+ // result in compilation errors.
106
+ type UnsafeMediaServiceServer interface {
107
+ mustEmbedUnimplementedMediaServiceServer()
108
+ }
109
+
110
+ func RegisterMediaServiceServer(s grpc.ServiceRegistrar, srv MediaServiceServer) {
111
+ // If the following call pancis, it indicates UnimplementedMediaServiceServer was
112
+ // embedded by pointer and is nil. This will cause panics if an
113
+ // unimplemented method is ever invoked, so we test this at initialization
114
+ // time to prevent it from happening at runtime later due to I/O.
115
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
116
+ t.testEmbeddedByValue()
117
+ }
118
+ s.RegisterService(&MediaService_ServiceDesc, srv)
119
+ }
120
+
121
+ func _MediaService_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
122
+ in := new(UploadRequest)
123
+ if err := dec(in); err != nil {
124
+ return nil, err
125
+ }
126
+ if interceptor == nil {
127
+ return srv.(MediaServiceServer).Upload(ctx, in)
128
+ }
129
+ info := &grpc.UnaryServerInfo{
130
+ Server: srv,
131
+ FullMethod: MediaService_Upload_FullMethodName,
132
+ }
133
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
134
+ return srv.(MediaServiceServer).Upload(ctx, req.(*UploadRequest))
135
+ }
136
+ return interceptor(ctx, in, info, handler)
137
+ }
138
+
139
+ func _MediaService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
140
+ in := new(GetRequest)
141
+ if err := dec(in); err != nil {
142
+ return nil, err
143
+ }
144
+ if interceptor == nil {
145
+ return srv.(MediaServiceServer).Get(ctx, in)
146
+ }
147
+ info := &grpc.UnaryServerInfo{
148
+ Server: srv,
149
+ FullMethod: MediaService_Get_FullMethodName,
150
+ }
151
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
152
+ return srv.(MediaServiceServer).Get(ctx, req.(*GetRequest))
153
+ }
154
+ return interceptor(ctx, in, info, handler)
155
+ }
156
+
157
+ func _MediaService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
158
+ in := new(DeleteRequest)
159
+ if err := dec(in); err != nil {
160
+ return nil, err
161
+ }
162
+ if interceptor == nil {
163
+ return srv.(MediaServiceServer).Delete(ctx, in)
164
+ }
165
+ info := &grpc.UnaryServerInfo{
166
+ Server: srv,
167
+ FullMethod: MediaService_Delete_FullMethodName,
168
+ }
169
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
170
+ return srv.(MediaServiceServer).Delete(ctx, req.(*DeleteRequest))
171
+ }
172
+ return interceptor(ctx, in, info, handler)
173
+ }
174
+
175
+ // MediaService_ServiceDesc is the grpc.ServiceDesc for MediaService service.
176
+ // It's only intended for direct use with grpc.RegisterService,
177
+ // and not to be introspected or modified (even as a copy)
178
+ var MediaService_ServiceDesc = grpc.ServiceDesc{
179
+ ServiceName: "media.v1.MediaService",
180
+ HandlerType: (*MediaServiceServer)(nil),
181
+ Methods: []grpc.MethodDesc{
182
+ {
183
+ MethodName: "Upload",
184
+ Handler: _MediaService_Upload_Handler,
185
+ },
186
+ {
187
+ MethodName: "Get",
188
+ Handler: _MediaService_Get_Handler,
189
+ },
190
+ {
191
+ MethodName: "Delete",
192
+ Handler: _MediaService_Delete_Handler,
193
+ },
194
+ },
195
+ Streams: []grpc.StreamDesc{},
196
+ Metadata: "media.proto",
197
+ }
@@ -0,0 +1,79 @@
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: category.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { Empty } from "./google/protobuf/empty";
11
+
12
+ export const protobufPackage = "category.v1";
13
+
14
+ /** Response payload for GetAllCategories. */
15
+ export interface GetAllCategoriesResponse {
16
+ /** Full list of categories visible to the caller. */
17
+ categories: Category[];
18
+ }
19
+
20
+ /** Category is a lightweight domain object used for grouping movies. */
21
+ export interface Category {
22
+ /** Stable category identifier (UUID/string depending on backend storage). */
23
+ id: string;
24
+ /** Human-readable category title shown in UI. */
25
+ title: string;
26
+ /** URL-friendly unique key used in routes and query filters. */
27
+ slug: string;
28
+ }
29
+
30
+ export const CATEGORY_V1_PACKAGE_NAME = "category.v1";
31
+
32
+ /**
33
+ * CategoryService provides read operations for movie categories used by
34
+ * catalog filtering and navigation in client applications.
35
+ */
36
+
37
+ export interface CategoryServiceClient {
38
+ /**
39
+ * Returns all categories available in the catalog.
40
+ * The response is expected to be used as reference data and can be cached
41
+ * on the client for a short period if freshness requirements allow.
42
+ */
43
+
44
+ getAllCategories(request: Empty): Observable<GetAllCategoriesResponse>;
45
+ }
46
+
47
+ /**
48
+ * CategoryService provides read operations for movie categories used by
49
+ * catalog filtering and navigation in client applications.
50
+ */
51
+
52
+ export interface CategoryServiceController {
53
+ /**
54
+ * Returns all categories available in the catalog.
55
+ * The response is expected to be used as reference data and can be cached
56
+ * on the client for a short period if freshness requirements allow.
57
+ */
58
+
59
+ getAllCategories(
60
+ request: Empty,
61
+ ): Promise<GetAllCategoriesResponse> | Observable<GetAllCategoriesResponse> | GetAllCategoriesResponse;
62
+ }
63
+
64
+ export function CategoryServiceControllerMethods() {
65
+ return function (constructor: Function) {
66
+ const grpcMethods: string[] = ["getAllCategories"];
67
+ for (const method of grpcMethods) {
68
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
69
+ GrpcMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
70
+ }
71
+ const grpcStreamMethods: string[] = [];
72
+ for (const method of grpcStreamMethods) {
73
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
74
+ GrpcStreamMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
75
+ }
76
+ };
77
+ }
78
+
79
+ export const CATEGORY_SERVICE_NAME = "CategoryService";
@@ -0,0 +1,118 @@
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: google/protobuf/timestamp.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "google.protobuf";
10
+
11
+ /**
12
+ * A Timestamp represents a point in time independent of any time zone or local
13
+ * calendar, encoded as a count of seconds and fractions of seconds at
14
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
15
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
16
+ * Gregorian calendar backwards to year one.
17
+ *
18
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
19
+ * second table is needed for interpretation, using a [24-hour linear
20
+ * smear](https://developers.google.com/time/smear).
21
+ *
22
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
23
+ * restricting to that range, we ensure that we can convert to and from [RFC
24
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
25
+ *
26
+ * # Examples
27
+ *
28
+ * Example 1: Compute Timestamp from POSIX `time()`.
29
+ *
30
+ * Timestamp timestamp;
31
+ * timestamp.set_seconds(time(NULL));
32
+ * timestamp.set_nanos(0);
33
+ *
34
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
35
+ *
36
+ * struct timeval tv;
37
+ * gettimeofday(&tv, NULL);
38
+ *
39
+ * Timestamp timestamp;
40
+ * timestamp.set_seconds(tv.tv_sec);
41
+ * timestamp.set_nanos(tv.tv_usec * 1000);
42
+ *
43
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
44
+ *
45
+ * FILETIME ft;
46
+ * GetSystemTimeAsFileTime(&ft);
47
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
48
+ *
49
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
50
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
51
+ * Timestamp timestamp;
52
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
53
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
54
+ *
55
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
56
+ *
57
+ * long millis = System.currentTimeMillis();
58
+ *
59
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
60
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
61
+ *
62
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
63
+ *
64
+ * Instant now = Instant.now();
65
+ *
66
+ * Timestamp timestamp =
67
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
68
+ * .setNanos(now.getNano()).build();
69
+ *
70
+ * Example 6: Compute Timestamp from current time in Python.
71
+ *
72
+ * timestamp = Timestamp()
73
+ * timestamp.GetCurrentTime()
74
+ *
75
+ * # JSON Mapping
76
+ *
77
+ * In JSON format, the Timestamp type is encoded as a string in the
78
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
79
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
80
+ * where {year} is always expressed using four digits while {month}, {day},
81
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
82
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
83
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
84
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
85
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
86
+ * able to accept both UTC and other timezones (as indicated by an offset).
87
+ *
88
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
89
+ * 01:30 UTC on January 15, 2017.
90
+ *
91
+ * In JavaScript, one can convert a Date object to this format using the
92
+ * standard
93
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
94
+ * method. In Python, a standard `datetime.datetime` object can be converted
95
+ * to this format using
96
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
97
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
98
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
99
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
100
+ * ) to obtain a formatter capable of generating timestamps in this format.
101
+ */
102
+ export interface Timestamp {
103
+ /**
104
+ * Represents seconds of UTC time since Unix epoch
105
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
106
+ * 9999-12-31T23:59:59Z inclusive.
107
+ */
108
+ seconds: number;
109
+ /**
110
+ * Non-negative fractions of a second at nanosecond resolution. Negative
111
+ * second values with fractions must still have non-negative nanos values
112
+ * that count forward in time. Must be from 0 to 999,999,999
113
+ * inclusive.
114
+ */
115
+ nanos: number;
116
+ }
117
+
118
+ export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
package/gen/ts/media.ts CHANGED
@@ -10,51 +10,99 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "media.v1";
12
12
 
13
+ /** Request to upload a media file. */
13
14
  export interface UploadRequest {
15
+ /** Original file name (used for metadata/auditing; not required to be unique). */
14
16
  fileName: string;
17
+ /** Logical folder/prefix in storage bucket (for example "movies/posters"). */
15
18
  folder: string;
19
+ /** MIME type of uploaded payload (for example "image/jpeg"). */
16
20
  contentType: string;
21
+ /** Raw file bytes. */
17
22
  data: Uint8Array;
18
- resizeWidth?: number | undefined;
23
+ /** Optional target width for server-side resize operations. */
24
+ resizeWidth?:
25
+ | number
26
+ | undefined;
27
+ /** Optional target height for server-side resize operations. */
19
28
  resizeHeight?: number | undefined;
20
29
  }
21
30
 
31
+ /** Result of a successful upload. */
22
32
  export interface UploadResponse {
33
+ /** Storage key of uploaded object. */
23
34
  key: string;
24
35
  }
25
36
 
37
+ /** Request to retrieve a stored media object. */
26
38
  export interface GetRequest {
39
+ /** Storage key returned by Upload. */
27
40
  key: string;
28
41
  }
29
42
 
43
+ /** Raw media payload returned by Get. */
30
44
  export interface GetResponse {
45
+ /** Raw file bytes. */
31
46
  data: Uint8Array;
47
+ /** MIME type of the returned payload. */
32
48
  contentType: string;
33
49
  }
34
50
 
51
+ /** Request to delete a stored media object. */
35
52
  export interface DeleteRequest {
53
+ /** Storage key returned by Upload. */
36
54
  key: string;
37
55
  }
38
56
 
57
+ /** Result of deletion operation. */
39
58
  export interface DeleteResponse {
59
+ /** True if object was deleted or delete was treated as successful. */
40
60
  ok: boolean;
41
61
  }
42
62
 
43
63
  export const MEDIA_V1_PACKAGE_NAME = "media.v1";
44
64
 
65
+ /**
66
+ * MediaService provides primitive object-storage style operations for
67
+ * binary assets (images, posters, banners, etc.).
68
+ */
69
+
45
70
  export interface MediaServiceClient {
71
+ /**
72
+ * Uploads a binary payload and returns a storage key that can be used
73
+ * in subsequent Get/Delete operations.
74
+ */
75
+
46
76
  upload(request: UploadRequest): Observable<UploadResponse>;
47
77
 
78
+ /** Retrieves raw file bytes and content type by storage key. */
79
+
48
80
  get(request: GetRequest): Observable<GetResponse>;
49
81
 
82
+ /** Deletes a file by storage key. */
83
+
50
84
  delete(request: DeleteRequest): Observable<DeleteResponse>;
51
85
  }
52
86
 
87
+ /**
88
+ * MediaService provides primitive object-storage style operations for
89
+ * binary assets (images, posters, banners, etc.).
90
+ */
91
+
53
92
  export interface MediaServiceController {
93
+ /**
94
+ * Uploads a binary payload and returns a storage key that can be used
95
+ * in subsequent Get/Delete operations.
96
+ */
97
+
54
98
  upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
55
99
 
100
+ /** Retrieves raw file bytes and content type by storage key. */
101
+
56
102
  get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
57
103
 
104
+ /** Deletes a file by storage key. */
105
+
58
106
  delete(request: DeleteRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
59
107
  }
60
108
 
@@ -0,0 +1,147 @@
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: movie.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { Timestamp } from "./google/protobuf/timestamp";
11
+
12
+ export const protobufPackage = "movie.v1";
13
+
14
+ /** Request parameters for movie listing. */
15
+ export interface ListMoviesRequest {
16
+ /**
17
+ * Optional category slug/id depending on backend implementation.
18
+ * Empty value means "all categories".
19
+ */
20
+ category: string;
21
+ /** If true, backend may randomize result order (for recommendations/hero blocks). */
22
+ random: boolean;
23
+ /** Maximum number of movies to return. Backend may apply an upper bound. */
24
+ limit: number;
25
+ }
26
+
27
+ /** Response containing a list of movie cards. */
28
+ export interface ListMoviesResponse {
29
+ /** Movies matching request filters. */
30
+ movies: Movie[];
31
+ }
32
+
33
+ /**
34
+ * Request for fetching a single movie.
35
+ * Exactly one field in `key` should be set by the client.
36
+ */
37
+ export interface GetMovieRequest {
38
+ /** Internal movie identifier. */
39
+ id?:
40
+ | string
41
+ | undefined;
42
+ /** Public URL slug. */
43
+ slug?: string | undefined;
44
+ }
45
+
46
+ /** Response for GetMovie. */
47
+ export interface GetMovieResponse {
48
+ /** Full movie details payload. */
49
+ movie: MovieDetails | undefined;
50
+ }
51
+
52
+ /** Compact movie model for listing views. */
53
+ export interface Movie {
54
+ /** Internal movie identifier. */
55
+ id: string;
56
+ /** Display title. */
57
+ title: string;
58
+ /** URL-friendly unique slug. */
59
+ slug: string;
60
+ /** Poster image URL/key. */
61
+ poster: string;
62
+ /** Age rating label (for example "16+", "PG-13"). */
63
+ ratingAge: string;
64
+ /** Official release date. */
65
+ releaseDate: Timestamp | undefined;
66
+ }
67
+
68
+ /** Extended movie model for detail page. */
69
+ export interface MovieDetails {
70
+ /** Internal movie identifier. */
71
+ id: string;
72
+ /** Display title. */
73
+ title: string;
74
+ /** URL-friendly unique slug. */
75
+ slug: string;
76
+ /** Full movie description/synopsis. */
77
+ description: string;
78
+ /** Poster image URL/key. */
79
+ poster: string;
80
+ /** Banner/backdrop image URL/key. */
81
+ banner: string;
82
+ /** Duration in minutes. */
83
+ duration: number;
84
+ /** Age rating label. */
85
+ ratingAge: string;
86
+ /** Country of production (display value). */
87
+ country: string;
88
+ /** Official release date. */
89
+ releaseDate: Timestamp | undefined;
90
+ }
91
+
92
+ export const MOVIE_V1_PACKAGE_NAME = "movie.v1";
93
+
94
+ /**
95
+ * MovieService provides read-only access to movie catalog entities.
96
+ * It exposes listing and detail retrieval endpoints.
97
+ */
98
+
99
+ export interface MovieServiceClient {
100
+ /**
101
+ * Returns a list of movies with optional category filter, randomization,
102
+ * and a hard limit on item count.
103
+ */
104
+
105
+ listMovies(request: ListMoviesRequest): Observable<ListMoviesResponse>;
106
+
107
+ /** Returns a single movie by either internal id or public slug. */
108
+
109
+ getMovie(request: GetMovieRequest): Observable<GetMovieResponse>;
110
+ }
111
+
112
+ /**
113
+ * MovieService provides read-only access to movie catalog entities.
114
+ * It exposes listing and detail retrieval endpoints.
115
+ */
116
+
117
+ export interface MovieServiceController {
118
+ /**
119
+ * Returns a list of movies with optional category filter, randomization,
120
+ * and a hard limit on item count.
121
+ */
122
+
123
+ listMovies(
124
+ request: ListMoviesRequest,
125
+ ): Promise<ListMoviesResponse> | Observable<ListMoviesResponse> | ListMoviesResponse;
126
+
127
+ /** Returns a single movie by either internal id or public slug. */
128
+
129
+ getMovie(request: GetMovieRequest): Promise<GetMovieResponse> | Observable<GetMovieResponse> | GetMovieResponse;
130
+ }
131
+
132
+ export function MovieServiceControllerMethods() {
133
+ return function (constructor: Function) {
134
+ const grpcMethods: string[] = ["listMovies", "getMovie"];
135
+ for (const method of grpcMethods) {
136
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
137
+ GrpcMethod("MovieService", method)(constructor.prototype[method], method, descriptor);
138
+ }
139
+ const grpcStreamMethods: string[] = [];
140
+ for (const method of grpcStreamMethods) {
141
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
142
+ GrpcStreamMethod("MovieService", method)(constructor.prototype[method], method, descriptor);
143
+ }
144
+ };
145
+ }
146
+
147
+ export const MOVIE_SERVICE_NAME = "MovieService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumina-cinema/contracts",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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,31 @@
1
+ syntax = "proto3";
2
+
3
+ package category.v1;
4
+ import "google/protobuf/empty.proto";
5
+
6
+ // CategoryService provides read operations for movie categories used by
7
+ // catalog filtering and navigation in client applications.
8
+ service CategoryService {
9
+ // Returns all categories available in the catalog.
10
+ // The response is expected to be used as reference data and can be cached
11
+ // on the client for a short period if freshness requirements allow.
12
+ rpc GetAllCategories (google.protobuf.Empty) returns (GetAllCategoriesResponse);
13
+ }
14
+
15
+ // Response payload for GetAllCategories.
16
+ message GetAllCategoriesResponse {
17
+ // Full list of categories visible to the caller.
18
+ repeated Category categories = 1;
19
+ }
20
+
21
+ // Category is a lightweight domain object used for grouping movies.
22
+ message Category {
23
+ // Stable category identifier (UUID/string depending on backend storage).
24
+ string id = 1;
25
+
26
+ // Human-readable category title shown in UI.
27
+ string title = 2;
28
+
29
+ // URL-friendly unique key used in routes and query filters.
30
+ string slug = 3;
31
+ }
package/proto/media.proto CHANGED
@@ -5,38 +5,70 @@ package media.v1;
5
5
  option go_package = 'github.com/lumina-cinema/contracts/media;media';
6
6
  option java_multiple_files = true;
7
7
 
8
+ // MediaService provides primitive object-storage style operations for
9
+ // binary assets (images, posters, banners, etc.).
8
10
  service MediaService {
11
+ // Uploads a binary payload and returns a storage key that can be used
12
+ // in subsequent Get/Delete operations.
9
13
  rpc Upload (UploadRequest) returns (UploadResponse);
14
+
15
+ // Retrieves raw file bytes and content type by storage key.
10
16
  rpc Get (GetRequest) returns (GetResponse);
17
+
18
+ // Deletes a file by storage key.
11
19
  rpc Delete (DeleteRequest) returns (DeleteResponse);
12
20
  }
13
21
 
22
+ // Request to upload a media file.
14
23
  message UploadRequest {
24
+ // Original file name (used for metadata/auditing; not required to be unique).
15
25
  string file_name = 1;
26
+
27
+ // Logical folder/prefix in storage bucket (for example "movies/posters").
16
28
  string folder = 2;
29
+
30
+ // MIME type of uploaded payload (for example "image/jpeg").
17
31
  string content_type = 3;
32
+
33
+ // Raw file bytes.
18
34
  bytes data = 4;
35
+
36
+ // Optional target width for server-side resize operations.
19
37
  optional int32 resize_width = 5;
38
+
39
+ // Optional target height for server-side resize operations.
20
40
  optional int32 resize_height = 6;
21
41
  }
22
42
 
43
+ // Result of a successful upload.
23
44
  message UploadResponse {
45
+ // Storage key of uploaded object.
24
46
  string key = 1;
25
47
  }
26
48
 
49
+ // Request to retrieve a stored media object.
27
50
  message GetRequest {
51
+ // Storage key returned by Upload.
28
52
  string key = 1;
29
53
  }
30
54
 
55
+ // Raw media payload returned by Get.
31
56
  message GetResponse {
57
+ // Raw file bytes.
32
58
  bytes data = 1;
59
+
60
+ // MIME type of the returned payload.
33
61
  string content_type = 2;
34
62
  }
35
63
 
64
+ // Request to delete a stored media object.
36
65
  message DeleteRequest {
66
+ // Storage key returned by Upload.
37
67
  string key = 1;
38
68
  }
39
69
 
70
+ // Result of deletion operation.
40
71
  message DeleteResponse {
72
+ // True if object was deleted or delete was treated as successful.
41
73
  bool ok = 1;
42
- }
74
+ }
@@ -0,0 +1,107 @@
1
+ syntax = "proto3";
2
+
3
+ package movie.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+
7
+ // MovieService provides read-only access to movie catalog entities.
8
+ // It exposes listing and detail retrieval endpoints.
9
+ service MovieService {
10
+ // Returns a list of movies with optional category filter, randomization,
11
+ // and a hard limit on item count.
12
+ rpc ListMovies (ListMoviesRequest) returns (ListMoviesResponse);
13
+
14
+ // Returns a single movie by either internal id or public slug.
15
+ rpc GetMovie (GetMovieRequest) returns (GetMovieResponse);
16
+ }
17
+
18
+ // Request parameters for movie listing.
19
+ message ListMoviesRequest {
20
+ // Optional category slug/id depending on backend implementation.
21
+ // Empty value means "all categories".
22
+ string category = 1;
23
+
24
+ // If true, backend may randomize result order (for recommendations/hero blocks).
25
+ bool random = 2;
26
+
27
+ // Maximum number of movies to return. Backend may apply an upper bound.
28
+ int32 limit = 3;
29
+ }
30
+
31
+ // Response containing a list of movie cards.
32
+ message ListMoviesResponse {
33
+ // Movies matching request filters.
34
+ repeated Movie movies = 1;
35
+ }
36
+
37
+ // Request for fetching a single movie.
38
+ // Exactly one field in `key` should be set by the client.
39
+ message GetMovieRequest {
40
+ oneof key {
41
+ // Internal movie identifier.
42
+ string id = 1;
43
+
44
+ // Public URL slug.
45
+ string slug = 2;
46
+ }
47
+ }
48
+
49
+ // Response for GetMovie.
50
+ message GetMovieResponse {
51
+ // Full movie details payload.
52
+ MovieDetails movie = 1;
53
+ }
54
+
55
+ // Compact movie model for listing views.
56
+ message Movie {
57
+ // Internal movie identifier.
58
+ string id = 1;
59
+
60
+ // Display title.
61
+ string title = 2;
62
+
63
+ // URL-friendly unique slug.
64
+ string slug = 3;
65
+
66
+ // Poster image URL/key.
67
+ string poster = 4;
68
+
69
+ // Age rating label (for example "16+", "PG-13").
70
+ string rating_age = 5;
71
+
72
+ // Official release date.
73
+ google.protobuf.Timestamp release_date = 6;
74
+ }
75
+
76
+ // Extended movie model for detail page.
77
+ message MovieDetails {
78
+ // Internal movie identifier.
79
+ string id = 1;
80
+
81
+ // Display title.
82
+ string title = 2;
83
+
84
+ // URL-friendly unique slug.
85
+ string slug = 3;
86
+
87
+ // Full movie description/synopsis.
88
+ string description = 4;
89
+
90
+ // Poster image URL/key.
91
+ string poster = 5;
92
+
93
+ // Banner/backdrop image URL/key.
94
+ string banner = 6;
95
+
96
+ // Duration in minutes.
97
+ int32 duration = 7;
98
+
99
+ // Age rating label.
100
+ string rating_age = 8;
101
+
102
+ // Country of production (display value).
103
+ string country = 9;
104
+
105
+ // Official release date.
106
+ google.protobuf.Timestamp release_date = 10;
107
+ }