@noildm/contracts 1.0.0 → 1.0.1
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/README.md +2 -3
- package/gen/auth.ts +73 -73
- package/gen/google/protobuf/any.ts +134 -134
- package/gen/google/protobuf/duration.ts +89 -89
- package/gen/google/protobuf/empty.ts +23 -23
- package/gen/google/protobuf/struct.ts +197 -197
- package/gen/google/protobuf/timestamp.ts +119 -119
- package/package.json +23 -23
- package/proto/auth.proto +48 -48
package/README.md
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
npx protoc -I ./proto ./proto/\*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit
|
|
1
|
+
1. npm version patch
|
|
2
|
+
2. git push
|
package/gen/auth.ts
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.2
|
|
4
|
-
// protoc v6.33.
|
|
5
|
-
// source: auth.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
import { Duration } from "./google/protobuf/duration";
|
|
11
|
-
|
|
12
|
-
export const protobufPackage = "auth.v1";
|
|
13
|
-
|
|
14
|
-
/** Syntax version */
|
|
15
|
-
|
|
16
|
-
export interface RegistrationRequest {
|
|
17
|
-
email: string;
|
|
18
|
-
userName: string;
|
|
19
|
-
/**
|
|
20
|
-
* bool isVerified = 4; логическое выражение
|
|
21
|
-
* int32 age = 5; число
|
|
22
|
-
* double rating = 6 плавающая точка
|
|
23
|
-
* repeated string roles = 7; массив
|
|
24
|
-
* map<string, string> meta = 8; Record
|
|
25
|
-
* Status status = 9; Работаю enum
|
|
26
|
-
* oneof orientation {
|
|
27
|
-
* bool isGay =10;
|
|
28
|
-
* bool isHeterosexual = 11;
|
|
29
|
-
* } можно выбрать одно значение либо.либо
|
|
30
|
-
* google.protobuf.Timestamp created_at = 12;
|
|
31
|
-
* google.protobuf.Timestamp updated_at = 13;
|
|
32
|
-
*/
|
|
33
|
-
password: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface RegistrationResponse {
|
|
37
|
-
email: string;
|
|
38
|
-
expiresTime: Duration | undefined;
|
|
39
|
-
message: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
|
-
|
|
44
|
-
export interface AuthServiceClient {
|
|
45
|
-
/** rpc Name (Request) returns (Response); */
|
|
46
|
-
|
|
47
|
-
registration(request: RegistrationRequest): Observable<RegistrationResponse>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface AuthServiceController {
|
|
51
|
-
/** rpc Name (Request) returns (Response); */
|
|
52
|
-
|
|
53
|
-
registration(
|
|
54
|
-
request: RegistrationRequest,
|
|
55
|
-
): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function AuthServiceControllerMethods() {
|
|
59
|
-
return function (constructor: Function) {
|
|
60
|
-
const grpcMethods: string[] = ["registration"];
|
|
61
|
-
for (const method of grpcMethods) {
|
|
62
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
-
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
-
}
|
|
65
|
-
const grpcStreamMethods: string[] = [];
|
|
66
|
-
for (const method of grpcStreamMethods) {
|
|
67
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: auth.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Duration } from "./google/protobuf/duration";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "auth.v1";
|
|
13
|
+
|
|
14
|
+
/** Syntax version */
|
|
15
|
+
|
|
16
|
+
export interface RegistrationRequest {
|
|
17
|
+
email: string;
|
|
18
|
+
userName: string;
|
|
19
|
+
/**
|
|
20
|
+
* bool isVerified = 4; логическое выражение
|
|
21
|
+
* int32 age = 5; число
|
|
22
|
+
* double rating = 6 плавающая точка
|
|
23
|
+
* repeated string roles = 7; массив
|
|
24
|
+
* map<string, string> meta = 8; Record
|
|
25
|
+
* Status status = 9; Работаю enum
|
|
26
|
+
* oneof orientation {
|
|
27
|
+
* bool isGay =10;
|
|
28
|
+
* bool isHeterosexual = 11;
|
|
29
|
+
* } можно выбрать одно значение либо.либо
|
|
30
|
+
* google.protobuf.Timestamp created_at = 12;
|
|
31
|
+
* google.protobuf.Timestamp updated_at = 13;
|
|
32
|
+
*/
|
|
33
|
+
password: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface RegistrationResponse {
|
|
37
|
+
email: string;
|
|
38
|
+
expiresTime: Duration | undefined;
|
|
39
|
+
message: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
|
+
|
|
44
|
+
export interface AuthServiceClient {
|
|
45
|
+
/** rpc Name (Request) returns (Response); */
|
|
46
|
+
|
|
47
|
+
registration(request: RegistrationRequest): Observable<RegistrationResponse>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface AuthServiceController {
|
|
51
|
+
/** rpc Name (Request) returns (Response); */
|
|
52
|
+
|
|
53
|
+
registration(
|
|
54
|
+
request: RegistrationRequest,
|
|
55
|
+
): Promise<RegistrationResponse> | Observable<RegistrationResponse> | RegistrationResponse;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function AuthServiceControllerMethods() {
|
|
59
|
+
return function (constructor: Function) {
|
|
60
|
+
const grpcMethods: string[] = ["registration"];
|
|
61
|
+
for (const method of grpcMethods) {
|
|
62
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
+
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
+
}
|
|
65
|
+
const grpcStreamMethods: string[] = [];
|
|
66
|
+
for (const method of grpcStreamMethods) {
|
|
67
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
|
+
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const AUTH_SERVICE_NAME = "AuthService";
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.2
|
|
4
|
-
// protoc v6.33.
|
|
5
|
-
// source: google/protobuf/any.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
13
|
-
* URL that describes the type of the serialized message.
|
|
14
|
-
*
|
|
15
|
-
* Protobuf library provides support to pack/unpack Any values in the form
|
|
16
|
-
* of utility functions or additional generated methods of the Any type.
|
|
17
|
-
*
|
|
18
|
-
* Example 1: Pack and unpack a message in C++.
|
|
19
|
-
*
|
|
20
|
-
* Foo foo = ...;
|
|
21
|
-
* Any any;
|
|
22
|
-
* any.PackFrom(foo);
|
|
23
|
-
* ...
|
|
24
|
-
* if (any.UnpackTo(&foo)) {
|
|
25
|
-
* ...
|
|
26
|
-
* }
|
|
27
|
-
*
|
|
28
|
-
* Example 2: Pack and unpack a message in Java.
|
|
29
|
-
*
|
|
30
|
-
* Foo foo = ...;
|
|
31
|
-
* Any any = Any.pack(foo);
|
|
32
|
-
* ...
|
|
33
|
-
* if (any.is(Foo.class)) {
|
|
34
|
-
* foo = any.unpack(Foo.class);
|
|
35
|
-
* }
|
|
36
|
-
* // or ...
|
|
37
|
-
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
38
|
-
* foo = any.unpack(Foo.getDefaultInstance());
|
|
39
|
-
* }
|
|
40
|
-
*
|
|
41
|
-
* Example 3: Pack and unpack a message in Python.
|
|
42
|
-
*
|
|
43
|
-
* foo = Foo(...)
|
|
44
|
-
* any = Any()
|
|
45
|
-
* any.Pack(foo)
|
|
46
|
-
* ...
|
|
47
|
-
* if any.Is(Foo.DESCRIPTOR):
|
|
48
|
-
* any.Unpack(foo)
|
|
49
|
-
* ...
|
|
50
|
-
*
|
|
51
|
-
* Example 4: Pack and unpack a message in Go
|
|
52
|
-
*
|
|
53
|
-
* foo := &pb.Foo{...}
|
|
54
|
-
* any, err := anypb.New(foo)
|
|
55
|
-
* if err != nil {
|
|
56
|
-
* ...
|
|
57
|
-
* }
|
|
58
|
-
* ...
|
|
59
|
-
* foo := &pb.Foo{}
|
|
60
|
-
* if err := any.UnmarshalTo(foo); err != nil {
|
|
61
|
-
* ...
|
|
62
|
-
* }
|
|
63
|
-
*
|
|
64
|
-
* The pack methods provided by protobuf library will by default use
|
|
65
|
-
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
66
|
-
* methods only use the fully qualified type name after the last '/'
|
|
67
|
-
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
68
|
-
* name "y.z".
|
|
69
|
-
*
|
|
70
|
-
* JSON
|
|
71
|
-
* ====
|
|
72
|
-
* The JSON representation of an `Any` value uses the regular
|
|
73
|
-
* representation of the deserialized, embedded message, with an
|
|
74
|
-
* additional field `@type` which contains the type URL. Example:
|
|
75
|
-
*
|
|
76
|
-
* package google.profile;
|
|
77
|
-
* message Person {
|
|
78
|
-
* string first_name = 1;
|
|
79
|
-
* string last_name = 2;
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* {
|
|
83
|
-
* "@type": "type.googleapis.com/google.profile.Person",
|
|
84
|
-
* "firstName": <string>,
|
|
85
|
-
* "lastName": <string>
|
|
86
|
-
* }
|
|
87
|
-
*
|
|
88
|
-
* If the embedded message type is well-known and has a custom JSON
|
|
89
|
-
* representation, that representation will be embedded adding a field
|
|
90
|
-
* `value` which holds the custom JSON in addition to the `@type`
|
|
91
|
-
* field. Example (for message [google.protobuf.Duration][]):
|
|
92
|
-
*
|
|
93
|
-
* {
|
|
94
|
-
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
95
|
-
* "value": "1.212s"
|
|
96
|
-
* }
|
|
97
|
-
*/
|
|
98
|
-
export interface Any {
|
|
99
|
-
/**
|
|
100
|
-
* A URL/resource name that uniquely identifies the type of the serialized
|
|
101
|
-
* protocol buffer message. This string must contain at least
|
|
102
|
-
* one "/" character. The last segment of the URL's path must represent
|
|
103
|
-
* the fully qualified name of the type (as in
|
|
104
|
-
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
105
|
-
* (e.g., leading "." is not accepted).
|
|
106
|
-
*
|
|
107
|
-
* In practice, teams usually precompile into the binary all types that they
|
|
108
|
-
* expect it to use in the context of Any. However, for URLs which use the
|
|
109
|
-
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
110
|
-
* server that maps type URLs to message definitions as follows:
|
|
111
|
-
*
|
|
112
|
-
* * If no scheme is provided, `https` is assumed.
|
|
113
|
-
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
|
114
|
-
* value in binary format, or produce an error.
|
|
115
|
-
* * Applications are allowed to cache lookup results based on the
|
|
116
|
-
* URL, or have them precompiled into a binary to avoid any
|
|
117
|
-
* lookup. Therefore, binary compatibility needs to be preserved
|
|
118
|
-
* on changes to types. (Use versioned type names to manage
|
|
119
|
-
* breaking changes.)
|
|
120
|
-
*
|
|
121
|
-
* Note: this functionality is not currently available in the official
|
|
122
|
-
* protobuf release, and it is not used for type URLs beginning with
|
|
123
|
-
* type.googleapis.com. As of May 2023, there are no widely used type server
|
|
124
|
-
* implementations and no plans to implement one.
|
|
125
|
-
*
|
|
126
|
-
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
127
|
-
* used with implementation specific semantics.
|
|
128
|
-
*/
|
|
129
|
-
typeUrl: string;
|
|
130
|
-
/** Must be a valid serialized protocol buffer of the above specified type. */
|
|
131
|
-
value: Uint8Array;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: google/protobuf/any.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
13
|
+
* URL that describes the type of the serialized message.
|
|
14
|
+
*
|
|
15
|
+
* Protobuf library provides support to pack/unpack Any values in the form
|
|
16
|
+
* of utility functions or additional generated methods of the Any type.
|
|
17
|
+
*
|
|
18
|
+
* Example 1: Pack and unpack a message in C++.
|
|
19
|
+
*
|
|
20
|
+
* Foo foo = ...;
|
|
21
|
+
* Any any;
|
|
22
|
+
* any.PackFrom(foo);
|
|
23
|
+
* ...
|
|
24
|
+
* if (any.UnpackTo(&foo)) {
|
|
25
|
+
* ...
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* Example 2: Pack and unpack a message in Java.
|
|
29
|
+
*
|
|
30
|
+
* Foo foo = ...;
|
|
31
|
+
* Any any = Any.pack(foo);
|
|
32
|
+
* ...
|
|
33
|
+
* if (any.is(Foo.class)) {
|
|
34
|
+
* foo = any.unpack(Foo.class);
|
|
35
|
+
* }
|
|
36
|
+
* // or ...
|
|
37
|
+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
38
|
+
* foo = any.unpack(Foo.getDefaultInstance());
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* Example 3: Pack and unpack a message in Python.
|
|
42
|
+
*
|
|
43
|
+
* foo = Foo(...)
|
|
44
|
+
* any = Any()
|
|
45
|
+
* any.Pack(foo)
|
|
46
|
+
* ...
|
|
47
|
+
* if any.Is(Foo.DESCRIPTOR):
|
|
48
|
+
* any.Unpack(foo)
|
|
49
|
+
* ...
|
|
50
|
+
*
|
|
51
|
+
* Example 4: Pack and unpack a message in Go
|
|
52
|
+
*
|
|
53
|
+
* foo := &pb.Foo{...}
|
|
54
|
+
* any, err := anypb.New(foo)
|
|
55
|
+
* if err != nil {
|
|
56
|
+
* ...
|
|
57
|
+
* }
|
|
58
|
+
* ...
|
|
59
|
+
* foo := &pb.Foo{}
|
|
60
|
+
* if err := any.UnmarshalTo(foo); err != nil {
|
|
61
|
+
* ...
|
|
62
|
+
* }
|
|
63
|
+
*
|
|
64
|
+
* The pack methods provided by protobuf library will by default use
|
|
65
|
+
* 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
|
66
|
+
* methods only use the fully qualified type name after the last '/'
|
|
67
|
+
* in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
|
68
|
+
* name "y.z".
|
|
69
|
+
*
|
|
70
|
+
* JSON
|
|
71
|
+
* ====
|
|
72
|
+
* The JSON representation of an `Any` value uses the regular
|
|
73
|
+
* representation of the deserialized, embedded message, with an
|
|
74
|
+
* additional field `@type` which contains the type URL. Example:
|
|
75
|
+
*
|
|
76
|
+
* package google.profile;
|
|
77
|
+
* message Person {
|
|
78
|
+
* string first_name = 1;
|
|
79
|
+
* string last_name = 2;
|
|
80
|
+
* }
|
|
81
|
+
*
|
|
82
|
+
* {
|
|
83
|
+
* "@type": "type.googleapis.com/google.profile.Person",
|
|
84
|
+
* "firstName": <string>,
|
|
85
|
+
* "lastName": <string>
|
|
86
|
+
* }
|
|
87
|
+
*
|
|
88
|
+
* If the embedded message type is well-known and has a custom JSON
|
|
89
|
+
* representation, that representation will be embedded adding a field
|
|
90
|
+
* `value` which holds the custom JSON in addition to the `@type`
|
|
91
|
+
* field. Example (for message [google.protobuf.Duration][]):
|
|
92
|
+
*
|
|
93
|
+
* {
|
|
94
|
+
* "@type": "type.googleapis.com/google.protobuf.Duration",
|
|
95
|
+
* "value": "1.212s"
|
|
96
|
+
* }
|
|
97
|
+
*/
|
|
98
|
+
export interface Any {
|
|
99
|
+
/**
|
|
100
|
+
* A URL/resource name that uniquely identifies the type of the serialized
|
|
101
|
+
* protocol buffer message. This string must contain at least
|
|
102
|
+
* one "/" character. The last segment of the URL's path must represent
|
|
103
|
+
* the fully qualified name of the type (as in
|
|
104
|
+
* `path/google.protobuf.Duration`). The name should be in a canonical form
|
|
105
|
+
* (e.g., leading "." is not accepted).
|
|
106
|
+
*
|
|
107
|
+
* In practice, teams usually precompile into the binary all types that they
|
|
108
|
+
* expect it to use in the context of Any. However, for URLs which use the
|
|
109
|
+
* scheme `http`, `https`, or no scheme, one can optionally set up a type
|
|
110
|
+
* server that maps type URLs to message definitions as follows:
|
|
111
|
+
*
|
|
112
|
+
* * If no scheme is provided, `https` is assumed.
|
|
113
|
+
* * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
|
114
|
+
* value in binary format, or produce an error.
|
|
115
|
+
* * Applications are allowed to cache lookup results based on the
|
|
116
|
+
* URL, or have them precompiled into a binary to avoid any
|
|
117
|
+
* lookup. Therefore, binary compatibility needs to be preserved
|
|
118
|
+
* on changes to types. (Use versioned type names to manage
|
|
119
|
+
* breaking changes.)
|
|
120
|
+
*
|
|
121
|
+
* Note: this functionality is not currently available in the official
|
|
122
|
+
* protobuf release, and it is not used for type URLs beginning with
|
|
123
|
+
* type.googleapis.com. As of May 2023, there are no widely used type server
|
|
124
|
+
* implementations and no plans to implement one.
|
|
125
|
+
*
|
|
126
|
+
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
127
|
+
* used with implementation specific semantics.
|
|
128
|
+
*/
|
|
129
|
+
typeUrl: string;
|
|
130
|
+
/** Must be a valid serialized protocol buffer of the above specified type. */
|
|
131
|
+
value: Uint8Array;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.2
|
|
4
|
-
// protoc v6.33.
|
|
5
|
-
// source: google/protobuf/duration.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A Duration represents a signed, fixed-length span of time represented
|
|
13
|
-
* as a count of seconds and fractions of seconds at nanosecond
|
|
14
|
-
* resolution. It is independent of any calendar and concepts like "day"
|
|
15
|
-
* or "month". It is related to Timestamp in that the difference between
|
|
16
|
-
* two Timestamp values is a Duration and it can be added or subtracted
|
|
17
|
-
* from a Timestamp. Range is approximately +-10,000 years.
|
|
18
|
-
*
|
|
19
|
-
* # Examples
|
|
20
|
-
*
|
|
21
|
-
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
22
|
-
*
|
|
23
|
-
* Timestamp start = ...;
|
|
24
|
-
* Timestamp end = ...;
|
|
25
|
-
* Duration duration = ...;
|
|
26
|
-
*
|
|
27
|
-
* duration.seconds = end.seconds - start.seconds;
|
|
28
|
-
* duration.nanos = end.nanos - start.nanos;
|
|
29
|
-
*
|
|
30
|
-
* if (duration.seconds < 0 && duration.nanos > 0) {
|
|
31
|
-
* duration.seconds += 1;
|
|
32
|
-
* duration.nanos -= 1000000000;
|
|
33
|
-
* } else if (duration.seconds > 0 && duration.nanos < 0) {
|
|
34
|
-
* duration.seconds -= 1;
|
|
35
|
-
* duration.nanos += 1000000000;
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
38
|
-
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
39
|
-
*
|
|
40
|
-
* Timestamp start = ...;
|
|
41
|
-
* Duration duration = ...;
|
|
42
|
-
* Timestamp end = ...;
|
|
43
|
-
*
|
|
44
|
-
* end.seconds = start.seconds + duration.seconds;
|
|
45
|
-
* end.nanos = start.nanos + duration.nanos;
|
|
46
|
-
*
|
|
47
|
-
* if (end.nanos < 0) {
|
|
48
|
-
* end.seconds -= 1;
|
|
49
|
-
* end.nanos += 1000000000;
|
|
50
|
-
* } else if (end.nanos >= 1000000000) {
|
|
51
|
-
* end.seconds += 1;
|
|
52
|
-
* end.nanos -= 1000000000;
|
|
53
|
-
* }
|
|
54
|
-
*
|
|
55
|
-
* Example 3: Compute Duration from datetime.timedelta in Python.
|
|
56
|
-
*
|
|
57
|
-
* td = datetime.timedelta(days=3, minutes=10)
|
|
58
|
-
* duration = Duration()
|
|
59
|
-
* duration.FromTimedelta(td)
|
|
60
|
-
*
|
|
61
|
-
* # JSON Mapping
|
|
62
|
-
*
|
|
63
|
-
* In JSON format, the Duration type is encoded as a string rather than an
|
|
64
|
-
* object, where the string ends in the suffix "s" (indicating seconds) and
|
|
65
|
-
* is preceded by the number of seconds, with nanoseconds expressed as
|
|
66
|
-
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
67
|
-
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
68
|
-
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
69
|
-
* microsecond should be expressed in JSON format as "3.000001s".
|
|
70
|
-
*/
|
|
71
|
-
export interface Duration {
|
|
72
|
-
/**
|
|
73
|
-
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
74
|
-
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
75
|
-
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
76
|
-
*/
|
|
77
|
-
seconds: number;
|
|
78
|
-
/**
|
|
79
|
-
* Signed fractions of a second at nanosecond resolution of the span
|
|
80
|
-
* of time. Durations less than one second are represented with a 0
|
|
81
|
-
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
82
|
-
* of one second or more, a non-zero value for the `nanos` field must be
|
|
83
|
-
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
84
|
-
* to +999,999,999 inclusive.
|
|
85
|
-
*/
|
|
86
|
-
nanos: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: google/protobuf/duration.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A Duration represents a signed, fixed-length span of time represented
|
|
13
|
+
* as a count of seconds and fractions of seconds at nanosecond
|
|
14
|
+
* resolution. It is independent of any calendar and concepts like "day"
|
|
15
|
+
* or "month". It is related to Timestamp in that the difference between
|
|
16
|
+
* two Timestamp values is a Duration and it can be added or subtracted
|
|
17
|
+
* from a Timestamp. Range is approximately +-10,000 years.
|
|
18
|
+
*
|
|
19
|
+
* # Examples
|
|
20
|
+
*
|
|
21
|
+
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
22
|
+
*
|
|
23
|
+
* Timestamp start = ...;
|
|
24
|
+
* Timestamp end = ...;
|
|
25
|
+
* Duration duration = ...;
|
|
26
|
+
*
|
|
27
|
+
* duration.seconds = end.seconds - start.seconds;
|
|
28
|
+
* duration.nanos = end.nanos - start.nanos;
|
|
29
|
+
*
|
|
30
|
+
* if (duration.seconds < 0 && duration.nanos > 0) {
|
|
31
|
+
* duration.seconds += 1;
|
|
32
|
+
* duration.nanos -= 1000000000;
|
|
33
|
+
* } else if (duration.seconds > 0 && duration.nanos < 0) {
|
|
34
|
+
* duration.seconds -= 1;
|
|
35
|
+
* duration.nanos += 1000000000;
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
39
|
+
*
|
|
40
|
+
* Timestamp start = ...;
|
|
41
|
+
* Duration duration = ...;
|
|
42
|
+
* Timestamp end = ...;
|
|
43
|
+
*
|
|
44
|
+
* end.seconds = start.seconds + duration.seconds;
|
|
45
|
+
* end.nanos = start.nanos + duration.nanos;
|
|
46
|
+
*
|
|
47
|
+
* if (end.nanos < 0) {
|
|
48
|
+
* end.seconds -= 1;
|
|
49
|
+
* end.nanos += 1000000000;
|
|
50
|
+
* } else if (end.nanos >= 1000000000) {
|
|
51
|
+
* end.seconds += 1;
|
|
52
|
+
* end.nanos -= 1000000000;
|
|
53
|
+
* }
|
|
54
|
+
*
|
|
55
|
+
* Example 3: Compute Duration from datetime.timedelta in Python.
|
|
56
|
+
*
|
|
57
|
+
* td = datetime.timedelta(days=3, minutes=10)
|
|
58
|
+
* duration = Duration()
|
|
59
|
+
* duration.FromTimedelta(td)
|
|
60
|
+
*
|
|
61
|
+
* # JSON Mapping
|
|
62
|
+
*
|
|
63
|
+
* In JSON format, the Duration type is encoded as a string rather than an
|
|
64
|
+
* object, where the string ends in the suffix "s" (indicating seconds) and
|
|
65
|
+
* is preceded by the number of seconds, with nanoseconds expressed as
|
|
66
|
+
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
67
|
+
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
68
|
+
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
69
|
+
* microsecond should be expressed in JSON format as "3.000001s".
|
|
70
|
+
*/
|
|
71
|
+
export interface Duration {
|
|
72
|
+
/**
|
|
73
|
+
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
74
|
+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
75
|
+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
76
|
+
*/
|
|
77
|
+
seconds: number;
|
|
78
|
+
/**
|
|
79
|
+
* Signed fractions of a second at nanosecond resolution of the span
|
|
80
|
+
* of time. Durations less than one second are represented with a 0
|
|
81
|
+
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
82
|
+
* of one second or more, a non-zero value for the `nanos` field must be
|
|
83
|
+
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
84
|
+
* to +999,999,999 inclusive.
|
|
85
|
+
*/
|
|
86
|
+
nanos: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.2
|
|
4
|
-
// protoc v6.33.
|
|
5
|
-
// source: google/protobuf/empty.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* A generic empty message that you can re-use to avoid defining duplicated
|
|
13
|
-
* empty messages in your APIs. A typical example is to use it as the request
|
|
14
|
-
* or the response type of an API method. For instance:
|
|
15
|
-
*
|
|
16
|
-
* service Foo {
|
|
17
|
-
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
18
|
-
* }
|
|
19
|
-
*/
|
|
20
|
-
export interface Empty {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v6.33.5
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
13
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
14
|
+
* or the response type of an API method. For instance:
|
|
15
|
+
*
|
|
16
|
+
* service Foo {
|
|
17
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface Empty {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|