@platfformx/proto-contracts 1.2.18 → 1.2.20
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/ts/products-service/bulk.d.ts +0 -38
- package/dist/gen/ts/products-service/bulk.js +1 -1
- package/dist/gen/ts/products-service/categories.d.ts +64 -0
- package/dist/gen/ts/products-service/categories.js +35 -0
- package/dist/gen/ts/products-service/category.d.ts +64 -0
- package/dist/gen/ts/products-service/category.js +35 -0
- package/dist/gen/ts/products-service/product.d.ts +10 -0
- package/dist/gen/ts/products-service/product.js +8 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/paths/proto-paths.d.ts +1 -0
- package/dist/paths/proto-paths.js +1 -0
- package/package.json +1 -1
- package/proto/products-service/bulk.proto +0 -49
- package/proto/products-service/category.proto +69 -0
- package/proto/products-service/product.proto +21 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
import { Timestamp } from "../google/protobuf/timestamp";
|
|
3
2
|
export declare const protobufPackage = "bulk.v1";
|
|
4
3
|
export declare enum BulkStatus {
|
|
5
4
|
UNSPECIFIED = 0,
|
|
@@ -17,49 +16,12 @@ export interface StartImportResponse {
|
|
|
17
16
|
importId: string;
|
|
18
17
|
status: BulkStatus;
|
|
19
18
|
}
|
|
20
|
-
export interface GetImportStatusRequest {
|
|
21
|
-
importId: string;
|
|
22
|
-
}
|
|
23
|
-
export interface GetImportStatusResponse {
|
|
24
|
-
importId: string;
|
|
25
|
-
status: BulkStatus;
|
|
26
|
-
totalRows: number;
|
|
27
|
-
processedRows: number;
|
|
28
|
-
createdCount: number;
|
|
29
|
-
updatedCount: number;
|
|
30
|
-
deactivatedCount: number;
|
|
31
|
-
errorCount: number;
|
|
32
|
-
errorsFileUrl?: string | undefined;
|
|
33
|
-
createdAt: Timestamp | undefined;
|
|
34
|
-
updatedAt: Timestamp | undefined;
|
|
35
|
-
}
|
|
36
|
-
export interface StartExportRequest {
|
|
37
|
-
categoryId?: string | undefined;
|
|
38
|
-
}
|
|
39
|
-
export interface StartExportResponse {
|
|
40
|
-
exportId: string;
|
|
41
|
-
}
|
|
42
|
-
export interface GetExportStatusRequest {
|
|
43
|
-
}
|
|
44
|
-
export interface GetExportStatusResponse {
|
|
45
|
-
exportId: string;
|
|
46
|
-
fileUrl: string;
|
|
47
|
-
status: BulkStatus;
|
|
48
|
-
createdAt: Timestamp | undefined;
|
|
49
|
-
completedAt: Timestamp | undefined;
|
|
50
|
-
}
|
|
51
19
|
export declare const BULK_V1_PACKAGE_NAME = "bulk.v1";
|
|
52
20
|
export interface BulkServiceClient {
|
|
53
21
|
startImport(request: StartImportRequest): Observable<StartImportResponse>;
|
|
54
|
-
getImportStatus(request: GetImportStatusRequest): Observable<GetImportStatusResponse>;
|
|
55
|
-
startExport(request: StartExportRequest): Observable<StartExportResponse>;
|
|
56
|
-
getExportStatus(request: GetExportStatusRequest): Observable<GetExportStatusResponse>;
|
|
57
22
|
}
|
|
58
23
|
export interface BulkServiceController {
|
|
59
24
|
startImport(request: StartImportRequest): Promise<StartImportResponse> | Observable<StartImportResponse> | StartImportResponse;
|
|
60
|
-
getImportStatus(request: GetImportStatusRequest): Promise<GetImportStatusResponse> | Observable<GetImportStatusResponse> | GetImportStatusResponse;
|
|
61
|
-
startExport(request: StartExportRequest): Promise<StartExportResponse> | Observable<StartExportResponse> | StartExportResponse;
|
|
62
|
-
getExportStatus(request: GetExportStatusRequest): Promise<GetExportStatusResponse> | Observable<GetExportStatusResponse> | GetExportStatusResponse;
|
|
63
25
|
}
|
|
64
26
|
export declare function BulkServiceControllerMethods(): (constructor: Function) => void;
|
|
65
27
|
export declare const BULK_SERVICE_NAME = "BulkService";
|
|
@@ -22,7 +22,7 @@ var BulkStatus;
|
|
|
22
22
|
exports.BULK_V1_PACKAGE_NAME = "bulk.v1";
|
|
23
23
|
function BulkServiceControllerMethods() {
|
|
24
24
|
return function (constructor) {
|
|
25
|
-
const grpcMethods = ["startImport"
|
|
25
|
+
const grpcMethods = ["startImport"];
|
|
26
26
|
for (const method of grpcMethods) {
|
|
27
27
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
28
28
|
(0, microservices_1.GrpcMethod)("BulkService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "categories.v1";
|
|
3
|
+
export interface CategoryResponse {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateCategoryRequest {
|
|
9
|
+
title: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateCategoryResponse {
|
|
13
|
+
category: CategoryResponse | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface UpdateCategoryRequest {
|
|
16
|
+
categoryId: string;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
slug?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateCategoryResponse {
|
|
21
|
+
category: CategoryResponse | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface DeleteCategoryRequest {
|
|
24
|
+
categoryId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DeleteCategoryResponse {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface GetCategoryRequest {
|
|
30
|
+
productId?: string | undefined;
|
|
31
|
+
slug?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface GetCategoryResponse {
|
|
34
|
+
category: CategoryResponse | undefined;
|
|
35
|
+
}
|
|
36
|
+
export interface CreateCategoriesRequest {
|
|
37
|
+
categories: CreateCategoryRequest[];
|
|
38
|
+
}
|
|
39
|
+
export interface CreateCategoriesResponse {
|
|
40
|
+
}
|
|
41
|
+
export interface GetCategoriesRequest {
|
|
42
|
+
}
|
|
43
|
+
export interface GetCategoriesResponse {
|
|
44
|
+
categories: CategoryResponse[];
|
|
45
|
+
}
|
|
46
|
+
export declare const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
|
|
47
|
+
export interface CategoryServiceClient {
|
|
48
|
+
createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
|
|
49
|
+
updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
|
|
50
|
+
deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
|
|
51
|
+
getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
|
|
52
|
+
createCategories(request: CreateCategoriesRequest): Observable<CreateCategoriesResponse>;
|
|
53
|
+
getCategories(request: GetCategoriesRequest): Observable<GetCategoriesResponse>;
|
|
54
|
+
}
|
|
55
|
+
export interface CategoryServiceController {
|
|
56
|
+
createCategory(request: CreateCategoryRequest): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
|
|
57
|
+
updateCategory(request: UpdateCategoryRequest): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
|
|
58
|
+
deleteCategory(request: DeleteCategoryRequest): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
|
|
59
|
+
getCategory(request: GetCategoryRequest): Promise<GetCategoryResponse> | Observable<GetCategoryResponse> | GetCategoryResponse;
|
|
60
|
+
createCategories(request: CreateCategoriesRequest): Promise<CreateCategoriesResponse> | Observable<CreateCategoriesResponse> | CreateCategoriesResponse;
|
|
61
|
+
getCategories(request: GetCategoriesRequest): Promise<GetCategoriesResponse> | Observable<GetCategoriesResponse> | GetCategoriesResponse;
|
|
62
|
+
}
|
|
63
|
+
export declare function CategoryServiceControllerMethods(): (constructor: Function) => void;
|
|
64
|
+
export declare const CATEGORY_SERVICE_NAME = "CategoryService";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
|
+
// protoc v7.34.0
|
|
6
|
+
// source: products-service/categories.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.CATEGORY_SERVICE_NAME = exports.CATEGORIES_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.CategoryServiceControllerMethods = CategoryServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "categories.v1";
|
|
13
|
+
exports.CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
|
|
14
|
+
function CategoryServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"createCategory",
|
|
18
|
+
"updateCategory",
|
|
19
|
+
"deleteCategory",
|
|
20
|
+
"getCategory",
|
|
21
|
+
"createCategories",
|
|
22
|
+
"getCategories",
|
|
23
|
+
];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("CategoryService", method)(constructor.prototype[method], method, descriptor);
|
|
27
|
+
}
|
|
28
|
+
const grpcStreamMethods = [];
|
|
29
|
+
for (const method of grpcStreamMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcStreamMethod)("CategoryService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.CATEGORY_SERVICE_NAME = "CategoryService";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "categories.v1";
|
|
3
|
+
export interface CategoryResponse {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateCategoryRequest {
|
|
9
|
+
title: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CreateCategoryResponse {
|
|
13
|
+
category: CategoryResponse | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface UpdateCategoryRequest {
|
|
16
|
+
categoryId: string;
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
slug?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateCategoryResponse {
|
|
21
|
+
category: CategoryResponse | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface DeleteCategoryRequest {
|
|
24
|
+
categoryId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DeleteCategoryResponse {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface GetCategoryRequest {
|
|
30
|
+
productId?: string | undefined;
|
|
31
|
+
slug?: string | undefined;
|
|
32
|
+
}
|
|
33
|
+
export interface GetCategoryResponse {
|
|
34
|
+
category: CategoryResponse | undefined;
|
|
35
|
+
}
|
|
36
|
+
export interface CreateCategoriesRequest {
|
|
37
|
+
categories: CreateCategoryRequest[];
|
|
38
|
+
}
|
|
39
|
+
export interface CreateCategoriesResponse {
|
|
40
|
+
}
|
|
41
|
+
export interface GetCategoriesRequest {
|
|
42
|
+
}
|
|
43
|
+
export interface GetCategoriesResponse {
|
|
44
|
+
categories: CategoryResponse[];
|
|
45
|
+
}
|
|
46
|
+
export declare const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
|
|
47
|
+
export interface CategoryServiceClient {
|
|
48
|
+
createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
|
|
49
|
+
updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
|
|
50
|
+
deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
|
|
51
|
+
getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
|
|
52
|
+
createCategories(request: CreateCategoriesRequest): Observable<CreateCategoriesResponse>;
|
|
53
|
+
getCategories(request: GetCategoriesRequest): Observable<GetCategoriesResponse>;
|
|
54
|
+
}
|
|
55
|
+
export interface CategoryServiceController {
|
|
56
|
+
createCategory(request: CreateCategoryRequest): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
|
|
57
|
+
updateCategory(request: UpdateCategoryRequest): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
|
|
58
|
+
deleteCategory(request: DeleteCategoryRequest): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
|
|
59
|
+
getCategory(request: GetCategoryRequest): Promise<GetCategoryResponse> | Observable<GetCategoryResponse> | GetCategoryResponse;
|
|
60
|
+
createCategories(request: CreateCategoriesRequest): Promise<CreateCategoriesResponse> | Observable<CreateCategoriesResponse> | CreateCategoriesResponse;
|
|
61
|
+
getCategories(request: GetCategoriesRequest): Promise<GetCategoriesResponse> | Observable<GetCategoriesResponse> | GetCategoriesResponse;
|
|
62
|
+
}
|
|
63
|
+
export declare function CategoryServiceControllerMethods(): (constructor: Function) => void;
|
|
64
|
+
export declare const CATEGORY_SERVICE_NAME = "CategoryService";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
|
+
// protoc v7.34.0
|
|
6
|
+
// source: products-service/category.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.CATEGORY_SERVICE_NAME = exports.CATEGORIES_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.CategoryServiceControllerMethods = CategoryServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "categories.v1";
|
|
13
|
+
exports.CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
|
|
14
|
+
function CategoryServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"createCategory",
|
|
18
|
+
"updateCategory",
|
|
19
|
+
"deleteCategory",
|
|
20
|
+
"getCategory",
|
|
21
|
+
"createCategories",
|
|
22
|
+
"getCategories",
|
|
23
|
+
];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("CategoryService", method)(constructor.prototype[method], method, descriptor);
|
|
27
|
+
}
|
|
28
|
+
const grpcStreamMethods = [];
|
|
29
|
+
for (const method of grpcStreamMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcStreamMethod)("CategoryService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.CATEGORY_SERVICE_NAME = "CategoryService";
|
|
@@ -34,6 +34,14 @@ export interface DeleteProductRequest {
|
|
|
34
34
|
export interface DeleteProductResponse {
|
|
35
35
|
success: boolean;
|
|
36
36
|
}
|
|
37
|
+
export interface GetProductsByCategoryRequest {
|
|
38
|
+
categoryId: string;
|
|
39
|
+
page: number;
|
|
40
|
+
limit: number;
|
|
41
|
+
}
|
|
42
|
+
export interface GetProductsByCategoryResponse {
|
|
43
|
+
products: ProductResponse[];
|
|
44
|
+
}
|
|
37
45
|
export interface ProductResponse {
|
|
38
46
|
id: string;
|
|
39
47
|
slug: string;
|
|
@@ -55,6 +63,7 @@ export interface ProductServiceClient {
|
|
|
55
63
|
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
56
64
|
getProduct(request: GetProductRequest): Observable<ProductResponse>;
|
|
57
65
|
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
|
66
|
+
getProductsByCategory(request: GetProductsByCategoryRequest): Observable<GetProductsByCategoryResponse>;
|
|
58
67
|
}
|
|
59
68
|
export interface ProductServiceController {
|
|
60
69
|
createProduct(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
@@ -62,6 +71,7 @@ export interface ProductServiceController {
|
|
|
62
71
|
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
63
72
|
getProduct(request: GetProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
64
73
|
getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
74
|
+
getProductsByCategory(request: GetProductsByCategoryRequest): Promise<GetProductsByCategoryResponse> | Observable<GetProductsByCategoryResponse> | GetProductsByCategoryResponse;
|
|
65
75
|
}
|
|
66
76
|
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
67
77
|
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
|
@@ -13,7 +13,14 @@ exports.protobufPackage = "product.v1";
|
|
|
13
13
|
exports.PRODUCT_V1_PACKAGE_NAME = "product.v1";
|
|
14
14
|
function ProductServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = [
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"createProduct",
|
|
18
|
+
"updateProduct",
|
|
19
|
+
"deleteProduct",
|
|
20
|
+
"getProduct",
|
|
21
|
+
"getProducts",
|
|
22
|
+
"getProductsByCategory",
|
|
23
|
+
];
|
|
17
24
|
for (const method of grpcMethods) {
|
|
18
25
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
26
|
(0, microservices_1.GrpcMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export * as S3 from './gen/ts/s3-service/s3';
|
|
|
6
6
|
export * as Account from './gen/ts/users-service/account';
|
|
7
7
|
export * as Product from './gen/ts/products-service/product';
|
|
8
8
|
export * as Bulk from './gen/ts/products-service/bulk';
|
|
9
|
+
export * as Category from './gen/ts/products-service/categories';
|
|
9
10
|
export { BulkStatus } from './gen/ts/products-service/bulk';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BulkStatus = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
39
|
+
exports.BulkStatus = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
40
40
|
__exportStar(require("./paths/index"), exports);
|
|
41
41
|
__exportStar(require("./paths/proto-paths"), exports);
|
|
42
42
|
var auth_1 = require("./gen/ts/auth-service/auth");
|
|
@@ -46,5 +46,6 @@ exports.S3 = __importStar(require("./gen/ts/s3-service/s3"));
|
|
|
46
46
|
exports.Account = __importStar(require("./gen/ts/users-service/account"));
|
|
47
47
|
exports.Product = __importStar(require("./gen/ts/products-service/product"));
|
|
48
48
|
exports.Bulk = __importStar(require("./gen/ts/products-service/bulk"));
|
|
49
|
+
exports.Category = __importStar(require("./gen/ts/products-service/categories"));
|
|
49
50
|
var bulk_1 = require("./gen/ts/products-service/bulk");
|
|
50
51
|
Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
|
|
@@ -6,6 +6,7 @@ exports.PROTO_PATHS = {
|
|
|
6
6
|
ACCOUNT: (0, path_1.join)(__dirname, '../../proto/users-service/account.proto'),
|
|
7
7
|
AUTH: (0, path_1.join)(__dirname, '../../proto/auth-service/auth.proto'),
|
|
8
8
|
PRODUCT: (0, path_1.join)(__dirname, '../../proto/products-service/product.proto'),
|
|
9
|
+
CATEGORY: (0, path_1.join)(__dirname, '../../proto/products-service/categories.proto'),
|
|
9
10
|
BULK: (0, path_1.join)(__dirname, '../../proto/products-service/bulk.proto'),
|
|
10
11
|
S3: (0, path_1.join)(__dirname, '../../proto/s3-service/s3.proto'),
|
|
11
12
|
};
|
package/package.json
CHANGED
|
@@ -2,15 +2,8 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package bulk.v1;
|
|
4
4
|
|
|
5
|
-
import "google/protobuf/timestamp.proto";
|
|
6
|
-
|
|
7
5
|
service BulkService {
|
|
8
|
-
|
|
9
6
|
rpc StartImport (StartImportRequest) returns (StartImportResponse);
|
|
10
|
-
rpc GetImportStatus(GetImportStatusRequest) returns (GetImportStatusResponse);
|
|
11
|
-
|
|
12
|
-
rpc StartExport (StartExportRequest) returns (StartExportResponse);
|
|
13
|
-
rpc GetExportStatus (GetExportStatusRequest) returns (GetExportStatusResponse);
|
|
14
7
|
}
|
|
15
8
|
|
|
16
9
|
|
|
@@ -23,48 +16,6 @@ message StartImportResponse {
|
|
|
23
16
|
BulkStatus status = 2;
|
|
24
17
|
}
|
|
25
18
|
|
|
26
|
-
message GetImportStatusRequest {
|
|
27
|
-
string import_id = 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
message GetImportStatusResponse {
|
|
31
|
-
string import_id = 1;
|
|
32
|
-
BulkStatus status = 2;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
int32 total_rows = 3;
|
|
36
|
-
int32 processed_rows = 4;
|
|
37
|
-
int32 created_count = 5;
|
|
38
|
-
int32 updated_count = 6;
|
|
39
|
-
int32 deactivated_count = 7;
|
|
40
|
-
int32 error_count = 8;
|
|
41
|
-
optional string errors_file_url = 9;
|
|
42
|
-
google.protobuf.Timestamp created_at = 10;
|
|
43
|
-
google.protobuf.Timestamp updated_at = 11;
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
message StartExportRequest {
|
|
48
|
-
optional string category_id = 2;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
message StartExportResponse {
|
|
52
|
-
string export_id = 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
message GetExportStatusRequest {
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
message GetExportStatusResponse {
|
|
59
|
-
string export_id = 1;
|
|
60
|
-
string file_url = 2;
|
|
61
|
-
BulkStatus status = 3;
|
|
62
|
-
|
|
63
|
-
google.protobuf.Timestamp created_at = 4;
|
|
64
|
-
google.protobuf.Timestamp completed_at = 5;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
19
|
enum BulkStatus {
|
|
69
20
|
UNSPECIFIED = 0;
|
|
70
21
|
PENDING = 1;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package categories.v1;
|
|
4
|
+
|
|
5
|
+
service CategoryService {
|
|
6
|
+
rpc CreateCategory (CreateCategoryRequest) returns (CreateCategoryResponse);
|
|
7
|
+
rpc UpdateCategory(UpdateCategoryRequest) returns (UpdateCategoryResponse);
|
|
8
|
+
rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteCategoryResponse);
|
|
9
|
+
rpc GetCategory(GetCategoryRequest) returns (GetCategoryResponse);
|
|
10
|
+
|
|
11
|
+
rpc CreateCategories (CreateCategoriesRequest) returns (CreateCategoriesResponse);
|
|
12
|
+
rpc GetCategories(GetCategoriesRequest) returns (GetCategoriesResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
message CategoryResponse {
|
|
17
|
+
string id = 1;
|
|
18
|
+
string title = 2;
|
|
19
|
+
string slug = 3;
|
|
20
|
+
}
|
|
21
|
+
message CreateCategoryRequest {
|
|
22
|
+
string title = 2;
|
|
23
|
+
string slug = 3;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message CreateCategoryResponse {
|
|
27
|
+
CategoryResponse category = 1;
|
|
28
|
+
}
|
|
29
|
+
message UpdateCategoryRequest {
|
|
30
|
+
string category_id = 1;
|
|
31
|
+
optional string title = 2;
|
|
32
|
+
optional string slug = 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message UpdateCategoryResponse {
|
|
36
|
+
CategoryResponse category = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message DeleteCategoryRequest {
|
|
40
|
+
string category_id = 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message DeleteCategoryResponse {
|
|
44
|
+
bool ok = 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
message GetCategoryRequest {
|
|
49
|
+
oneof identifier {
|
|
50
|
+
string product_id = 1;
|
|
51
|
+
string slug = 2;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
message GetCategoryResponse {
|
|
55
|
+
CategoryResponse category = 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message CreateCategoriesRequest {
|
|
59
|
+
repeated CreateCategoryRequest categories = 1;
|
|
60
|
+
}
|
|
61
|
+
message CreateCategoriesResponse {
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
message GetCategoriesRequest {
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
message GetCategoriesResponse {
|
|
68
|
+
repeated CategoryResponse categories = 1;
|
|
69
|
+
}
|
|
@@ -8,6 +8,8 @@ service ProductService {
|
|
|
8
8
|
rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
|
|
9
9
|
rpc GetProduct(GetProductRequest) returns (ProductResponse);
|
|
10
10
|
rpc GetProducts(GetProductsRequest) returns (GetProductsResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetProductsByCategory (GetProductsByCategoryRequest) returns (GetProductsByCategoryResponse);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
message CreateProductRequest {
|
|
@@ -40,8 +42,8 @@ message UpdateProductRequest {
|
|
|
40
42
|
optional string title = 2;
|
|
41
43
|
optional string price = 3;
|
|
42
44
|
optional string description = 4;
|
|
43
|
-
optional string category_id =
|
|
44
|
-
repeated string images =
|
|
45
|
+
optional string category_id = 5;
|
|
46
|
+
repeated string images = 6;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
message DeleteProductRequest {
|
|
@@ -52,6 +54,17 @@ message DeleteProductRequest {
|
|
|
52
54
|
message DeleteProductResponse {
|
|
53
55
|
bool success = 1;
|
|
54
56
|
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
message GetProductsByCategoryRequest {
|
|
60
|
+
string category_id = 1;
|
|
61
|
+
int32 page = 2;
|
|
62
|
+
int32 limit = 3;
|
|
63
|
+
}
|
|
64
|
+
message GetProductsByCategoryResponse {
|
|
65
|
+
repeated ProductResponse products = 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
55
68
|
message ProductResponse{
|
|
56
69
|
string id = 1;
|
|
57
70
|
string slug = 2;
|
|
@@ -59,11 +72,11 @@ message ProductResponse{
|
|
|
59
72
|
optional string description = 4;
|
|
60
73
|
string category_id = 5;
|
|
61
74
|
string price = 6;
|
|
62
|
-
repeated string images =
|
|
63
|
-
string status =
|
|
64
|
-
float rating =
|
|
65
|
-
int32 review_count =
|
|
66
|
-
string created_at =
|
|
67
|
-
string updated_at =
|
|
75
|
+
repeated string images = 7;
|
|
76
|
+
string status = 8;
|
|
77
|
+
float rating = 9;
|
|
78
|
+
int32 review_count = 10;
|
|
79
|
+
string created_at = 11;
|
|
80
|
+
string updated_at = 12;
|
|
68
81
|
}
|
|
69
82
|
|