@aepstore-dev/contracts 1.42.1 → 1.44.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.
@@ -0,0 +1,579 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v7.35.1
5
+ // source: products.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "products.v1";
12
+
13
+ /**
14
+ * Member names match the DB enum string values exactly (enums: String on the
15
+ * wire) so values pass straight through with no mapping. UNSPECIFIED=0 covers
16
+ * null/optional (e.g. nullable moderation_status, missing list filters).
17
+ */
18
+ export enum ProductStatus {
19
+ PRODUCT_STATUS_UNSPECIFIED = 0,
20
+ ACTIVE = 1,
21
+ DRAFT = 2,
22
+ UNRECOGNIZED = -1,
23
+ }
24
+
25
+ export enum ModerationStatus {
26
+ MODERATION_STATUS_UNSPECIFIED = 0,
27
+ PENDING = 1,
28
+ APPROVED = 2,
29
+ REJECTED = 3,
30
+ UNRECOGNIZED = -1,
31
+ }
32
+
33
+ export enum MediaType {
34
+ MEDIA_TYPE_UNSPECIFIED = 0,
35
+ IMAGE = 1,
36
+ VIDEO = 2,
37
+ UNRECOGNIZED = -1,
38
+ }
39
+
40
+ export interface Category {
41
+ id: string;
42
+ name: string;
43
+ }
44
+
45
+ export interface Application {
46
+ id: string;
47
+ name: string;
48
+ }
49
+
50
+ export interface Tag {
51
+ id: string;
52
+ name: string;
53
+ }
54
+
55
+ export interface ProductMedia {
56
+ id: string;
57
+ url: string;
58
+ type: MediaType;
59
+ }
60
+
61
+ export interface Attachment {
62
+ id: string;
63
+ url: string;
64
+ fileKey: string;
65
+ fileName: string;
66
+ fileSize: number;
67
+ createdAt: string;
68
+ }
69
+
70
+ export interface ProductUser {
71
+ id: string;
72
+ username: string;
73
+ avatarUrl: string;
74
+ }
75
+
76
+ /**
77
+ * Moderation block — null on the product while it's a DRAFT / never submitted.
78
+ * status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
79
+ */
80
+ export interface ProductModeration {
81
+ status: ModerationStatus;
82
+ /** moderator note (mainly on REJECTED) */
83
+ comment: string;
84
+ /** moderator user id */
85
+ moderatedBy: string;
86
+ /** ISO 8601 */
87
+ moderatedAt: string;
88
+ }
89
+
90
+ export interface Product {
91
+ id: string;
92
+ name: string;
93
+ description: string;
94
+ /** Decimal as string (D7) */
95
+ price: string;
96
+ /** Decimal as string */
97
+ discountPercent: string;
98
+ /** Decimal as string */
99
+ finalPrice: string;
100
+ /** double as string for consistency */
101
+ averageRating: string;
102
+ status: ProductStatus;
103
+ /** null while DRAFT / not yet submitted */
104
+ moderation: ProductModeration | undefined;
105
+ createdAt: string;
106
+ updatedAt: string;
107
+ /** ISO 8601 when soft-deleted, empty/null otherwise */
108
+ deletedAt: string;
109
+ preview: string;
110
+ video: string;
111
+ user: ProductUser | undefined;
112
+ media: ProductMedia[];
113
+ categories: Category[];
114
+ applications: Application[];
115
+ tags: Tag[];
116
+ /** Aggregate counts (populated where the query includes _count). */
117
+ favoritesCount: number;
118
+ viewsCount: number;
119
+ reviewsCount: number;
120
+ /** Viewer-contextual flags (populated by FindOne when a viewer is known). */
121
+ owner: boolean;
122
+ isFavorite: boolean;
123
+ isViewed: boolean;
124
+ /** owner-only, current-month revenue (Decimal as string) */
125
+ revenue: string;
126
+ /** viewer has a COMPLETED purchase of this product */
127
+ isBuyed: boolean;
128
+ /** viewer has already left a review on this product */
129
+ isReviewed: boolean;
130
+ /** Popularity (populated by GetTopProduct / GetPopularProducts). */
131
+ popularityScore: string;
132
+ /**
133
+ * OWNER-ONLY: the product's deliverable files. Populated by FindOne only
134
+ * when the viewer is the product owner; empty for everyone else (never
135
+ * exposes private attachment metadata to non-owners).
136
+ */
137
+ attachments: ProductAttachment[];
138
+ }
139
+
140
+ export interface ProductAttachment {
141
+ id: string;
142
+ fileName: string;
143
+ fileSize: number;
144
+ }
145
+
146
+ /** Compact product shape for "related products" — only the fields a card needs. */
147
+ export interface RelatedProduct {
148
+ id: string;
149
+ name: string;
150
+ /** Decimal as string */
151
+ price: string;
152
+ /** Decimal as string */
153
+ discountPercent: string;
154
+ /** Decimal as string */
155
+ finalPrice: string;
156
+ preview: string;
157
+ user: ProductUser | undefined;
158
+ categories: Category[];
159
+ }
160
+
161
+ export interface ProductResponse {
162
+ product:
163
+ | Product
164
+ | undefined;
165
+ /** Populated only by FindOne: up to 2 other approved products by the same author. */
166
+ relatedProducts: RelatedProduct[];
167
+ }
168
+
169
+ export interface TopProductRequest {
170
+ /** Optional. If set, the top product is searched only among this seller's products. */
171
+ userId: string;
172
+ }
173
+
174
+ export interface ProductsListResponse {
175
+ items: Product[];
176
+ total: number;
177
+ page: number;
178
+ limit: number;
179
+ }
180
+
181
+ export interface Ok {
182
+ ok: boolean;
183
+ }
184
+
185
+ export interface Empty {
186
+ }
187
+
188
+ export interface CreateProductRequest {
189
+ userId: string;
190
+ name: string;
191
+ /** Decimal as string */
192
+ price: string;
193
+ categoryIds: string[];
194
+ applicationIds: string[];
195
+ tags: string[];
196
+ /** optional */
197
+ discountPercent: string;
198
+ /** optional */
199
+ finalPrice: string;
200
+ video: string;
201
+ description: string;
202
+ status: ProductStatus;
203
+ }
204
+
205
+ export interface UpdateProductRequest {
206
+ userId: string;
207
+ id: string;
208
+ name: string;
209
+ description: string;
210
+ price: string;
211
+ discountPercent: string;
212
+ finalPrice: string;
213
+ tags: string[];
214
+ categoryIds: string[];
215
+ applicationIds: string[];
216
+ }
217
+
218
+ export interface QueryProductsRequest {
219
+ search: string;
220
+ categoryIds: string[];
221
+ applicationIds: string[];
222
+ tags: string[];
223
+ minPrice: string;
224
+ maxPrice: string;
225
+ page: number;
226
+ limit: number;
227
+ /** createdAt | price | name | updatedAt | finalPrice */
228
+ sortBy: string;
229
+ /** asc | desc */
230
+ sortOrder: string;
231
+ status: ProductStatus;
232
+ moderationStatus: ModerationStatus;
233
+ /** owner-only list filter; used by /products/my?status=deleted */
234
+ deletedOnly: boolean;
235
+ }
236
+
237
+ export interface FindMyRequest {
238
+ userId: string;
239
+ query: QueryProductsRequest | undefined;
240
+ }
241
+
242
+ export interface FindOneRequest {
243
+ id: string;
244
+ /** optional — to compute is_favorited etc. */
245
+ viewerUserId: string;
246
+ /** dedup key for view counting (userId or hashed ip+ua) */
247
+ viewerKey: string;
248
+ }
249
+
250
+ export interface RemoveProductRequest {
251
+ id: string;
252
+ userId: string;
253
+ }
254
+
255
+ export interface RestoreProductRequest {
256
+ id: string;
257
+ userId: string;
258
+ }
259
+
260
+ export interface SubmitForModerationRequest {
261
+ id: string;
262
+ userId: string;
263
+ }
264
+
265
+ export interface PriceRangeResponse {
266
+ /** Decimal as string */
267
+ min: string;
268
+ max: string;
269
+ }
270
+
271
+ export interface FavoriteRequest {
272
+ userId: string;
273
+ productId: string;
274
+ }
275
+
276
+ export interface MediaFile {
277
+ url: string;
278
+ type: MediaType;
279
+ }
280
+
281
+ export interface SaveMediaMetadataRequest {
282
+ id: string;
283
+ userId: string;
284
+ files: MediaFile[];
285
+ uploadId: string;
286
+ }
287
+
288
+ export interface AttachmentMeta {
289
+ url: string;
290
+ fileKey: string;
291
+ fileName: string;
292
+ fileSize: number;
293
+ }
294
+
295
+ export interface SaveAttachmentMetadataRequest {
296
+ id: string;
297
+ userId: string;
298
+ attachment: AttachmentMeta | undefined;
299
+ uploadId: string;
300
+ }
301
+
302
+ export interface RemoveMediaRequest {
303
+ /** product id */
304
+ id: string;
305
+ userId: string;
306
+ mediaId: string;
307
+ }
308
+
309
+ export interface RemoveAttachmentRequest {
310
+ /** product id */
311
+ id: string;
312
+ userId: string;
313
+ attachmentId: string;
314
+ }
315
+
316
+ export interface ProductModerationQueryRequest {
317
+ status: ModerationStatus;
318
+ page: number;
319
+ limit: number;
320
+ sortBy: string;
321
+ sortOrder: string;
322
+ }
323
+
324
+ export interface ModerateProductRequest {
325
+ productId: string;
326
+ moderatorId: string;
327
+ /** 'approve' | 'reject' */
328
+ action: string;
329
+ comment: string;
330
+ }
331
+
332
+ export interface ModerationResponse {
333
+ success: boolean;
334
+ message: string;
335
+ product: Product | undefined;
336
+ moderationStatus: ModerationStatus;
337
+ moderationComment: string;
338
+ moderatedBy: string;
339
+ moderatedAt: string;
340
+ }
341
+
342
+ export interface ResubmitProductRequest {
343
+ productId: string;
344
+ userId: string;
345
+ comment: string;
346
+ /**
347
+ * Free-form payload of changes — serialized as JSON string to keep the
348
+ * legacy `any` shape without forcing a strict schema on a free-form patch.
349
+ */
350
+ changesJson: string;
351
+ }
352
+
353
+ export interface GetSecureDownloadLinksRequest {
354
+ productId: string;
355
+ userId: string;
356
+ expiresIn: number;
357
+ }
358
+
359
+ export interface SecureDownloadLink {
360
+ downloadUrl: string;
361
+ expiresIn: number;
362
+ fileName: string;
363
+ fileSize: number;
364
+ attachmentId: string;
365
+ }
366
+
367
+ export interface SecureDownloadLinksResponse {
368
+ links: SecureDownloadLink[];
369
+ }
370
+
371
+ export interface GetAttachmentDownloadInfoRequest {
372
+ productId: string;
373
+ attachmentId: string;
374
+ userId: string;
375
+ }
376
+
377
+ export interface AttachmentDownloadInfoResponse {
378
+ fileName: string;
379
+ fileSize: number;
380
+ contentType: string;
381
+ }
382
+
383
+ export interface GetAttachmentDownloadUrlRequest {
384
+ productId: string;
385
+ attachmentId: string;
386
+ userId: string;
387
+ }
388
+
389
+ export interface AttachmentDownloadUrlResponse {
390
+ downloadUrl: string;
391
+ expiresIn: number;
392
+ fileName: string;
393
+ fileSize: number;
394
+ }
395
+
396
+ export const PRODUCTS_V1_PACKAGE_NAME = "products.v1";
397
+
398
+ export interface ProductsServiceClient {
399
+ create(request: CreateProductRequest): Observable<ProductResponse>;
400
+
401
+ findAll(request: QueryProductsRequest): Observable<ProductsListResponse>;
402
+
403
+ findAllApproved(request: QueryProductsRequest): Observable<ProductsListResponse>;
404
+
405
+ findMy(request: FindMyRequest): Observable<ProductsListResponse>;
406
+
407
+ findOne(request: FindOneRequest): Observable<ProductResponse>;
408
+
409
+ update(request: UpdateProductRequest): Observable<ProductResponse>;
410
+
411
+ remove(request: RemoveProductRequest): Observable<Ok>;
412
+
413
+ restore(request: RestoreProductRequest): Observable<ProductResponse>;
414
+
415
+ submitForModeration(request: SubmitForModerationRequest): Observable<ProductResponse>;
416
+
417
+ getPriceRange(request: Empty): Observable<PriceRangeResponse>;
418
+
419
+ addToFavorites(request: FavoriteRequest): Observable<Ok>;
420
+
421
+ removeFromFavorites(request: FavoriteRequest): Observable<Ok>;
422
+
423
+ saveMediaMetadata(request: SaveMediaMetadataRequest): Observable<ProductResponse>;
424
+
425
+ saveAttachmentMetadata(request: SaveAttachmentMetadataRequest): Observable<ProductResponse>;
426
+
427
+ removeMedia(request: RemoveMediaRequest): Observable<ProductResponse>;
428
+
429
+ removeAttachment(request: RemoveAttachmentRequest): Observable<ProductResponse>;
430
+
431
+ getProductsForModeration(request: ProductModerationQueryRequest): Observable<ProductsListResponse>;
432
+
433
+ moderateProduct(request: ModerateProductRequest): Observable<ModerationResponse>;
434
+
435
+ resubmitProduct(request: ResubmitProductRequest): Observable<ProductResponse>;
436
+
437
+ getSecureDownloadLinks(request: GetSecureDownloadLinksRequest): Observable<SecureDownloadLinksResponse>;
438
+
439
+ getAttachmentDownloadInfo(request: GetAttachmentDownloadInfoRequest): Observable<AttachmentDownloadInfoResponse>;
440
+
441
+ /**
442
+ * Single presigned GET URL for one attachment (after purchase/access check).
443
+ * Bytes never traverse the backend — see upload-service.
444
+ */
445
+
446
+ getAttachmentDownloadUrl(request: GetAttachmentDownloadUrlRequest): Observable<AttachmentDownloadUrlResponse>;
447
+
448
+ getTopProduct(request: TopProductRequest): Observable<ProductResponse>;
449
+
450
+ getPopularProducts(request: QueryProductsRequest): Observable<ProductsListResponse>;
451
+ }
452
+
453
+ export interface ProductsServiceController {
454
+ create(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
455
+
456
+ findAll(
457
+ request: QueryProductsRequest,
458
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
459
+
460
+ findAllApproved(
461
+ request: QueryProductsRequest,
462
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
463
+
464
+ findMy(
465
+ request: FindMyRequest,
466
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
467
+
468
+ findOne(request: FindOneRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
469
+
470
+ update(request: UpdateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
471
+
472
+ remove(request: RemoveProductRequest): Promise<Ok> | Observable<Ok> | Ok;
473
+
474
+ restore(request: RestoreProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
475
+
476
+ submitForModeration(
477
+ request: SubmitForModerationRequest,
478
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
479
+
480
+ getPriceRange(request: Empty): Promise<PriceRangeResponse> | Observable<PriceRangeResponse> | PriceRangeResponse;
481
+
482
+ addToFavorites(request: FavoriteRequest): Promise<Ok> | Observable<Ok> | Ok;
483
+
484
+ removeFromFavorites(request: FavoriteRequest): Promise<Ok> | Observable<Ok> | Ok;
485
+
486
+ saveMediaMetadata(
487
+ request: SaveMediaMetadataRequest,
488
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
489
+
490
+ saveAttachmentMetadata(
491
+ request: SaveAttachmentMetadataRequest,
492
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
493
+
494
+ removeMedia(request: RemoveMediaRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
495
+
496
+ removeAttachment(
497
+ request: RemoveAttachmentRequest,
498
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
499
+
500
+ getProductsForModeration(
501
+ request: ProductModerationQueryRequest,
502
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
503
+
504
+ moderateProduct(
505
+ request: ModerateProductRequest,
506
+ ): Promise<ModerationResponse> | Observable<ModerationResponse> | ModerationResponse;
507
+
508
+ resubmitProduct(
509
+ request: ResubmitProductRequest,
510
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
511
+
512
+ getSecureDownloadLinks(
513
+ request: GetSecureDownloadLinksRequest,
514
+ ): Promise<SecureDownloadLinksResponse> | Observable<SecureDownloadLinksResponse> | SecureDownloadLinksResponse;
515
+
516
+ getAttachmentDownloadInfo(
517
+ request: GetAttachmentDownloadInfoRequest,
518
+ ):
519
+ | Promise<AttachmentDownloadInfoResponse>
520
+ | Observable<AttachmentDownloadInfoResponse>
521
+ | AttachmentDownloadInfoResponse;
522
+
523
+ /**
524
+ * Single presigned GET URL for one attachment (after purchase/access check).
525
+ * Bytes never traverse the backend — see upload-service.
526
+ */
527
+
528
+ getAttachmentDownloadUrl(
529
+ request: GetAttachmentDownloadUrlRequest,
530
+ ): Promise<AttachmentDownloadUrlResponse> | Observable<AttachmentDownloadUrlResponse> | AttachmentDownloadUrlResponse;
531
+
532
+ getTopProduct(request: TopProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
533
+
534
+ getPopularProducts(
535
+ request: QueryProductsRequest,
536
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
537
+ }
538
+
539
+ export function ProductsServiceControllerMethods() {
540
+ return function (constructor: Function) {
541
+ const grpcMethods: string[] = [
542
+ "create",
543
+ "findAll",
544
+ "findAllApproved",
545
+ "findMy",
546
+ "findOne",
547
+ "update",
548
+ "remove",
549
+ "restore",
550
+ "submitForModeration",
551
+ "getPriceRange",
552
+ "addToFavorites",
553
+ "removeFromFavorites",
554
+ "saveMediaMetadata",
555
+ "saveAttachmentMetadata",
556
+ "removeMedia",
557
+ "removeAttachment",
558
+ "getProductsForModeration",
559
+ "moderateProduct",
560
+ "resubmitProduct",
561
+ "getSecureDownloadLinks",
562
+ "getAttachmentDownloadInfo",
563
+ "getAttachmentDownloadUrl",
564
+ "getTopProduct",
565
+ "getPopularProducts",
566
+ ];
567
+ for (const method of grpcMethods) {
568
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
569
+ GrpcMethod("ProductsService", method)(constructor.prototype[method], method, descriptor);
570
+ }
571
+ const grpcStreamMethods: string[] = [];
572
+ for (const method of grpcStreamMethods) {
573
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
574
+ GrpcStreamMethod("ProductsService", method)(constructor.prototype[method], method, descriptor);
575
+ }
576
+ };
577
+ }
578
+
579
+ export const PRODUCTS_SERVICE_NAME = "ProductsService";
@@ -24,6 +24,17 @@ export interface Ticket {
24
24
  createdAt: string;
25
25
  updatedAt: string;
26
26
  messagesCount: number;
27
+ /** GENERAL|TECHNICAL|SALES */
28
+ department: string;
29
+ /** optional */
30
+ productCategoryId: string;
31
+ /** optional */
32
+ relatedProductId: string;
33
+ /** PURCHASED|SELLING */
34
+ relatedProductType: string;
35
+ rulesAccepted: boolean;
36
+ rulesAcceptedAt: string;
37
+ deletedAt: string;
27
38
  }
28
39
  export interface TicketMessage {
29
40
  id: string;
@@ -48,6 +59,17 @@ export interface CreateTicketRequest {
48
59
  purchaseId: string;
49
60
  /** optional */
50
61
  withdrawalId: string;
62
+ /** LOW|NORMAL|HIGH|URGENT */
63
+ priority: string;
64
+ /** GENERAL|TECHNICAL|SALES */
65
+ department: string;
66
+ /** optional */
67
+ productCategoryId: string;
68
+ /** optional */
69
+ relatedProductId: string;
70
+ /** PURCHASED|SELLING */
71
+ relatedProductType: string;
72
+ rulesAccepted: boolean;
51
73
  }
52
74
  export interface GetTicketRequest {
53
75
  id: string;
@@ -92,6 +114,10 @@ export interface SetTicketStatusRequest {
92
114
  status: string;
93
115
  adminId: string;
94
116
  }
117
+ export interface DeleteTicketRequest {
118
+ ticketId: string;
119
+ adminId: string;
120
+ }
95
121
  export interface TicketsListResponse {
96
122
  items: Ticket[];
97
123
  total: number;
@@ -116,6 +142,7 @@ export interface SupportServiceClient {
116
142
  listTickets(request: ListTicketsRequest): Observable<TicketsListResponse>;
117
143
  assignTicket(request: AssignTicketRequest): Observable<Ticket>;
118
144
  setTicketStatus(request: SetTicketStatusRequest): Observable<Ticket>;
145
+ deleteTicket(request: DeleteTicketRequest): Observable<Ticket>;
119
146
  }
120
147
  /**
121
148
  * Support ticket system (G1). Enums as strings matching the DB
@@ -134,6 +161,7 @@ export interface SupportServiceController {
134
161
  listTickets(request: ListTicketsRequest): Promise<TicketsListResponse> | Observable<TicketsListResponse> | TicketsListResponse;
135
162
  assignTicket(request: AssignTicketRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
136
163
  setTicketStatus(request: SetTicketStatusRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
164
+ deleteTicket(request: DeleteTicketRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
137
165
  }
138
166
  export declare function SupportServiceControllerMethods(): (constructor: Function) => void;
139
167
  export declare const SUPPORT_SERVICE_NAME = "SupportService";
@@ -23,6 +23,7 @@ function SupportServiceControllerMethods() {
23
23
  "listTickets",
24
24
  "assignTicket",
25
25
  "setTicketStatus",
26
+ "deleteTicket",
26
27
  ];
27
28
  for (const method of grpcMethods) {
28
29
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);