@platfformx/proto-contracts 1.2.17 → 1.2.18
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/google/protobuf/timestamp.d.ts +109 -0
- package/dist/gen/ts/google/protobuf/timestamp.js +11 -0
- package/dist/gen/ts/products-service/bulk.d.ts +65 -0
- package/dist/gen/ts/products-service/bulk.js +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -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 +74 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export declare const protobufPackage = "google.protobuf";
|
|
2
|
+
/**
|
|
3
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
4
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
5
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
6
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
7
|
+
* Gregorian calendar backwards to year one.
|
|
8
|
+
*
|
|
9
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
10
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
11
|
+
* smear](https://developers.google.com/time/smear).
|
|
12
|
+
*
|
|
13
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
14
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
15
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
16
|
+
*
|
|
17
|
+
* # Examples
|
|
18
|
+
*
|
|
19
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
20
|
+
*
|
|
21
|
+
* Timestamp timestamp;
|
|
22
|
+
* timestamp.set_seconds(time(NULL));
|
|
23
|
+
* timestamp.set_nanos(0);
|
|
24
|
+
*
|
|
25
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
26
|
+
*
|
|
27
|
+
* struct timeval tv;
|
|
28
|
+
* gettimeofday(&tv, NULL);
|
|
29
|
+
*
|
|
30
|
+
* Timestamp timestamp;
|
|
31
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
32
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
33
|
+
*
|
|
34
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
35
|
+
*
|
|
36
|
+
* FILETIME ft;
|
|
37
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
38
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
39
|
+
*
|
|
40
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
41
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
42
|
+
* Timestamp timestamp;
|
|
43
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
44
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
45
|
+
*
|
|
46
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
47
|
+
*
|
|
48
|
+
* long millis = System.currentTimeMillis();
|
|
49
|
+
*
|
|
50
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
51
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
52
|
+
*
|
|
53
|
+
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
54
|
+
*
|
|
55
|
+
* Instant now = Instant.now();
|
|
56
|
+
*
|
|
57
|
+
* Timestamp timestamp =
|
|
58
|
+
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
59
|
+
* .setNanos(now.getNano()).build();
|
|
60
|
+
*
|
|
61
|
+
* Example 6: Compute Timestamp from current time in Python.
|
|
62
|
+
*
|
|
63
|
+
* timestamp = Timestamp()
|
|
64
|
+
* timestamp.GetCurrentTime()
|
|
65
|
+
*
|
|
66
|
+
* # JSON Mapping
|
|
67
|
+
*
|
|
68
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
69
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
70
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
71
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
72
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
73
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
74
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
75
|
+
* is required. A ProtoJSON serializer should always use UTC (as indicated by
|
|
76
|
+
* "Z") when printing the Timestamp type and a ProtoJSON parser should be
|
|
77
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
78
|
+
*
|
|
79
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
80
|
+
* 01:30 UTC on January 15, 2017.
|
|
81
|
+
*
|
|
82
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
83
|
+
* standard
|
|
84
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
85
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
86
|
+
* to this format using
|
|
87
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
88
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
89
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
90
|
+
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
|
91
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
92
|
+
*/
|
|
93
|
+
export interface Timestamp {
|
|
94
|
+
/**
|
|
95
|
+
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
|
96
|
+
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
|
97
|
+
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
|
98
|
+
*/
|
|
99
|
+
seconds: number;
|
|
100
|
+
/**
|
|
101
|
+
* Non-negative fractions of a second at nanosecond resolution. This field is
|
|
102
|
+
* the nanosecond portion of the duration, not an alternative to seconds.
|
|
103
|
+
* Negative second values with fractions must still have non-negative nanos
|
|
104
|
+
* values that count forward in time. Must be between 0 and 999,999,999
|
|
105
|
+
* inclusive.
|
|
106
|
+
*/
|
|
107
|
+
nanos: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -0,0 +1,11 @@
|
|
|
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: google/protobuf/timestamp.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "google.protobuf";
|
|
11
|
+
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Timestamp } from "../google/protobuf/timestamp";
|
|
3
|
+
export declare const protobufPackage = "bulk.v1";
|
|
4
|
+
export declare enum BulkStatus {
|
|
5
|
+
UNSPECIFIED = 0,
|
|
6
|
+
PENDING = 1,
|
|
7
|
+
PROCESSING = 2,
|
|
8
|
+
COMPLETED = 3,
|
|
9
|
+
FAILED = 4,
|
|
10
|
+
UNRECOGNIZED = -1
|
|
11
|
+
}
|
|
12
|
+
export interface StartImportRequest {
|
|
13
|
+
fileUrl: string;
|
|
14
|
+
syncCatalog: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface StartImportResponse {
|
|
17
|
+
importId: string;
|
|
18
|
+
status: BulkStatus;
|
|
19
|
+
}
|
|
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
|
+
export declare const BULK_V1_PACKAGE_NAME = "bulk.v1";
|
|
52
|
+
export interface BulkServiceClient {
|
|
53
|
+
startImport(request: StartImportRequest): Observable<StartImportResponse>;
|
|
54
|
+
getImportStatus(request: GetImportStatusRequest): Observable<GetImportStatusResponse>;
|
|
55
|
+
startExport(request: StartExportRequest): Observable<StartExportResponse>;
|
|
56
|
+
getExportStatus(request: GetExportStatusRequest): Observable<GetExportStatusResponse>;
|
|
57
|
+
}
|
|
58
|
+
export interface BulkServiceController {
|
|
59
|
+
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
|
+
}
|
|
64
|
+
export declare function BulkServiceControllerMethods(): (constructor: Function) => void;
|
|
65
|
+
export declare const BULK_SERVICE_NAME = "BulkService";
|
|
@@ -0,0 +1,37 @@
|
|
|
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/bulk.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BULK_SERVICE_NAME = exports.BULK_V1_PACKAGE_NAME = exports.BulkStatus = exports.protobufPackage = void 0;
|
|
9
|
+
exports.BulkServiceControllerMethods = BulkServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "bulk.v1";
|
|
13
|
+
var BulkStatus;
|
|
14
|
+
(function (BulkStatus) {
|
|
15
|
+
BulkStatus[BulkStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
16
|
+
BulkStatus[BulkStatus["PENDING"] = 1] = "PENDING";
|
|
17
|
+
BulkStatus[BulkStatus["PROCESSING"] = 2] = "PROCESSING";
|
|
18
|
+
BulkStatus[BulkStatus["COMPLETED"] = 3] = "COMPLETED";
|
|
19
|
+
BulkStatus[BulkStatus["FAILED"] = 4] = "FAILED";
|
|
20
|
+
BulkStatus[BulkStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
21
|
+
})(BulkStatus || (exports.BulkStatus = BulkStatus = {}));
|
|
22
|
+
exports.BULK_V1_PACKAGE_NAME = "bulk.v1";
|
|
23
|
+
function BulkServiceControllerMethods() {
|
|
24
|
+
return function (constructor) {
|
|
25
|
+
const grpcMethods = ["startImport", "getImportStatus", "startExport", "getExportStatus"];
|
|
26
|
+
for (const method of grpcMethods) {
|
|
27
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
28
|
+
(0, microservices_1.GrpcMethod)("BulkService", method)(constructor.prototype[method], method, descriptor);
|
|
29
|
+
}
|
|
30
|
+
const grpcStreamMethods = [];
|
|
31
|
+
for (const method of grpcStreamMethods) {
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
33
|
+
(0, microservices_1.GrpcStreamMethod)("BulkService", method)(constructor.prototype[method], method, descriptor);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.BULK_SERVICE_NAME = "BulkService";
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export * as Auth from './gen/ts/auth-service/auth';
|
|
|
5
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
|
+
export * as Bulk from './gen/ts/products-service/bulk';
|
|
9
|
+
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.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
39
|
+
exports.BulkStatus = 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");
|
|
@@ -45,3 +45,6 @@ exports.Auth = __importStar(require("./gen/ts/auth-service/auth"));
|
|
|
45
45
|
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
|
+
exports.Bulk = __importStar(require("./gen/ts/products-service/bulk"));
|
|
49
|
+
var bulk_1 = require("./gen/ts/products-service/bulk");
|
|
50
|
+
Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
|
|
@@ -6,5 +6,6 @@ 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
|
+
BULK: (0, path_1.join)(__dirname, '../../proto/products-service/bulk.proto'),
|
|
9
10
|
S3: (0, path_1.join)(__dirname, '../../proto/s3-service/s3.proto'),
|
|
10
11
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package bulk.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
service BulkService {
|
|
8
|
+
|
|
9
|
+
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
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
message StartImportRequest {
|
|
18
|
+
string file_url = 1;
|
|
19
|
+
bool sync_catalog = 2;
|
|
20
|
+
}
|
|
21
|
+
message StartImportResponse {
|
|
22
|
+
string import_id = 1;
|
|
23
|
+
BulkStatus status = 2;
|
|
24
|
+
}
|
|
25
|
+
|
|
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
|
+
enum BulkStatus {
|
|
69
|
+
UNSPECIFIED = 0;
|
|
70
|
+
PENDING = 1;
|
|
71
|
+
PROCESSING = 2;
|
|
72
|
+
COMPLETED = 3;
|
|
73
|
+
FAILED = 4;
|
|
74
|
+
}
|