@aepstore-dev/contracts 1.0.5 → 1.1.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,452 @@
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.0
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
+ export enum ProductStatus {
14
+ PRODUCT_STATUS_UNSPECIFIED = 0,
15
+ PRODUCT_STATUS_ACTIVE = 1,
16
+ PRODUCT_STATUS_DRAFT = 2,
17
+ UNRECOGNIZED = -1,
18
+ }
19
+
20
+ export enum ModerationStatus {
21
+ MODERATION_STATUS_UNSPECIFIED = 0,
22
+ MODERATION_STATUS_PENDING = 1,
23
+ MODERATION_STATUS_APPROVED = 2,
24
+ MODERATION_STATUS_REJECTED = 3,
25
+ UNRECOGNIZED = -1,
26
+ }
27
+
28
+ export enum MediaType {
29
+ MEDIA_TYPE_UNSPECIFIED = 0,
30
+ MEDIA_TYPE_IMAGE = 1,
31
+ MEDIA_TYPE_VIDEO = 2,
32
+ UNRECOGNIZED = -1,
33
+ }
34
+
35
+ export interface Category {
36
+ id: string;
37
+ name: string;
38
+ }
39
+
40
+ export interface Application {
41
+ id: string;
42
+ name: string;
43
+ }
44
+
45
+ export interface Tag {
46
+ id: string;
47
+ name: string;
48
+ }
49
+
50
+ export interface ProductMedia {
51
+ id: string;
52
+ url: string;
53
+ type: MediaType;
54
+ }
55
+
56
+ export interface Attachment {
57
+ id: string;
58
+ url: string;
59
+ fileKey: string;
60
+ fileName: string;
61
+ fileSize: number;
62
+ createdAt: string;
63
+ }
64
+
65
+ export interface ProductUser {
66
+ id: string;
67
+ username: string;
68
+ avatarUrl: string;
69
+ }
70
+
71
+ export interface Product {
72
+ id: string;
73
+ name: string;
74
+ description: string;
75
+ /** Decimal as string (D7) */
76
+ price: string;
77
+ /** Decimal as string */
78
+ discountPercent: string;
79
+ /** Decimal as string */
80
+ finalPrice: string;
81
+ /** double as string for consistency */
82
+ averageRating: string;
83
+ status: ProductStatus;
84
+ moderationStatus: ModerationStatus;
85
+ moderationComment: string;
86
+ moderatedBy: string;
87
+ moderatedAt: string;
88
+ createdAt: string;
89
+ updatedAt: string;
90
+ preview: string;
91
+ video: string;
92
+ user: ProductUser | undefined;
93
+ media: ProductMedia[];
94
+ categories: Category[];
95
+ applications: Application[];
96
+ tags: Tag[];
97
+ }
98
+
99
+ export interface ProductResponse {
100
+ product: Product | undefined;
101
+ }
102
+
103
+ export interface ProductsListResponse {
104
+ items: Product[];
105
+ total: number;
106
+ page: number;
107
+ limit: number;
108
+ }
109
+
110
+ export interface Ok {
111
+ ok: boolean;
112
+ }
113
+
114
+ export interface Empty {
115
+ }
116
+
117
+ export interface CreateProductRequest {
118
+ userId: string;
119
+ name: string;
120
+ /** Decimal as string */
121
+ price: string;
122
+ categoryIds: string[];
123
+ applicationIds: string[];
124
+ tags: string[];
125
+ /** optional */
126
+ discountPercent: string;
127
+ /** optional */
128
+ finalPrice: string;
129
+ video: string;
130
+ description: string;
131
+ status: ProductStatus;
132
+ }
133
+
134
+ export interface UpdateProductRequest {
135
+ userId: string;
136
+ id: string;
137
+ name: string;
138
+ description: string;
139
+ price: string;
140
+ discountPercent: string;
141
+ finalPrice: string;
142
+ tags: string[];
143
+ }
144
+
145
+ export interface QueryProductsRequest {
146
+ search: string;
147
+ categoryIds: string[];
148
+ applicationIds: string[];
149
+ tags: string[];
150
+ minPrice: string;
151
+ maxPrice: string;
152
+ page: number;
153
+ limit: number;
154
+ /** createdAt | price | name | updatedAt | finalPrice */
155
+ sortBy: string;
156
+ /** asc | desc */
157
+ sortOrder: string;
158
+ status: ProductStatus;
159
+ moderationStatus: ModerationStatus;
160
+ }
161
+
162
+ export interface FindMyRequest {
163
+ userId: string;
164
+ query: QueryProductsRequest | undefined;
165
+ }
166
+
167
+ export interface FindOneRequest {
168
+ id: string;
169
+ /** optional — to compute is_favorited etc. */
170
+ viewerUserId: string;
171
+ }
172
+
173
+ export interface RemoveProductRequest {
174
+ id: string;
175
+ userId: string;
176
+ }
177
+
178
+ export interface SubmitForModerationRequest {
179
+ id: string;
180
+ userId: string;
181
+ }
182
+
183
+ export interface PriceRangeResponse {
184
+ /** Decimal as string */
185
+ min: string;
186
+ max: string;
187
+ }
188
+
189
+ export interface FavoriteRequest {
190
+ userId: string;
191
+ productId: string;
192
+ }
193
+
194
+ export interface MediaFile {
195
+ url: string;
196
+ type: MediaType;
197
+ }
198
+
199
+ export interface SaveMediaMetadataRequest {
200
+ id: string;
201
+ userId: string;
202
+ files: MediaFile[];
203
+ uploadId: string;
204
+ }
205
+
206
+ export interface AttachmentMeta {
207
+ url: string;
208
+ fileKey: string;
209
+ fileName: string;
210
+ fileSize: number;
211
+ }
212
+
213
+ export interface SaveAttachmentMetadataRequest {
214
+ id: string;
215
+ userId: string;
216
+ attachment: AttachmentMeta | undefined;
217
+ uploadId: string;
218
+ }
219
+
220
+ export interface ProductModerationQueryRequest {
221
+ status: ModerationStatus;
222
+ page: number;
223
+ limit: number;
224
+ sortBy: string;
225
+ sortOrder: string;
226
+ }
227
+
228
+ export interface ModerateProductRequest {
229
+ productId: string;
230
+ moderatorId: string;
231
+ /** 'approve' | 'reject' */
232
+ action: string;
233
+ comment: string;
234
+ }
235
+
236
+ export interface ModerationResponse {
237
+ success: boolean;
238
+ message: string;
239
+ product: Product | undefined;
240
+ moderationStatus: ModerationStatus;
241
+ moderationComment: string;
242
+ moderatedBy: string;
243
+ moderatedAt: string;
244
+ }
245
+
246
+ export interface ResubmitProductRequest {
247
+ productId: string;
248
+ userId: string;
249
+ comment: string;
250
+ /**
251
+ * Free-form payload of changes — serialized as JSON string to keep the
252
+ * legacy `any` shape without forcing a strict schema on a free-form patch.
253
+ */
254
+ changesJson: string;
255
+ }
256
+
257
+ export interface GetSecureDownloadLinksRequest {
258
+ productId: string;
259
+ userId: string;
260
+ expiresIn: number;
261
+ }
262
+
263
+ export interface SecureDownloadLink {
264
+ downloadUrl: string;
265
+ expiresIn: number;
266
+ fileName: string;
267
+ fileSize: number;
268
+ attachmentId: string;
269
+ }
270
+
271
+ export interface SecureDownloadLinksResponse {
272
+ links: SecureDownloadLink[];
273
+ }
274
+
275
+ export interface GetAttachmentDownloadInfoRequest {
276
+ productId: string;
277
+ attachmentId: string;
278
+ userId: string;
279
+ }
280
+
281
+ export interface AttachmentDownloadInfoResponse {
282
+ fileName: string;
283
+ fileSize: number;
284
+ contentType: string;
285
+ }
286
+
287
+ export interface GetAttachmentStreamRequest {
288
+ productId: string;
289
+ attachmentId: string;
290
+ userId: string;
291
+ }
292
+
293
+ export interface AttachmentChunk {
294
+ data: Uint8Array;
295
+ last: boolean;
296
+ }
297
+
298
+ export const PRODUCTS_V1_PACKAGE_NAME = "products.v1";
299
+
300
+ export interface ProductsServiceClient {
301
+ create(request: CreateProductRequest): Observable<ProductResponse>;
302
+
303
+ findAll(request: QueryProductsRequest): Observable<ProductsListResponse>;
304
+
305
+ findAllApproved(request: QueryProductsRequest): Observable<ProductsListResponse>;
306
+
307
+ findMy(request: FindMyRequest): Observable<ProductsListResponse>;
308
+
309
+ findOne(request: FindOneRequest): Observable<ProductResponse>;
310
+
311
+ update(request: UpdateProductRequest): Observable<ProductResponse>;
312
+
313
+ remove(request: RemoveProductRequest): Observable<Ok>;
314
+
315
+ submitForModeration(request: SubmitForModerationRequest): Observable<ProductResponse>;
316
+
317
+ getPriceRange(request: Empty): Observable<PriceRangeResponse>;
318
+
319
+ addToFavorites(request: FavoriteRequest): Observable<Ok>;
320
+
321
+ removeFromFavorites(request: FavoriteRequest): Observable<Ok>;
322
+
323
+ saveMediaMetadata(request: SaveMediaMetadataRequest): Observable<ProductResponse>;
324
+
325
+ saveAttachmentMetadata(request: SaveAttachmentMetadataRequest): Observable<ProductResponse>;
326
+
327
+ getProductsForModeration(request: ProductModerationQueryRequest): Observable<ProductsListResponse>;
328
+
329
+ moderateProduct(request: ModerateProductRequest): Observable<ModerationResponse>;
330
+
331
+ resubmitProduct(request: ResubmitProductRequest): Observable<ProductResponse>;
332
+
333
+ getSecureDownloadLinks(request: GetSecureDownloadLinksRequest): Observable<SecureDownloadLinksResponse>;
334
+
335
+ getAttachmentDownloadInfo(request: GetAttachmentDownloadInfoRequest): Observable<AttachmentDownloadInfoResponse>;
336
+
337
+ getAttachmentStream(request: GetAttachmentStreamRequest): Observable<AttachmentChunk>;
338
+
339
+ getTopProduct(request: Empty): Observable<ProductResponse>;
340
+
341
+ getPopularProducts(request: QueryProductsRequest): Observable<ProductsListResponse>;
342
+ }
343
+
344
+ export interface ProductsServiceController {
345
+ create(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
346
+
347
+ findAll(
348
+ request: QueryProductsRequest,
349
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
350
+
351
+ findAllApproved(
352
+ request: QueryProductsRequest,
353
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
354
+
355
+ findMy(
356
+ request: FindMyRequest,
357
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
358
+
359
+ findOne(request: FindOneRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
360
+
361
+ update(request: UpdateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
362
+
363
+ remove(request: RemoveProductRequest): Promise<Ok> | Observable<Ok> | Ok;
364
+
365
+ submitForModeration(
366
+ request: SubmitForModerationRequest,
367
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
368
+
369
+ getPriceRange(request: Empty): Promise<PriceRangeResponse> | Observable<PriceRangeResponse> | PriceRangeResponse;
370
+
371
+ addToFavorites(request: FavoriteRequest): Promise<Ok> | Observable<Ok> | Ok;
372
+
373
+ removeFromFavorites(request: FavoriteRequest): Promise<Ok> | Observable<Ok> | Ok;
374
+
375
+ saveMediaMetadata(
376
+ request: SaveMediaMetadataRequest,
377
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
378
+
379
+ saveAttachmentMetadata(
380
+ request: SaveAttachmentMetadataRequest,
381
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
382
+
383
+ getProductsForModeration(
384
+ request: ProductModerationQueryRequest,
385
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
386
+
387
+ moderateProduct(
388
+ request: ModerateProductRequest,
389
+ ): Promise<ModerationResponse> | Observable<ModerationResponse> | ModerationResponse;
390
+
391
+ resubmitProduct(
392
+ request: ResubmitProductRequest,
393
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
394
+
395
+ getSecureDownloadLinks(
396
+ request: GetSecureDownloadLinksRequest,
397
+ ): Promise<SecureDownloadLinksResponse> | Observable<SecureDownloadLinksResponse> | SecureDownloadLinksResponse;
398
+
399
+ getAttachmentDownloadInfo(
400
+ request: GetAttachmentDownloadInfoRequest,
401
+ ):
402
+ | Promise<AttachmentDownloadInfoResponse>
403
+ | Observable<AttachmentDownloadInfoResponse>
404
+ | AttachmentDownloadInfoResponse;
405
+
406
+ getAttachmentStream(request: GetAttachmentStreamRequest): Observable<AttachmentChunk>;
407
+
408
+ getTopProduct(request: Empty): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
409
+
410
+ getPopularProducts(
411
+ request: QueryProductsRequest,
412
+ ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
413
+ }
414
+
415
+ export function ProductsServiceControllerMethods() {
416
+ return function (constructor: Function) {
417
+ const grpcMethods: string[] = [
418
+ "create",
419
+ "findAll",
420
+ "findAllApproved",
421
+ "findMy",
422
+ "findOne",
423
+ "update",
424
+ "remove",
425
+ "submitForModeration",
426
+ "getPriceRange",
427
+ "addToFavorites",
428
+ "removeFromFavorites",
429
+ "saveMediaMetadata",
430
+ "saveAttachmentMetadata",
431
+ "getProductsForModeration",
432
+ "moderateProduct",
433
+ "resubmitProduct",
434
+ "getSecureDownloadLinks",
435
+ "getAttachmentDownloadInfo",
436
+ "getAttachmentStream",
437
+ "getTopProduct",
438
+ "getPopularProducts",
439
+ ];
440
+ for (const method of grpcMethods) {
441
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
442
+ GrpcMethod("ProductsService", method)(constructor.prototype[method], method, descriptor);
443
+ }
444
+ const grpcStreamMethods: string[] = [];
445
+ for (const method of grpcStreamMethods) {
446
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
447
+ GrpcStreamMethod("ProductsService", method)(constructor.prototype[method], method, descriptor);
448
+ }
449
+ };
450
+ }
451
+
452
+ export const PRODUCTS_SERVICE_NAME = "ProductsService";
@@ -0,0 +1,131 @@
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.0
5
+ // source: taxonomy.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "taxonomy.v1";
12
+
13
+ export interface Category {
14
+ id: string;
15
+ name: string;
16
+ description: string;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ }
20
+
21
+ export interface Application {
22
+ id: string;
23
+ name: string;
24
+ description: string;
25
+ createdAt: string;
26
+ updatedAt: string;
27
+ }
28
+
29
+ export interface Tag {
30
+ id: string;
31
+ name: string;
32
+ }
33
+
34
+ export interface Empty {
35
+ }
36
+
37
+ export interface CategoriesListResponse {
38
+ items: Category[];
39
+ }
40
+
41
+ export interface ApplicationsListResponse {
42
+ items: Application[];
43
+ }
44
+
45
+ export interface QueryTagsRequest {
46
+ search: string;
47
+ page: number;
48
+ limit: number;
49
+ }
50
+
51
+ export interface TagsListResponse {
52
+ items: Tag[];
53
+ total: number;
54
+ page: number;
55
+ limit: number;
56
+ }
57
+
58
+ export interface CreateCategoryRequest {
59
+ name: string;
60
+ description: string;
61
+ }
62
+
63
+ export interface CategoryResponse {
64
+ category: Category | undefined;
65
+ }
66
+
67
+ export interface CreateApplicationRequest {
68
+ name: string;
69
+ description: string;
70
+ }
71
+
72
+ export interface ApplicationResponse {
73
+ application: Application | undefined;
74
+ }
75
+
76
+ export const TAXONOMY_V1_PACKAGE_NAME = "taxonomy.v1";
77
+
78
+ export interface TaxonomyServiceClient {
79
+ findAllCategories(request: Empty): Observable<CategoriesListResponse>;
80
+
81
+ findAllApplications(request: Empty): Observable<ApplicationsListResponse>;
82
+
83
+ findAllTags(request: QueryTagsRequest): Observable<TagsListResponse>;
84
+
85
+ createCategory(request: CreateCategoryRequest): Observable<CategoryResponse>;
86
+
87
+ createApplication(request: CreateApplicationRequest): Observable<ApplicationResponse>;
88
+ }
89
+
90
+ export interface TaxonomyServiceController {
91
+ findAllCategories(
92
+ request: Empty,
93
+ ): Promise<CategoriesListResponse> | Observable<CategoriesListResponse> | CategoriesListResponse;
94
+
95
+ findAllApplications(
96
+ request: Empty,
97
+ ): Promise<ApplicationsListResponse> | Observable<ApplicationsListResponse> | ApplicationsListResponse;
98
+
99
+ findAllTags(request: QueryTagsRequest): Promise<TagsListResponse> | Observable<TagsListResponse> | TagsListResponse;
100
+
101
+ createCategory(
102
+ request: CreateCategoryRequest,
103
+ ): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
104
+
105
+ createApplication(
106
+ request: CreateApplicationRequest,
107
+ ): Promise<ApplicationResponse> | Observable<ApplicationResponse> | ApplicationResponse;
108
+ }
109
+
110
+ export function TaxonomyServiceControllerMethods() {
111
+ return function (constructor: Function) {
112
+ const grpcMethods: string[] = [
113
+ "findAllCategories",
114
+ "findAllApplications",
115
+ "findAllTags",
116
+ "createCategory",
117
+ "createApplication",
118
+ ];
119
+ for (const method of grpcMethods) {
120
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
121
+ GrpcMethod("TaxonomyService", method)(constructor.prototype[method], method, descriptor);
122
+ }
123
+ const grpcStreamMethods: string[] = [];
124
+ for (const method of grpcStreamMethods) {
125
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
126
+ GrpcStreamMethod("TaxonomyService", method)(constructor.prototype[method], method, descriptor);
127
+ }
128
+ };
129
+ }
130
+
131
+ export const TAXONOMY_SERVICE_NAME = "TaxonomyService";
package/gen/upload.ts ADDED
@@ -0,0 +1,98 @@
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.0
5
+ // source: upload.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "upload.v1";
12
+
13
+ export interface FileChunk {
14
+ filename: string;
15
+ data: Uint8Array;
16
+ mimeType: string;
17
+ isLast: boolean;
18
+ chunkIndex: number;
19
+ uploadId: string;
20
+ }
21
+
22
+ export interface UploadResponse {
23
+ fileUrl: string;
24
+ success: boolean;
25
+ message: string;
26
+ uploadId: string;
27
+ fileSize: number;
28
+ }
29
+
30
+ export interface UploadStatusRequest {
31
+ uploadId: string;
32
+ }
33
+
34
+ export interface UploadStatusResponse {
35
+ status: string;
36
+ progressPercent: number;
37
+ message: string;
38
+ }
39
+
40
+ export interface SignedUrlRequest {
41
+ fileKey: string;
42
+ expiresIn: number;
43
+ }
44
+
45
+ export interface SignedUrlResponse {
46
+ signedUrl: string;
47
+ success: boolean;
48
+ message: string;
49
+ }
50
+
51
+ export const UPLOAD_V1_PACKAGE_NAME = "upload.v1";
52
+
53
+ /**
54
+ * Ported from legacy libs/shared/src/proto/upload.proto.
55
+ * Bumped package to upload.v1 for consistency with the rest of the new stack.
56
+ */
57
+
58
+ export interface UploadServiceClient {
59
+ uploadFile(request: Observable<FileChunk>): Observable<UploadResponse>;
60
+
61
+ getUploadStatus(request: UploadStatusRequest): Observable<UploadStatusResponse>;
62
+
63
+ generateSignedUrl(request: SignedUrlRequest): Observable<SignedUrlResponse>;
64
+ }
65
+
66
+ /**
67
+ * Ported from legacy libs/shared/src/proto/upload.proto.
68
+ * Bumped package to upload.v1 for consistency with the rest of the new stack.
69
+ */
70
+
71
+ export interface UploadServiceController {
72
+ uploadFile(request: Observable<FileChunk>): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
73
+
74
+ getUploadStatus(
75
+ request: UploadStatusRequest,
76
+ ): Promise<UploadStatusResponse> | Observable<UploadStatusResponse> | UploadStatusResponse;
77
+
78
+ generateSignedUrl(
79
+ request: SignedUrlRequest,
80
+ ): Promise<SignedUrlResponse> | Observable<SignedUrlResponse> | SignedUrlResponse;
81
+ }
82
+
83
+ export function UploadServiceControllerMethods() {
84
+ return function (constructor: Function) {
85
+ const grpcMethods: string[] = ["getUploadStatus", "generateSignedUrl"];
86
+ for (const method of grpcMethods) {
87
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
88
+ GrpcMethod("UploadService", method)(constructor.prototype[method], method, descriptor);
89
+ }
90
+ const grpcStreamMethods: string[] = ["uploadFile"];
91
+ for (const method of grpcStreamMethods) {
92
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
93
+ GrpcStreamMethod("UploadService", method)(constructor.prototype[method], method, descriptor);
94
+ }
95
+ };
96
+ }
97
+
98
+ export const UPLOAD_SERVICE_NAME = "UploadService";