@platfformx/proto-contracts 1.2.12 → 1.2.14

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.
@@ -5,13 +5,6 @@ export interface CreateProductRequest {
5
5
  categoryId: string;
6
6
  description?: string | undefined;
7
7
  price: string;
8
- quantity: number;
9
- stock: ProductStock[];
10
- }
11
- export interface ProductStock {
12
- color?: string | undefined;
13
- size?: string | undefined;
14
- sku: string;
15
8
  }
16
9
  export interface GetProductRequest {
17
10
  productId?: string | undefined;
@@ -30,11 +23,11 @@ export interface UpdateProductRequest {
30
23
  title?: string | undefined;
31
24
  price?: string | undefined;
32
25
  description?: string | undefined;
33
- stock?: number | undefined;
34
26
  categoryId?: string | undefined;
35
27
  }
36
28
  export interface DeleteProductRequest {
37
29
  productId: string;
30
+ force?: boolean | undefined;
38
31
  }
39
32
  export interface DeleteProductResponse {
40
33
  success: boolean;
@@ -46,7 +39,6 @@ export interface ProductResponse {
46
39
  description?: string | undefined;
47
40
  categoryId: string;
48
41
  price: string;
49
- quantity: number;
50
42
  images: string[];
51
43
  status: string;
52
44
  rating: number;
@@ -54,6 +46,12 @@ export interface ProductResponse {
54
46
  createdAt: string;
55
47
  updatedAt: string;
56
48
  }
49
+ /** Shared */
50
+ export interface ProductStock {
51
+ color?: string | undefined;
52
+ size?: string | undefined;
53
+ sku: string;
54
+ }
57
55
  /** IMAGES */
58
56
  export interface AddProductImagesRequest {
59
57
  productId: string;
@@ -12,12 +12,22 @@ export interface UploadFilesRequest {
12
12
  export interface UploadFilesResponse {
13
13
  urls: string[];
14
14
  }
15
+ export interface DeleteFilesRequest {
16
+ urls: string[];
17
+ folder?: string | undefined;
18
+ }
19
+ export interface DeleteFilesResponse {
20
+ success: boolean;
21
+ deletedUrls: string[];
22
+ }
15
23
  export declare const S3_SERVICE_V1_PACKAGE_NAME = "s3_service.v1";
16
24
  export interface S3ServiceClient {
17
25
  uploadFiles(request: UploadFilesRequest): Observable<UploadFilesResponse>;
26
+ deleteFiles(request: DeleteFilesRequest): Observable<DeleteFilesResponse>;
18
27
  }
19
28
  export interface S3ServiceController {
20
29
  uploadFiles(request: UploadFilesRequest): Promise<UploadFilesResponse> | Observable<UploadFilesResponse> | UploadFilesResponse;
30
+ deleteFiles(request: DeleteFilesRequest): Promise<DeleteFilesResponse> | Observable<DeleteFilesResponse> | DeleteFilesResponse;
21
31
  }
22
32
  export declare function S3ServiceControllerMethods(): (constructor: Function) => void;
23
33
  export declare const S3_SERVICE_NAME = "S3Service";
@@ -13,7 +13,7 @@ exports.protobufPackage = "s3_service.v1";
13
13
  exports.S3_SERVICE_V1_PACKAGE_NAME = "s3_service.v1";
14
14
  function S3ServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = ["uploadFiles"];
16
+ const grpcMethods = ["uploadFiles", "deleteFiles"];
17
17
  for (const method of grpcMethods) {
18
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
19
  (0, microservices_1.GrpcMethod)("S3Service", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.2.12",
3
+ "version": "1.2.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,15 +24,8 @@ message CreateProductRequest{
24
24
  string category_id = 2;
25
25
  optional string description = 3;
26
26
  string price = 4;
27
- int32 quantity = 5;
28
- repeated ProductStock stock = 6;
29
27
  }
30
28
 
31
- message ProductStock {
32
- optional string color = 1;
33
- optional string size = 2;
34
- string sku = 3;
35
- }
36
29
  message GetProductRequest {
37
30
  oneof identifier {
38
31
  string product_id = 1;
@@ -54,12 +47,12 @@ message UpdateProductRequest {
54
47
  optional string title = 2;
55
48
  optional string price = 3;
56
49
  optional string description = 4;
57
- optional int32 stock = 5;
58
50
  optional string category_id = 6;
59
51
  }
60
52
 
61
53
  message DeleteProductRequest {
62
54
  string product_id = 1;
55
+ optional bool force = 2;
63
56
  }
64
57
 
65
58
  message DeleteProductResponse {
@@ -72,7 +65,6 @@ message ProductResponse{
72
65
  optional string description = 4;
73
66
  string category_id = 5;
74
67
  string price = 6;
75
- int32 quantity = 7;
76
68
  repeated string images = 8;
77
69
  string status = 9;
78
70
  float rating = 10;
@@ -80,7 +72,12 @@ message ProductResponse{
80
72
  string created_at = 12;
81
73
  string updated_at = 13;
82
74
  }
83
-
75
+ // Shared
76
+ message ProductStock {
77
+ optional string color = 1;
78
+ optional string size = 2;
79
+ string sku = 3;
80
+ }
84
81
 
85
82
  // IMAGES
86
83
  message AddProductImagesRequest {
@@ -5,6 +5,7 @@ package s3_service.v1;
5
5
 
6
6
  service S3Service {
7
7
  rpc UploadFiles (UploadFilesRequest) returns (UploadFilesResponse);
8
+ rpc DeleteFiles (DeleteFilesRequest) returns (DeleteFilesResponse);
8
9
  }
9
10
 
10
11
  message FilePayload {
@@ -20,4 +21,14 @@ message UploadFilesRequest {
20
21
 
21
22
  message UploadFilesResponse {
22
23
  repeated string urls = 1;
24
+ }
25
+
26
+ message DeleteFilesRequest {
27
+ repeated string urls = 1;
28
+ optional string folder = 2;
29
+ }
30
+
31
+ message DeleteFilesResponse {
32
+ bool success = 1;
33
+ repeated string deleted_urls = 2;
23
34
  }