@noildm/contracts 1.0.2 → 1.0.5

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.
@@ -0,0 +1,38 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "auth.v1";
3
+ /** Syntax version */
4
+ export interface RegistrationRequest {
5
+ email: string;
6
+ userName: string;
7
+ /**
8
+ * bool isVerified = 4; логическое выражение
9
+ * int32 age = 5; число
10
+ * double rating = 6 плавающая точка
11
+ * repeated string roles = 7; массив
12
+ * map<string, string> meta = 8; Record
13
+ * Status status = 9; Работаю enum
14
+ * oneof orientation {
15
+ * bool isGay =10;
16
+ * bool isHeterosexual = 11;
17
+ * } можно выбрать одно значение либо.либо
18
+ * google.protobuf.Timestamp created_at = 12;
19
+ * google.protobuf.Timestamp updated_at = 13;
20
+ */
21
+ password: string;
22
+ }
23
+ export interface RegistrationResponse {
24
+ email: string;
25
+ expiresTime: number;
26
+ message: string;
27
+ }
28
+ export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
29
+ export interface AuthServiceClient {
30
+ /** rpc Name (Request) returns (Response); */
31
+ registration(request: RegistrationRequest): Observable<RegistrationResponse>;
32
+ }
33
+ export interface AuthServiceController {
34
+ /** rpc Name (Request) returns (Response); */
35
+ registration(request: RegistrationRequest): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
36
+ }
37
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
38
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -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.2
5
+ // protoc v6.33.5
6
+ // source: auth.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "auth.v1";
13
+ exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
14
+ function AuthServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["registration"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("AuthService", 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)("AuthService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,124 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
4
+ * URL that describes the type of the serialized message.
5
+ *
6
+ * Protobuf library provides support to pack/unpack Any values in the form
7
+ * of utility functions or additional generated methods of the Any type.
8
+ *
9
+ * Example 1: Pack and unpack a message in C++.
10
+ *
11
+ * Foo foo = ...;
12
+ * Any any;
13
+ * any.PackFrom(foo);
14
+ * ...
15
+ * if (any.UnpackTo(&foo)) {
16
+ * ...
17
+ * }
18
+ *
19
+ * Example 2: Pack and unpack a message in Java.
20
+ *
21
+ * Foo foo = ...;
22
+ * Any any = Any.pack(foo);
23
+ * ...
24
+ * if (any.is(Foo.class)) {
25
+ * foo = any.unpack(Foo.class);
26
+ * }
27
+ * // or ...
28
+ * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
29
+ * foo = any.unpack(Foo.getDefaultInstance());
30
+ * }
31
+ *
32
+ * Example 3: Pack and unpack a message in Python.
33
+ *
34
+ * foo = Foo(...)
35
+ * any = Any()
36
+ * any.Pack(foo)
37
+ * ...
38
+ * if any.Is(Foo.DESCRIPTOR):
39
+ * any.Unpack(foo)
40
+ * ...
41
+ *
42
+ * Example 4: Pack and unpack a message in Go
43
+ *
44
+ * foo := &pb.Foo{...}
45
+ * any, err := anypb.New(foo)
46
+ * if err != nil {
47
+ * ...
48
+ * }
49
+ * ...
50
+ * foo := &pb.Foo{}
51
+ * if err := any.UnmarshalTo(foo); err != nil {
52
+ * ...
53
+ * }
54
+ *
55
+ * The pack methods provided by protobuf library will by default use
56
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
57
+ * methods only use the fully qualified type name after the last '/'
58
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
59
+ * name "y.z".
60
+ *
61
+ * JSON
62
+ * ====
63
+ * The JSON representation of an `Any` value uses the regular
64
+ * representation of the deserialized, embedded message, with an
65
+ * additional field `@type` which contains the type URL. Example:
66
+ *
67
+ * package google.profile;
68
+ * message Person {
69
+ * string first_name = 1;
70
+ * string last_name = 2;
71
+ * }
72
+ *
73
+ * {
74
+ * "@type": "type.googleapis.com/google.profile.Person",
75
+ * "firstName": <string>,
76
+ * "lastName": <string>
77
+ * }
78
+ *
79
+ * If the embedded message type is well-known and has a custom JSON
80
+ * representation, that representation will be embedded adding a field
81
+ * `value` which holds the custom JSON in addition to the `@type`
82
+ * field. Example (for message [google.protobuf.Duration][]):
83
+ *
84
+ * {
85
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
86
+ * "value": "1.212s"
87
+ * }
88
+ */
89
+ export interface Any {
90
+ /**
91
+ * A URL/resource name that uniquely identifies the type of the serialized
92
+ * protocol buffer message. This string must contain at least
93
+ * one "/" character. The last segment of the URL's path must represent
94
+ * the fully qualified name of the type (as in
95
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
96
+ * (e.g., leading "." is not accepted).
97
+ *
98
+ * In practice, teams usually precompile into the binary all types that they
99
+ * expect it to use in the context of Any. However, for URLs which use the
100
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
101
+ * server that maps type URLs to message definitions as follows:
102
+ *
103
+ * * If no scheme is provided, `https` is assumed.
104
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
105
+ * value in binary format, or produce an error.
106
+ * * Applications are allowed to cache lookup results based on the
107
+ * URL, or have them precompiled into a binary to avoid any
108
+ * lookup. Therefore, binary compatibility needs to be preserved
109
+ * on changes to types. (Use versioned type names to manage
110
+ * breaking changes.)
111
+ *
112
+ * Note: this functionality is not currently available in the official
113
+ * protobuf release, and it is not used for type URLs beginning with
114
+ * type.googleapis.com. As of May 2023, there are no widely used type server
115
+ * implementations and no plans to implement one.
116
+ *
117
+ * Schemes other than `http`, `https` (or the empty scheme) might be
118
+ * used with implementation specific semantics.
119
+ */
120
+ typeUrl: string;
121
+ /** Must be a valid serialized protocol buffer of the above specified type. */
122
+ value: Uint8Array;
123
+ }
124
+ 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.2
5
+ // protoc v6.33.5
6
+ // source: google/protobuf/any.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,79 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * A Duration represents a signed, fixed-length span of time represented
4
+ * as a count of seconds and fractions of seconds at nanosecond
5
+ * resolution. It is independent of any calendar and concepts like "day"
6
+ * or "month". It is related to Timestamp in that the difference between
7
+ * two Timestamp values is a Duration and it can be added or subtracted
8
+ * from a Timestamp. Range is approximately +-10,000 years.
9
+ *
10
+ * # Examples
11
+ *
12
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
13
+ *
14
+ * Timestamp start = ...;
15
+ * Timestamp end = ...;
16
+ * Duration duration = ...;
17
+ *
18
+ * duration.seconds = end.seconds - start.seconds;
19
+ * duration.nanos = end.nanos - start.nanos;
20
+ *
21
+ * if (duration.seconds < 0 && duration.nanos > 0) {
22
+ * duration.seconds += 1;
23
+ * duration.nanos -= 1000000000;
24
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
25
+ * duration.seconds -= 1;
26
+ * duration.nanos += 1000000000;
27
+ * }
28
+ *
29
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
30
+ *
31
+ * Timestamp start = ...;
32
+ * Duration duration = ...;
33
+ * Timestamp end = ...;
34
+ *
35
+ * end.seconds = start.seconds + duration.seconds;
36
+ * end.nanos = start.nanos + duration.nanos;
37
+ *
38
+ * if (end.nanos < 0) {
39
+ * end.seconds -= 1;
40
+ * end.nanos += 1000000000;
41
+ * } else if (end.nanos >= 1000000000) {
42
+ * end.seconds += 1;
43
+ * end.nanos -= 1000000000;
44
+ * }
45
+ *
46
+ * Example 3: Compute Duration from datetime.timedelta in Python.
47
+ *
48
+ * td = datetime.timedelta(days=3, minutes=10)
49
+ * duration = Duration()
50
+ * duration.FromTimedelta(td)
51
+ *
52
+ * # JSON Mapping
53
+ *
54
+ * In JSON format, the Duration type is encoded as a string rather than an
55
+ * object, where the string ends in the suffix "s" (indicating seconds) and
56
+ * is preceded by the number of seconds, with nanoseconds expressed as
57
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
58
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
59
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
60
+ * microsecond should be expressed in JSON format as "3.000001s".
61
+ */
62
+ export interface Duration {
63
+ /**
64
+ * Signed seconds of the span of time. Must be from -315,576,000,000
65
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
66
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
67
+ */
68
+ seconds: number;
69
+ /**
70
+ * Signed fractions of a second at nanosecond resolution of the span
71
+ * of time. Durations less than one second are represented with a 0
72
+ * `seconds` field and a positive or negative `nanos` field. For durations
73
+ * of one second or more, a non-zero value for the `nanos` field must be
74
+ * of the same sign as the `seconds` field. Must be from -999,999,999
75
+ * to +999,999,999 inclusive.
76
+ */
77
+ nanos: number;
78
+ }
79
+ 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.2
5
+ // protoc v6.33.5
6
+ // source: google/protobuf/duration.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,13 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * A generic empty message that you can re-use to avoid defining duplicated
4
+ * empty messages in your APIs. A typical example is to use it as the request
5
+ * or the response type of an API method. For instance:
6
+ *
7
+ * service Foo {
8
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
9
+ * }
10
+ */
11
+ export interface Empty {
12
+ }
13
+ 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.2
5
+ // protoc v6.33.5
6
+ // source: google/protobuf/empty.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,87 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * `NullValue` is a singleton enumeration to represent the null value for the
4
+ * `Value` type union.
5
+ *
6
+ * The JSON representation for `NullValue` is JSON `null`.
7
+ */
8
+ export declare enum NullValue {
9
+ /** NULL_VALUE - Null value. */
10
+ NULL_VALUE = 0,
11
+ UNRECOGNIZED = -1
12
+ }
13
+ /**
14
+ * `Struct` represents a structured data value, consisting of fields
15
+ * which map to dynamically typed values. In some languages, `Struct`
16
+ * might be supported by a native representation. For example, in
17
+ * scripting languages like JS a struct is represented as an
18
+ * object. The details of that representation are described together
19
+ * with the proto support for the language.
20
+ *
21
+ * The JSON representation for `Struct` is JSON object.
22
+ */
23
+ export interface Struct {
24
+ /** Unordered map of dynamically typed values. */
25
+ fields: {
26
+ [key: string]: any | undefined;
27
+ };
28
+ }
29
+ export interface Struct_FieldsEntry {
30
+ key: string;
31
+ value: any | undefined;
32
+ }
33
+ /**
34
+ * `Value` represents a dynamically typed value which can be either
35
+ * null, a number, a string, a boolean, a recursive struct value, or a
36
+ * list of values. A producer of value is expected to set one of these
37
+ * variants. Absence of any variant indicates an error.
38
+ *
39
+ * The JSON representation for `Value` is JSON value.
40
+ */
41
+ export interface Value {
42
+ /** Represents a null value. */
43
+ nullValue?: NullValue | undefined;
44
+ /** Represents a double value. */
45
+ numberValue?: number | undefined;
46
+ /** Represents a string value. */
47
+ stringValue?: string | undefined;
48
+ /** Represents a boolean value. */
49
+ boolValue?: boolean | undefined;
50
+ /** Represents a structured value. */
51
+ structValue?: {
52
+ [key: string]: any;
53
+ } | undefined;
54
+ /** Represents a repeated `Value`. */
55
+ listValue?: Array<any> | undefined;
56
+ }
57
+ /**
58
+ * `ListValue` is a wrapper around a repeated field of values.
59
+ *
60
+ * The JSON representation for `ListValue` is JSON array.
61
+ */
62
+ export interface ListValue {
63
+ /** Repeated field of dynamically typed values. */
64
+ values: any[];
65
+ }
66
+ export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
67
+ export declare const Struct: MessageFns<Struct> & StructWrapperFns;
68
+ export declare const Value: MessageFns<Value> & AnyValueWrapperFns;
69
+ export declare const ListValue: MessageFns<ListValue> & ListValueWrapperFns;
70
+ export interface MessageFns<T> {
71
+ }
72
+ export interface StructWrapperFns {
73
+ wrap(object: {
74
+ [key: string]: any;
75
+ } | undefined): Struct;
76
+ unwrap(message: Struct): {
77
+ [key: string]: any;
78
+ };
79
+ }
80
+ export interface AnyValueWrapperFns {
81
+ wrap(value: any): Value;
82
+ unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
83
+ }
84
+ export interface ListValueWrapperFns {
85
+ wrap(array: Array<any> | undefined): ListValue;
86
+ unwrap(message: ListValue): Array<any>;
87
+ }
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.2
5
+ // protoc v6.33.5
6
+ // source: google/protobuf/struct.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ListValue = exports.Value = exports.Struct = exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.NullValue = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const protobufjs_1 = require("protobufjs");
11
+ exports.protobufPackage = "google.protobuf";
12
+ /**
13
+ * `NullValue` is a singleton enumeration to represent the null value for the
14
+ * `Value` type union.
15
+ *
16
+ * The JSON representation for `NullValue` is JSON `null`.
17
+ */
18
+ var NullValue;
19
+ (function (NullValue) {
20
+ /** NULL_VALUE - Null value. */
21
+ NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
22
+ NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
23
+ })(NullValue || (exports.NullValue = NullValue = {}));
24
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
25
+ function createBaseStruct() {
26
+ return { fields: {} };
27
+ }
28
+ exports.Struct = {
29
+ wrap(object) {
30
+ const struct = createBaseStruct();
31
+ if (object !== undefined) {
32
+ for (const key of globalThis.Object.keys(object)) {
33
+ struct.fields[key] = exports.Value.wrap(object[key]);
34
+ }
35
+ }
36
+ return struct;
37
+ },
38
+ unwrap(message) {
39
+ const object = {};
40
+ if (message.fields) {
41
+ for (const key of globalThis.Object.keys(message.fields)) {
42
+ object[key] = exports.Value.unwrap(message.fields[key]);
43
+ }
44
+ }
45
+ return object;
46
+ },
47
+ };
48
+ function createBaseValue() {
49
+ return {};
50
+ }
51
+ exports.Value = {
52
+ wrap(value) {
53
+ const result = {};
54
+ if (value === null) {
55
+ result.nullValue = NullValue.NULL_VALUE;
56
+ }
57
+ else if (typeof value === "boolean") {
58
+ result.boolValue = value;
59
+ }
60
+ else if (typeof value === "number") {
61
+ result.numberValue = value;
62
+ }
63
+ else if (typeof value === "string") {
64
+ result.stringValue = value;
65
+ }
66
+ else if (globalThis.Array.isArray(value)) {
67
+ result.listValue = exports.ListValue.wrap(value);
68
+ }
69
+ else if (typeof value === "object") {
70
+ result.structValue = exports.Struct.wrap(value);
71
+ }
72
+ else if (typeof value !== "undefined") {
73
+ throw new globalThis.Error("Unsupported any value type: " + typeof value);
74
+ }
75
+ return result;
76
+ },
77
+ unwrap(message) {
78
+ if (message?.hasOwnProperty("stringValue") && message.stringValue !== undefined) {
79
+ return message.stringValue;
80
+ }
81
+ else if (message?.hasOwnProperty("numberValue") && message?.numberValue !== undefined) {
82
+ return message.numberValue;
83
+ }
84
+ else if (message?.hasOwnProperty("boolValue") && message?.boolValue !== undefined) {
85
+ return message.boolValue;
86
+ }
87
+ else if (message?.hasOwnProperty("structValue") && message?.structValue !== undefined) {
88
+ return exports.Struct.unwrap(message.structValue);
89
+ }
90
+ else if (message?.hasOwnProperty("listValue") && message?.listValue !== undefined) {
91
+ return exports.ListValue.unwrap(message.listValue);
92
+ }
93
+ else if (message?.hasOwnProperty("nullValue") && message?.nullValue !== undefined) {
94
+ return null;
95
+ }
96
+ return undefined;
97
+ },
98
+ };
99
+ function createBaseListValue() {
100
+ return { values: [] };
101
+ }
102
+ exports.ListValue = {
103
+ wrap(array) {
104
+ const result = createBaseListValue();
105
+ result.values = (array ?? []).map(exports.Value.wrap);
106
+ return result;
107
+ },
108
+ unwrap(message) {
109
+ if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
110
+ return message.values.map(exports.Value.unwrap);
111
+ }
112
+ else {
113
+ return message;
114
+ }
115
+ },
116
+ };
117
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: exports.Struct.wrap, toObject: exports.Struct.unwrap };
@@ -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 proto3 JSON serializer should always use UTC (as indicated by
76
+ * "Z") when printing the Timestamp type and a proto3 JSON 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 -315576000000 and 315576000000 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.2
5
+ // protoc v6.33.5
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";
package/package.json CHANGED
@@ -1,23 +1,28 @@
1
1
  {
2
2
  "name": "@noildm/contracts",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "Protobuf and RabbitMQ contracts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
5
7
  "scripts": {
6
- "generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
8
+ "generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
9
+ "build": "tsc -p tsconfig.json",
10
+ "prepack": "npm run generate && npm run build"
7
11
  },
8
12
  "files": [
9
13
  "proto",
10
- "gen"
14
+ "gen",
15
+ "dist"
11
16
  ],
12
- "publishConfig": {
13
- "access": "public"
14
- },
15
17
  "dependencies": {
16
18
  "@bufbuild/buf": "^1.65.0",
17
19
  "@nestjs/microservices": "^11.1.13",
20
+ "protobufjs": "^8.0.0",
18
21
  "rxjs": "^7.8.2"
19
22
  },
20
23
  "devDependencies": {
21
- "ts-proto": "^2.11.2"
24
+ "@types/protobufjs": "^6.0.0",
25
+ "ts-proto": "^2.11.2",
26
+ "typescript": "^5.0.0"
22
27
  }
23
28
  }