@mamindom/contracts 1.0.34 → 1.0.36
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.
- package/dist/gen/brand.d.ts +3 -0
- package/dist/gen/category.d.ts +3 -0
- package/dist/gen/media.d.ts +16 -0
- package/dist/gen/media.js +16 -2
- package/dist/gen/product.d.ts +11 -0
- package/dist/proto/brand.proto +3 -0
- package/dist/proto/category.proto +4 -0
- package/dist/proto/media.proto +23 -7
- package/dist/proto/product.proto +14 -0
- package/dist/src/proto/paths.d.ts +1 -0
- package/dist/src/proto/paths.js +2 -1
- package/gen/brand.ts +3 -0
- package/gen/category.ts +3 -0
- package/gen/media.ts +35 -1
- package/gen/product.ts +12 -0
- package/package.json +1 -1
- package/proto/brand.proto +3 -0
- package/proto/category.proto +4 -0
- package/proto/media.proto +23 -7
- package/proto/product.proto +14 -0
package/dist/gen/brand.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface BrandResponse {
|
|
|
16
16
|
[key: string]: string;
|
|
17
17
|
};
|
|
18
18
|
guid1c?: string | undefined;
|
|
19
|
+
imageId?: string | undefined;
|
|
19
20
|
}
|
|
20
21
|
export interface BrandResponse_DescriptionEntry {
|
|
21
22
|
key: string;
|
|
@@ -54,6 +55,7 @@ export interface CreateBrandRequest {
|
|
|
54
55
|
[key: string]: string;
|
|
55
56
|
};
|
|
56
57
|
guid1c?: string | undefined;
|
|
58
|
+
imageId?: string | undefined;
|
|
57
59
|
}
|
|
58
60
|
export interface CreateBrandRequest_DescriptionEntry {
|
|
59
61
|
key: string;
|
|
@@ -81,6 +83,7 @@ export interface UpdateBrandRequest {
|
|
|
81
83
|
metaDescription: {
|
|
82
84
|
[key: string]: string;
|
|
83
85
|
};
|
|
86
|
+
imageId?: string | undefined;
|
|
84
87
|
}
|
|
85
88
|
export interface UpdateBrandRequest_DescriptionEntry {
|
|
86
89
|
key: string;
|
package/dist/gen/category.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface CategoryResponse {
|
|
|
41
41
|
[key: string]: string;
|
|
42
42
|
};
|
|
43
43
|
guid1c?: string | undefined;
|
|
44
|
+
imageId?: string | undefined;
|
|
44
45
|
}
|
|
45
46
|
export interface CategoryResponse_NameEntry {
|
|
46
47
|
key: string;
|
|
@@ -95,6 +96,7 @@ export interface CreateCategoryRequest {
|
|
|
95
96
|
[key: string]: string;
|
|
96
97
|
};
|
|
97
98
|
guid1c?: string | undefined;
|
|
99
|
+
imageId?: string | undefined;
|
|
98
100
|
}
|
|
99
101
|
export interface CreateCategoryRequest_NameEntry {
|
|
100
102
|
key: string;
|
|
@@ -145,6 +147,7 @@ export interface UpdateCategoryRequest {
|
|
|
145
147
|
metaH1: {
|
|
146
148
|
[key: string]: string;
|
|
147
149
|
};
|
|
150
|
+
imageId?: string | undefined;
|
|
148
151
|
}
|
|
149
152
|
export interface UpdateCategoryRequest_NameEntry {
|
|
150
153
|
key: string;
|
package/dist/gen/media.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
export declare const protobufPackage = "media.v1";
|
|
3
|
+
export declare enum MediaStatus {
|
|
4
|
+
MEDIA_STATUS_UNSPECIFIED = 0,
|
|
5
|
+
MEDIA_STATUS_PENDING = 1,
|
|
6
|
+
MEDIA_STATUS_READY = 2,
|
|
7
|
+
MEDIA_STATUS_FAILED = 3,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
3
10
|
export interface GetPresignedUrlRequest {
|
|
4
11
|
fileName: string;
|
|
5
12
|
mimeType: string;
|
|
@@ -11,6 +18,12 @@ export interface GetPresignedUrlResponse {
|
|
|
11
18
|
fileId: string;
|
|
12
19
|
publicUrl: string;
|
|
13
20
|
}
|
|
21
|
+
export interface GetMultiplePresignedUrlsRequest {
|
|
22
|
+
files: GetPresignedUrlRequest[];
|
|
23
|
+
}
|
|
24
|
+
export interface GetMultiplePresignedUrlsResponse {
|
|
25
|
+
urls: GetPresignedUrlResponse[];
|
|
26
|
+
}
|
|
14
27
|
export interface ConfirmUploadRequest {
|
|
15
28
|
fileId: string;
|
|
16
29
|
}
|
|
@@ -30,16 +43,19 @@ export interface MediaResponse {
|
|
|
30
43
|
fileSize: number;
|
|
31
44
|
publicUrl: string;
|
|
32
45
|
createdById: string;
|
|
46
|
+
status: MediaStatus;
|
|
33
47
|
}
|
|
34
48
|
export declare const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
35
49
|
export interface MediaServiceClient {
|
|
36
50
|
getPresignedUploadUrl(request: GetPresignedUrlRequest): Observable<GetPresignedUrlResponse>;
|
|
51
|
+
getMultiplePresignedUploadUrls(request: GetMultiplePresignedUrlsRequest): Observable<GetMultiplePresignedUrlsResponse>;
|
|
37
52
|
confirmUpload(request: ConfirmUploadRequest): Observable<MediaResponse>;
|
|
38
53
|
deleteMedia(request: DeleteMediaRequest): Observable<DeleteMediaResponse>;
|
|
39
54
|
getMedia(request: GetMediaRequest): Observable<MediaResponse>;
|
|
40
55
|
}
|
|
41
56
|
export interface MediaServiceController {
|
|
42
57
|
getPresignedUploadUrl(request: GetPresignedUrlRequest): Promise<GetPresignedUrlResponse> | Observable<GetPresignedUrlResponse> | GetPresignedUrlResponse;
|
|
58
|
+
getMultiplePresignedUploadUrls(request: GetMultiplePresignedUrlsRequest): Promise<GetMultiplePresignedUrlsResponse> | Observable<GetMultiplePresignedUrlsResponse> | GetMultiplePresignedUrlsResponse;
|
|
43
59
|
confirmUpload(request: ConfirmUploadRequest): Promise<MediaResponse> | Observable<MediaResponse> | MediaResponse;
|
|
44
60
|
deleteMedia(request: DeleteMediaRequest): Promise<DeleteMediaResponse> | Observable<DeleteMediaResponse> | DeleteMediaResponse;
|
|
45
61
|
getMedia(request: GetMediaRequest): Promise<MediaResponse> | Observable<MediaResponse> | MediaResponse;
|
package/dist/gen/media.js
CHANGED
|
@@ -5,15 +5,29 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: media.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.MEDIA_SERVICE_NAME = exports.MEDIA_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
8
|
+
exports.MEDIA_SERVICE_NAME = exports.MEDIA_V1_PACKAGE_NAME = exports.MediaStatus = exports.protobufPackage = void 0;
|
|
9
9
|
exports.MediaServiceControllerMethods = MediaServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
12
|
exports.protobufPackage = "media.v1";
|
|
13
|
+
var MediaStatus;
|
|
14
|
+
(function (MediaStatus) {
|
|
15
|
+
MediaStatus[MediaStatus["MEDIA_STATUS_UNSPECIFIED"] = 0] = "MEDIA_STATUS_UNSPECIFIED";
|
|
16
|
+
MediaStatus[MediaStatus["MEDIA_STATUS_PENDING"] = 1] = "MEDIA_STATUS_PENDING";
|
|
17
|
+
MediaStatus[MediaStatus["MEDIA_STATUS_READY"] = 2] = "MEDIA_STATUS_READY";
|
|
18
|
+
MediaStatus[MediaStatus["MEDIA_STATUS_FAILED"] = 3] = "MEDIA_STATUS_FAILED";
|
|
19
|
+
MediaStatus[MediaStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
20
|
+
})(MediaStatus || (exports.MediaStatus = MediaStatus = {}));
|
|
13
21
|
exports.MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
14
22
|
function MediaServiceControllerMethods() {
|
|
15
23
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = [
|
|
24
|
+
const grpcMethods = [
|
|
25
|
+
"getPresignedUploadUrl",
|
|
26
|
+
"getMultiplePresignedUploadUrls",
|
|
27
|
+
"confirmUpload",
|
|
28
|
+
"deleteMedia",
|
|
29
|
+
"getMedia",
|
|
30
|
+
];
|
|
17
31
|
for (const method of grpcMethods) {
|
|
18
32
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
33
|
(0, microservices_1.GrpcMethod)("MediaService", method)(constructor.prototype[method], method, descriptor);
|
package/dist/gen/product.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export interface ProductDetailResponse {
|
|
|
70
70
|
variants: ProductVariantResponse[];
|
|
71
71
|
attributes: ProductAttributeResponse[];
|
|
72
72
|
files: ProductFileResponse[];
|
|
73
|
+
mainImageId?: string | undefined;
|
|
73
74
|
}
|
|
74
75
|
export interface ProductDetailResponse_NameEntry {
|
|
75
76
|
key: string;
|
|
@@ -110,6 +111,7 @@ export interface ProductImageResponse {
|
|
|
110
111
|
[key: string]: string;
|
|
111
112
|
};
|
|
112
113
|
sortOrder: number;
|
|
114
|
+
mediaId: string;
|
|
113
115
|
}
|
|
114
116
|
export interface ProductImageResponse_AltEntry {
|
|
115
117
|
key: string;
|
|
@@ -193,6 +195,8 @@ export interface CreateProductRequest {
|
|
|
193
195
|
guid1c?: string | undefined;
|
|
194
196
|
categoryIds: string[];
|
|
195
197
|
createdById: string;
|
|
198
|
+
mainImageId?: string | undefined;
|
|
199
|
+
images: ProductImagePayload[];
|
|
196
200
|
}
|
|
197
201
|
export interface CreateProductRequest_NameEntry {
|
|
198
202
|
key: string;
|
|
@@ -239,6 +243,8 @@ export interface UpdateProductRequest {
|
|
|
239
243
|
};
|
|
240
244
|
mainImage?: string | undefined;
|
|
241
245
|
categoryIds: string[];
|
|
246
|
+
mainImageId?: string | undefined;
|
|
247
|
+
images: ProductImagePayload[];
|
|
242
248
|
}
|
|
243
249
|
export interface UpdateProductRequest_NameEntry {
|
|
244
250
|
key: string;
|
|
@@ -276,6 +282,11 @@ export interface BulkUpdateDiscountRequest {
|
|
|
276
282
|
productIds: string[];
|
|
277
283
|
discountPercentage: number;
|
|
278
284
|
}
|
|
285
|
+
export interface ProductImagePayload {
|
|
286
|
+
url: string;
|
|
287
|
+
mediaId: string;
|
|
288
|
+
sortOrder: number;
|
|
289
|
+
}
|
|
279
290
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
280
291
|
export interface ProductServiceClient {
|
|
281
292
|
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
package/dist/proto/brand.proto
CHANGED
|
@@ -28,6 +28,7 @@ message BrandResponse {
|
|
|
28
28
|
map<string, string> meta_description = 7;
|
|
29
29
|
|
|
30
30
|
optional string guid_1c = 8;
|
|
31
|
+
optional string image_id = 9;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
|
|
@@ -56,6 +57,7 @@ message CreateBrandRequest {
|
|
|
56
57
|
map<string, string> meta_description = 6;
|
|
57
58
|
|
|
58
59
|
optional string guid_1c = 7;
|
|
60
|
+
optional string image_id = 8;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
message UpdateBrandRequest {
|
|
@@ -67,6 +69,7 @@ message UpdateBrandRequest {
|
|
|
67
69
|
map<string, string> description = 5;
|
|
68
70
|
map<string, string> meta_title = 6;
|
|
69
71
|
map<string, string> meta_description = 7;
|
|
72
|
+
optional string image_id = 8;
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
message DeleteBrandRequest {
|
|
@@ -55,6 +55,7 @@ message CategoryResponse {
|
|
|
55
55
|
map<string, string> meta_h1 = 12;
|
|
56
56
|
|
|
57
57
|
optional string guid_1c = 13;
|
|
58
|
+
optional string image_id = 14;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
message GetCategoryRequest {
|
|
@@ -78,6 +79,7 @@ message CreateCategoryRequest {
|
|
|
78
79
|
map<string, string> meta_h1 = 11;
|
|
79
80
|
|
|
80
81
|
optional string guid_1c = 12;
|
|
82
|
+
optional string image_id = 13;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
message UpdateCategoryRequest {
|
|
@@ -95,6 +97,8 @@ message UpdateCategoryRequest {
|
|
|
95
97
|
map<string, string> meta_description = 10;
|
|
96
98
|
map<string, string> meta_keywords = 11;
|
|
97
99
|
map<string, string> meta_h1 = 12;
|
|
100
|
+
|
|
101
|
+
optional string image_id = 13;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
message DeleteCategoryRequest {
|
package/dist/proto/media.proto
CHANGED
|
@@ -7,16 +7,24 @@ service MediaService {
|
|
|
7
7
|
rpc GetPresignedUploadUrl (GetPresignedUrlRequest) returns (GetPresignedUrlResponse);
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
rpc
|
|
10
|
+
rpc GetMultiplePresignedUploadUrls (GetMultiplePresignedUrlsRequest) returns (GetMultiplePresignedUrlsResponse);
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
rpc
|
|
13
|
+
rpc ConfirmUpload (ConfirmUploadRequest) returns (MediaResponse);
|
|
14
14
|
|
|
15
|
+
|
|
16
|
+
rpc DeleteMedia (DeleteMediaRequest) returns (DeleteMediaResponse);
|
|
15
17
|
|
|
18
|
+
|
|
16
19
|
rpc GetMedia (GetMediaRequest) returns (MediaResponse);
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
enum MediaStatus {
|
|
23
|
+
MEDIA_STATUS_UNSPECIFIED = 0;
|
|
24
|
+
MEDIA_STATUS_PENDING = 1;
|
|
25
|
+
MEDIA_STATUS_READY = 2;
|
|
26
|
+
MEDIA_STATUS_FAILED = 3;
|
|
27
|
+
}
|
|
20
28
|
|
|
21
29
|
message GetPresignedUrlRequest {
|
|
22
30
|
string file_name = 1;
|
|
@@ -26,16 +34,23 @@ message GetPresignedUrlRequest {
|
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
message GetPresignedUrlResponse {
|
|
29
|
-
string upload_url = 1;
|
|
30
|
-
string file_id = 2;
|
|
31
|
-
string public_url = 3;
|
|
37
|
+
string upload_url = 1;
|
|
38
|
+
string file_id = 2;
|
|
39
|
+
string public_url = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message GetMultiplePresignedUrlsRequest {
|
|
43
|
+
repeated GetPresignedUrlRequest files = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message GetMultiplePresignedUrlsResponse {
|
|
47
|
+
repeated GetPresignedUrlResponse urls = 1;
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
message ConfirmUploadRequest {
|
|
35
51
|
string file_id = 1;
|
|
36
52
|
}
|
|
37
53
|
|
|
38
|
-
|
|
39
54
|
message DeleteMediaRequest {
|
|
40
55
|
string file_id = 1;
|
|
41
56
|
}
|
|
@@ -55,4 +70,5 @@ message MediaResponse {
|
|
|
55
70
|
int64 file_size = 4;
|
|
56
71
|
string public_url = 5;
|
|
57
72
|
string created_by_id = 6;
|
|
73
|
+
MediaStatus status = 7;
|
|
58
74
|
}
|
package/dist/proto/product.proto
CHANGED
|
@@ -74,6 +74,7 @@ message ProductDetailResponse {
|
|
|
74
74
|
repeated ProductVariantResponse variants = 23;
|
|
75
75
|
repeated ProductAttributeResponse attributes = 24;
|
|
76
76
|
repeated ProductFileResponse files = 25;
|
|
77
|
+
optional string main_image_id = 26;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
|
|
@@ -82,6 +83,7 @@ message ProductImageResponse {
|
|
|
82
83
|
string url = 2;
|
|
83
84
|
map<string, string> alt = 3;
|
|
84
85
|
int32 sort_order = 4;
|
|
86
|
+
string media_id = 5;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
message ProductWarehouseResponse {
|
|
@@ -161,6 +163,9 @@ message CreateProductRequest {
|
|
|
161
163
|
repeated string category_ids = 14;
|
|
162
164
|
|
|
163
165
|
string created_by_id = 15;
|
|
166
|
+
|
|
167
|
+
optional string main_image_id = 16;
|
|
168
|
+
repeated ProductImagePayload images = 17;
|
|
164
169
|
}
|
|
165
170
|
|
|
166
171
|
message UpdateProductRequest {
|
|
@@ -182,6 +187,9 @@ message UpdateProductRequest {
|
|
|
182
187
|
|
|
183
188
|
optional string main_image = 13;
|
|
184
189
|
repeated string category_ids = 14;
|
|
190
|
+
|
|
191
|
+
optional string main_image_id = 15;
|
|
192
|
+
repeated ProductImagePayload images = 16;
|
|
185
193
|
}
|
|
186
194
|
|
|
187
195
|
message DeleteProductRequest {
|
|
@@ -205,6 +213,12 @@ message BulkUpdateDiscountRequest {
|
|
|
205
213
|
double discount_percentage = 2;
|
|
206
214
|
}
|
|
207
215
|
|
|
216
|
+
message ProductImagePayload {
|
|
217
|
+
string url = 1;
|
|
218
|
+
string media_id = 2;
|
|
219
|
+
int32 sort_order = 3;
|
|
220
|
+
}
|
|
221
|
+
|
|
208
222
|
enum ProductStatus {
|
|
209
223
|
PRODUCT_STATUS_UNSPECIFIED = 0;
|
|
210
224
|
PRODUCT_STATUS_DRAFT = 1;
|
package/dist/src/proto/paths.js
CHANGED
|
@@ -10,5 +10,6 @@ exports.PROTO_PATHS = {
|
|
|
10
10
|
CATEGORY: (0, node_path_1.join)(__dirname, '../../proto/category.proto'),
|
|
11
11
|
ATTRIBUTE: (0, node_path_1.join)(__dirname, '../../proto/attribute.proto'),
|
|
12
12
|
BRAND: (0, node_path_1.join)(__dirname, '../../proto/brand.proto'),
|
|
13
|
-
PRODUCT: (0, node_path_1.join)(__dirname, '../../proto/product.proto')
|
|
13
|
+
PRODUCT: (0, node_path_1.join)(__dirname, '../../proto/product.proto'),
|
|
14
|
+
MEDIA: (0, node_path_1.join)(__dirname, '../../proto/media.proto')
|
|
14
15
|
};
|
package/gen/brand.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface BrandResponse {
|
|
|
20
20
|
metaTitle: { [key: string]: string };
|
|
21
21
|
metaDescription: { [key: string]: string };
|
|
22
22
|
guid1c?: string | undefined;
|
|
23
|
+
imageId?: string | undefined;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface BrandResponse_DescriptionEntry {
|
|
@@ -59,6 +60,7 @@ export interface CreateBrandRequest {
|
|
|
59
60
|
metaTitle: { [key: string]: string };
|
|
60
61
|
metaDescription: { [key: string]: string };
|
|
61
62
|
guid1c?: string | undefined;
|
|
63
|
+
imageId?: string | undefined;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export interface CreateBrandRequest_DescriptionEntry {
|
|
@@ -84,6 +86,7 @@ export interface UpdateBrandRequest {
|
|
|
84
86
|
description: { [key: string]: string };
|
|
85
87
|
metaTitle: { [key: string]: string };
|
|
86
88
|
metaDescription: { [key: string]: string };
|
|
89
|
+
imageId?: string | undefined;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
export interface UpdateBrandRequest_DescriptionEntry {
|
package/gen/category.ts
CHANGED
|
@@ -42,6 +42,7 @@ export interface CategoryResponse {
|
|
|
42
42
|
metaKeywords: { [key: string]: string };
|
|
43
43
|
metaH1: { [key: string]: string };
|
|
44
44
|
guid1c?: string | undefined;
|
|
45
|
+
imageId?: string | undefined;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export interface CategoryResponse_NameEntry {
|
|
@@ -92,6 +93,7 @@ export interface CreateCategoryRequest {
|
|
|
92
93
|
metaKeywords: { [key: string]: string };
|
|
93
94
|
metaH1: { [key: string]: string };
|
|
94
95
|
guid1c?: string | undefined;
|
|
96
|
+
imageId?: string | undefined;
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
export interface CreateCategoryRequest_NameEntry {
|
|
@@ -137,6 +139,7 @@ export interface UpdateCategoryRequest {
|
|
|
137
139
|
metaDescription: { [key: string]: string };
|
|
138
140
|
metaKeywords: { [key: string]: string };
|
|
139
141
|
metaH1: { [key: string]: string };
|
|
142
|
+
imageId?: string | undefined;
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
export interface UpdateCategoryRequest_NameEntry {
|
package/gen/media.ts
CHANGED
|
@@ -10,6 +10,14 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "media.v1";
|
|
12
12
|
|
|
13
|
+
export enum MediaStatus {
|
|
14
|
+
MEDIA_STATUS_UNSPECIFIED = 0,
|
|
15
|
+
MEDIA_STATUS_PENDING = 1,
|
|
16
|
+
MEDIA_STATUS_READY = 2,
|
|
17
|
+
MEDIA_STATUS_FAILED = 3,
|
|
18
|
+
UNRECOGNIZED = -1,
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
export interface GetPresignedUrlRequest {
|
|
14
22
|
fileName: string;
|
|
15
23
|
mimeType: string;
|
|
@@ -23,6 +31,14 @@ export interface GetPresignedUrlResponse {
|
|
|
23
31
|
publicUrl: string;
|
|
24
32
|
}
|
|
25
33
|
|
|
34
|
+
export interface GetMultiplePresignedUrlsRequest {
|
|
35
|
+
files: GetPresignedUrlRequest[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GetMultiplePresignedUrlsResponse {
|
|
39
|
+
urls: GetPresignedUrlResponse[];
|
|
40
|
+
}
|
|
41
|
+
|
|
26
42
|
export interface ConfirmUploadRequest {
|
|
27
43
|
fileId: string;
|
|
28
44
|
}
|
|
@@ -46,6 +62,7 @@ export interface MediaResponse {
|
|
|
46
62
|
fileSize: number;
|
|
47
63
|
publicUrl: string;
|
|
48
64
|
createdById: string;
|
|
65
|
+
status: MediaStatus;
|
|
49
66
|
}
|
|
50
67
|
|
|
51
68
|
export const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
@@ -53,6 +70,10 @@ export const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
|
53
70
|
export interface MediaServiceClient {
|
|
54
71
|
getPresignedUploadUrl(request: GetPresignedUrlRequest): Observable<GetPresignedUrlResponse>;
|
|
55
72
|
|
|
73
|
+
getMultiplePresignedUploadUrls(
|
|
74
|
+
request: GetMultiplePresignedUrlsRequest,
|
|
75
|
+
): Observable<GetMultiplePresignedUrlsResponse>;
|
|
76
|
+
|
|
56
77
|
confirmUpload(request: ConfirmUploadRequest): Observable<MediaResponse>;
|
|
57
78
|
|
|
58
79
|
deleteMedia(request: DeleteMediaRequest): Observable<DeleteMediaResponse>;
|
|
@@ -65,6 +86,13 @@ export interface MediaServiceController {
|
|
|
65
86
|
request: GetPresignedUrlRequest,
|
|
66
87
|
): Promise<GetPresignedUrlResponse> | Observable<GetPresignedUrlResponse> | GetPresignedUrlResponse;
|
|
67
88
|
|
|
89
|
+
getMultiplePresignedUploadUrls(
|
|
90
|
+
request: GetMultiplePresignedUrlsRequest,
|
|
91
|
+
):
|
|
92
|
+
| Promise<GetMultiplePresignedUrlsResponse>
|
|
93
|
+
| Observable<GetMultiplePresignedUrlsResponse>
|
|
94
|
+
| GetMultiplePresignedUrlsResponse;
|
|
95
|
+
|
|
68
96
|
confirmUpload(request: ConfirmUploadRequest): Promise<MediaResponse> | Observable<MediaResponse> | MediaResponse;
|
|
69
97
|
|
|
70
98
|
deleteMedia(
|
|
@@ -76,7 +104,13 @@ export interface MediaServiceController {
|
|
|
76
104
|
|
|
77
105
|
export function MediaServiceControllerMethods() {
|
|
78
106
|
return function (constructor: Function) {
|
|
79
|
-
const grpcMethods: string[] = [
|
|
107
|
+
const grpcMethods: string[] = [
|
|
108
|
+
"getPresignedUploadUrl",
|
|
109
|
+
"getMultiplePresignedUploadUrls",
|
|
110
|
+
"confirmUpload",
|
|
111
|
+
"deleteMedia",
|
|
112
|
+
"getMedia",
|
|
113
|
+
];
|
|
80
114
|
for (const method of grpcMethods) {
|
|
81
115
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
82
116
|
GrpcMethod("MediaService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/product.ts
CHANGED
|
@@ -65,6 +65,7 @@ export interface ProductDetailResponse {
|
|
|
65
65
|
variants: ProductVariantResponse[];
|
|
66
66
|
attributes: ProductAttributeResponse[];
|
|
67
67
|
files: ProductFileResponse[];
|
|
68
|
+
mainImageId?: string | undefined;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
export interface ProductDetailResponse_NameEntry {
|
|
@@ -112,6 +113,7 @@ export interface ProductImageResponse {
|
|
|
112
113
|
url: string;
|
|
113
114
|
alt: { [key: string]: string };
|
|
114
115
|
sortOrder: number;
|
|
116
|
+
mediaId: string;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
export interface ProductImageResponse_AltEntry {
|
|
@@ -192,6 +194,8 @@ export interface CreateProductRequest {
|
|
|
192
194
|
guid1c?: string | undefined;
|
|
193
195
|
categoryIds: string[];
|
|
194
196
|
createdById: string;
|
|
197
|
+
mainImageId?: string | undefined;
|
|
198
|
+
images: ProductImagePayload[];
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
export interface CreateProductRequest_NameEntry {
|
|
@@ -234,6 +238,8 @@ export interface UpdateProductRequest {
|
|
|
234
238
|
metaDescription: { [key: string]: string };
|
|
235
239
|
mainImage?: string | undefined;
|
|
236
240
|
categoryIds: string[];
|
|
241
|
+
mainImageId?: string | undefined;
|
|
242
|
+
images: ProductImagePayload[];
|
|
237
243
|
}
|
|
238
244
|
|
|
239
245
|
export interface UpdateProductRequest_NameEntry {
|
|
@@ -281,6 +287,12 @@ export interface BulkUpdateDiscountRequest {
|
|
|
281
287
|
discountPercentage: number;
|
|
282
288
|
}
|
|
283
289
|
|
|
290
|
+
export interface ProductImagePayload {
|
|
291
|
+
url: string;
|
|
292
|
+
mediaId: string;
|
|
293
|
+
sortOrder: number;
|
|
294
|
+
}
|
|
295
|
+
|
|
284
296
|
export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
285
297
|
|
|
286
298
|
export interface ProductServiceClient {
|
package/package.json
CHANGED
package/proto/brand.proto
CHANGED
|
@@ -28,6 +28,7 @@ message BrandResponse {
|
|
|
28
28
|
map<string, string> meta_description = 7;
|
|
29
29
|
|
|
30
30
|
optional string guid_1c = 8;
|
|
31
|
+
optional string image_id = 9;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
|
|
@@ -56,6 +57,7 @@ message CreateBrandRequest {
|
|
|
56
57
|
map<string, string> meta_description = 6;
|
|
57
58
|
|
|
58
59
|
optional string guid_1c = 7;
|
|
60
|
+
optional string image_id = 8;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
message UpdateBrandRequest {
|
|
@@ -67,6 +69,7 @@ message UpdateBrandRequest {
|
|
|
67
69
|
map<string, string> description = 5;
|
|
68
70
|
map<string, string> meta_title = 6;
|
|
69
71
|
map<string, string> meta_description = 7;
|
|
72
|
+
optional string image_id = 8;
|
|
70
73
|
}
|
|
71
74
|
|
|
72
75
|
message DeleteBrandRequest {
|
package/proto/category.proto
CHANGED
|
@@ -55,6 +55,7 @@ message CategoryResponse {
|
|
|
55
55
|
map<string, string> meta_h1 = 12;
|
|
56
56
|
|
|
57
57
|
optional string guid_1c = 13;
|
|
58
|
+
optional string image_id = 14;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
message GetCategoryRequest {
|
|
@@ -78,6 +79,7 @@ message CreateCategoryRequest {
|
|
|
78
79
|
map<string, string> meta_h1 = 11;
|
|
79
80
|
|
|
80
81
|
optional string guid_1c = 12;
|
|
82
|
+
optional string image_id = 13;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
message UpdateCategoryRequest {
|
|
@@ -95,6 +97,8 @@ message UpdateCategoryRequest {
|
|
|
95
97
|
map<string, string> meta_description = 10;
|
|
96
98
|
map<string, string> meta_keywords = 11;
|
|
97
99
|
map<string, string> meta_h1 = 12;
|
|
100
|
+
|
|
101
|
+
optional string image_id = 13;
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
message DeleteCategoryRequest {
|
package/proto/media.proto
CHANGED
|
@@ -7,16 +7,24 @@ service MediaService {
|
|
|
7
7
|
rpc GetPresignedUploadUrl (GetPresignedUrlRequest) returns (GetPresignedUrlResponse);
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
rpc
|
|
10
|
+
rpc GetMultiplePresignedUploadUrls (GetMultiplePresignedUrlsRequest) returns (GetMultiplePresignedUrlsResponse);
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
rpc
|
|
13
|
+
rpc ConfirmUpload (ConfirmUploadRequest) returns (MediaResponse);
|
|
14
14
|
|
|
15
|
+
|
|
16
|
+
rpc DeleteMedia (DeleteMediaRequest) returns (DeleteMediaResponse);
|
|
15
17
|
|
|
18
|
+
|
|
16
19
|
rpc GetMedia (GetMediaRequest) returns (MediaResponse);
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
enum MediaStatus {
|
|
23
|
+
MEDIA_STATUS_UNSPECIFIED = 0;
|
|
24
|
+
MEDIA_STATUS_PENDING = 1;
|
|
25
|
+
MEDIA_STATUS_READY = 2;
|
|
26
|
+
MEDIA_STATUS_FAILED = 3;
|
|
27
|
+
}
|
|
20
28
|
|
|
21
29
|
message GetPresignedUrlRequest {
|
|
22
30
|
string file_name = 1;
|
|
@@ -26,16 +34,23 @@ message GetPresignedUrlRequest {
|
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
message GetPresignedUrlResponse {
|
|
29
|
-
string upload_url = 1;
|
|
30
|
-
string file_id = 2;
|
|
31
|
-
string public_url = 3;
|
|
37
|
+
string upload_url = 1;
|
|
38
|
+
string file_id = 2;
|
|
39
|
+
string public_url = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message GetMultiplePresignedUrlsRequest {
|
|
43
|
+
repeated GetPresignedUrlRequest files = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message GetMultiplePresignedUrlsResponse {
|
|
47
|
+
repeated GetPresignedUrlResponse urls = 1;
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
message ConfirmUploadRequest {
|
|
35
51
|
string file_id = 1;
|
|
36
52
|
}
|
|
37
53
|
|
|
38
|
-
|
|
39
54
|
message DeleteMediaRequest {
|
|
40
55
|
string file_id = 1;
|
|
41
56
|
}
|
|
@@ -55,4 +70,5 @@ message MediaResponse {
|
|
|
55
70
|
int64 file_size = 4;
|
|
56
71
|
string public_url = 5;
|
|
57
72
|
string created_by_id = 6;
|
|
73
|
+
MediaStatus status = 7;
|
|
58
74
|
}
|
package/proto/product.proto
CHANGED
|
@@ -74,6 +74,7 @@ message ProductDetailResponse {
|
|
|
74
74
|
repeated ProductVariantResponse variants = 23;
|
|
75
75
|
repeated ProductAttributeResponse attributes = 24;
|
|
76
76
|
repeated ProductFileResponse files = 25;
|
|
77
|
+
optional string main_image_id = 26;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
|
|
@@ -82,6 +83,7 @@ message ProductImageResponse {
|
|
|
82
83
|
string url = 2;
|
|
83
84
|
map<string, string> alt = 3;
|
|
84
85
|
int32 sort_order = 4;
|
|
86
|
+
string media_id = 5;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
message ProductWarehouseResponse {
|
|
@@ -161,6 +163,9 @@ message CreateProductRequest {
|
|
|
161
163
|
repeated string category_ids = 14;
|
|
162
164
|
|
|
163
165
|
string created_by_id = 15;
|
|
166
|
+
|
|
167
|
+
optional string main_image_id = 16;
|
|
168
|
+
repeated ProductImagePayload images = 17;
|
|
164
169
|
}
|
|
165
170
|
|
|
166
171
|
message UpdateProductRequest {
|
|
@@ -182,6 +187,9 @@ message UpdateProductRequest {
|
|
|
182
187
|
|
|
183
188
|
optional string main_image = 13;
|
|
184
189
|
repeated string category_ids = 14;
|
|
190
|
+
|
|
191
|
+
optional string main_image_id = 15;
|
|
192
|
+
repeated ProductImagePayload images = 16;
|
|
185
193
|
}
|
|
186
194
|
|
|
187
195
|
message DeleteProductRequest {
|
|
@@ -205,6 +213,12 @@ message BulkUpdateDiscountRequest {
|
|
|
205
213
|
double discount_percentage = 2;
|
|
206
214
|
}
|
|
207
215
|
|
|
216
|
+
message ProductImagePayload {
|
|
217
|
+
string url = 1;
|
|
218
|
+
string media_id = 2;
|
|
219
|
+
int32 sort_order = 3;
|
|
220
|
+
}
|
|
221
|
+
|
|
208
222
|
enum ProductStatus {
|
|
209
223
|
PRODUCT_STATUS_UNSPECIFIED = 0;
|
|
210
224
|
PRODUCT_STATUS_DRAFT = 1;
|