@platfformx/proto-contracts 1.2.7 → 1.2.9
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/product.d.ts +6 -5
- package/dist/gen/ts/products-service/product.js +3 -3
- package/dist/gen/ts/s3-service/s3.d.ts +23 -0
- package/dist/gen/ts/s3-service/s3.js +28 -0
- 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/product.proto +10 -9
- package/proto/s3-service/s3.proto +23 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
export declare const protobufPackage = "product";
|
|
2
|
+
export declare const protobufPackage = "product.v1";
|
|
3
3
|
export interface CreateProductRequest {
|
|
4
4
|
title: string;
|
|
5
|
+
categoryId: string;
|
|
5
6
|
description?: string | undefined;
|
|
6
7
|
price: number;
|
|
7
|
-
images: string[];
|
|
8
|
-
categoryId: string;
|
|
9
8
|
quantity: number;
|
|
9
|
+
images: string[];
|
|
10
10
|
variants: ProductVariant[];
|
|
11
11
|
}
|
|
12
12
|
export interface ProductVariant {
|
|
@@ -15,7 +15,8 @@ export interface ProductVariant {
|
|
|
15
15
|
sku: string;
|
|
16
16
|
}
|
|
17
17
|
export interface GetProductRequest {
|
|
18
|
-
productId
|
|
18
|
+
productId?: string | undefined;
|
|
19
|
+
slug?: string | undefined;
|
|
19
20
|
}
|
|
20
21
|
export interface GetProductsRequest {
|
|
21
22
|
categoryId?: string | undefined;
|
|
@@ -54,7 +55,7 @@ export interface ProductResponse {
|
|
|
54
55
|
createdAt: string;
|
|
55
56
|
updatedAt: string;
|
|
56
57
|
}
|
|
57
|
-
export declare const
|
|
58
|
+
export declare const PRODUCT_V1_PACKAGE_NAME = "product.v1";
|
|
58
59
|
export interface ProductServiceClient {
|
|
59
60
|
createProduct(request: CreateProductRequest): Observable<ProductResponse>;
|
|
60
61
|
updateProduct(request: UpdateProductRequest): Observable<ProductResponse>;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
// protoc v7.34.0
|
|
6
6
|
// source: products-service/product.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.PRODUCT_SERVICE_NAME = exports.
|
|
8
|
+
exports.PRODUCT_SERVICE_NAME = exports.PRODUCT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
9
|
exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
-
exports.protobufPackage = "product";
|
|
13
|
-
exports.
|
|
12
|
+
exports.protobufPackage = "product.v1";
|
|
13
|
+
exports.PRODUCT_V1_PACKAGE_NAME = "product.v1";
|
|
14
14
|
function ProductServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
16
|
const grpcMethods = ["createProduct", "updateProduct", "deleteProduct", "getProduct", "getProducts"];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "s3_service.v1";
|
|
3
|
+
export interface FilePayload {
|
|
4
|
+
buffer: Uint8Array;
|
|
5
|
+
originalname: string;
|
|
6
|
+
mimetype: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UploadFilesRequest {
|
|
9
|
+
files: FilePayload[];
|
|
10
|
+
folder?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface UploadFilesResponse {
|
|
13
|
+
urls: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare const S3_SERVICE_V1_PACKAGE_NAME = "s3_service.v1";
|
|
16
|
+
export interface S3ServiceClient {
|
|
17
|
+
uploadFiles(request: UploadFilesRequest): Observable<UploadFilesResponse>;
|
|
18
|
+
}
|
|
19
|
+
export interface S3ServiceController {
|
|
20
|
+
uploadFiles(request: UploadFilesRequest): Promise<UploadFilesResponse> | Observable<UploadFilesResponse> | UploadFilesResponse;
|
|
21
|
+
}
|
|
22
|
+
export declare function S3ServiceControllerMethods(): (constructor: Function) => void;
|
|
23
|
+
export declare const S3_SERVICE_NAME = "S3Service";
|
|
@@ -0,0 +1,28 @@
|
|
|
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: s3-service/s3.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.S3_SERVICE_NAME = exports.S3_SERVICE_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.S3ServiceControllerMethods = S3ServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "s3_service.v1";
|
|
13
|
+
exports.S3_SERVICE_V1_PACKAGE_NAME = "s3_service.v1";
|
|
14
|
+
function S3ServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["uploadFiles"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("S3Service", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("S3Service", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.S3_SERVICE_NAME = "S3Service";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from './paths/index';
|
|
|
2
2
|
export * from './paths/proto-paths';
|
|
3
3
|
export { OAuthProvider } from './gen/ts/auth-service/auth';
|
|
4
4
|
export * as Auth from './gen/ts/auth-service/auth';
|
|
5
|
+
export * as S3 from './gen/ts/s3-service/s3';
|
|
5
6
|
export * as Account from './gen/ts/users-service/account';
|
|
6
7
|
export * as Product from './gen/ts/products-service/product';
|
package/dist/index.js
CHANGED
|
@@ -36,11 +36,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Product = exports.Account = exports.Auth = exports.OAuthProvider = void 0;
|
|
39
|
+
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");
|
|
43
43
|
Object.defineProperty(exports, "OAuthProvider", { enumerable: true, get: function () { return auth_1.OAuthProvider; } });
|
|
44
44
|
exports.Auth = __importStar(require("./gen/ts/auth-service/auth"));
|
|
45
|
+
exports.S3 = __importStar(require("./gen/ts/s3-service/s3"));
|
|
45
46
|
exports.Account = __importStar(require("./gen/ts/users-service/account"));
|
|
46
47
|
exports.Product = __importStar(require("./gen/ts/products-service/product"));
|
|
@@ -6,4 +6,5 @@ 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
|
+
S3: (0, path_1.join)(__dirname, '../../proto/s3-service/s3.proto'),
|
|
9
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
|
-
package product;
|
|
3
|
+
package product.v1;
|
|
4
4
|
|
|
5
5
|
service ProductService {
|
|
6
6
|
rpc CreateProduct (CreateProductRequest) returns (ProductResponse);
|
|
@@ -12,21 +12,22 @@ service ProductService {
|
|
|
12
12
|
|
|
13
13
|
message CreateProductRequest{
|
|
14
14
|
string title = 1;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
string category_id = 2;
|
|
16
|
+
optional string description = 3;
|
|
17
|
+
double price = 4;
|
|
18
|
+
int32 quantity = 5;
|
|
19
|
+
repeated string images = 6;
|
|
20
|
+
repeated ProductVariant variants = 7;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
message ProductVariant {
|
|
24
24
|
optional string color = 1;
|
|
25
|
-
optional string size =2;
|
|
25
|
+
optional string size = 2;
|
|
26
26
|
string sku = 3;
|
|
27
27
|
}
|
|
28
28
|
message GetProductRequest {
|
|
29
|
-
string product_id = 1;
|
|
29
|
+
optional string product_id = 1;
|
|
30
|
+
optional string slug = 2;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
message GetProductsRequest {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package s3_service.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service S3Service {
|
|
7
|
+
rpc UploadFiles (UploadFilesRequest) returns (UploadFilesResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message FilePayload {
|
|
11
|
+
bytes buffer = 1;
|
|
12
|
+
string originalname = 2;
|
|
13
|
+
string mimetype = 3;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message UploadFilesRequest {
|
|
17
|
+
repeated FilePayload files = 1;
|
|
18
|
+
optional string folder = 2;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message UploadFilesResponse {
|
|
22
|
+
repeated string urls = 1;
|
|
23
|
+
}
|