@shock-cinema/contracts 1.0.3 → 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.
package/gen/auth.ts CHANGED
@@ -19,19 +19,34 @@ export interface SendOtpResponse {
19
19
  ok: boolean;
20
20
  }
21
21
 
22
+ export interface VerifyOtpRequest {
23
+ identifier: string;
24
+ type: string;
25
+ code: string;
26
+ }
27
+
28
+ export interface VerifyOtpResponse {
29
+ accessToken: string;
30
+ refreshToken: string;
31
+ }
32
+
22
33
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
23
34
 
24
35
  export interface AuthServiceClient {
25
36
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
+
38
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
26
39
  }
27
40
 
28
41
  export interface AuthServiceController {
29
42
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
+
44
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
30
45
  }
31
46
 
32
47
  export function AuthServiceControllerMethods() {
33
48
  return function (constructor: Function) {
34
- const grpcMethods: string[] = ["sendOtp"];
49
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
35
50
  for (const method of grpcMethods) {
36
51
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
52
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/any.proto
6
6
 
7
7
  /* eslint-disable */
@@ -33,12 +33,8 @@ export const protobufPackage = "google.protobuf";
33
33
  * if (any.is(Foo.class)) {
34
34
  * foo = any.unpack(Foo.class);
35
35
  * }
36
- * // or ...
37
- * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
38
- * foo = any.unpack(Foo.getDefaultInstance());
39
- * }
40
36
  *
41
- * Example 3: Pack and unpack a message in Python.
37
+ * Example 3: Pack and unpack a message in Python.
42
38
  *
43
39
  * foo = Foo(...)
44
40
  * any = Any()
@@ -48,7 +44,7 @@ export const protobufPackage = "google.protobuf";
48
44
  * any.Unpack(foo)
49
45
  * ...
50
46
  *
51
- * Example 4: Pack and unpack a message in Go
47
+ * Example 4: Pack and unpack a message in Go
52
48
  *
53
49
  * foo := &pb.Foo{...}
54
50
  * any, err := anypb.New(foo)
@@ -68,7 +64,7 @@ export const protobufPackage = "google.protobuf";
68
64
  * name "y.z".
69
65
  *
70
66
  * JSON
71
- * ====
67
+ *
72
68
  * The JSON representation of an `Any` value uses the regular
73
69
  * representation of the deserialized, embedded message, with an
74
70
  * additional field `@type` which contains the type URL. Example:
@@ -120,8 +116,7 @@ export interface Any {
120
116
  *
121
117
  * Note: this functionality is not currently available in the official
122
118
  * 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.
119
+ * type.googleapis.com.
125
120
  *
126
121
  * Schemes other than `http`, `https` (or the empty scheme) might be
127
122
  * used with implementation specific semantics.
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/duration.proto
6
6
 
7
7
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/empty.proto
6
6
 
7
7
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/struct.proto
6
6
 
7
7
  /* eslint-disable */
@@ -13,7 +13,7 @@ export const protobufPackage = "google.protobuf";
13
13
  * `NullValue` is a singleton enumeration to represent the null value for the
14
14
  * `Value` type union.
15
15
  *
16
- * The JSON representation for `NullValue` is JSON `null`.
16
+ * The JSON representation for `NullValue` is JSON `null`.
17
17
  */
18
18
  export enum NullValue {
19
19
  /** NULL_VALUE - Null value. */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/timestamp.proto
6
6
 
7
7
  /* eslint-disable */
@@ -96,21 +96,20 @@ export const protobufPackage = "google.protobuf";
96
96
  * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
97
97
  * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
98
98
  * the Joda Time's [`ISODateTimeFormat.dateTime()`](
99
- * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
99
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
100
100
  * ) to obtain a formatter capable of generating timestamps in this format.
101
101
  */
102
102
  export interface Timestamp {
103
103
  /**
104
- * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
105
- * be between -315576000000 and 315576000000 inclusive (which corresponds to
106
- * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
104
+ * Represents seconds of UTC time since Unix epoch
105
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
106
+ * 9999-12-31T23:59:59Z inclusive.
107
107
  */
108
108
  seconds: number;
109
109
  /**
110
- * Non-negative fractions of a second at nanosecond resolution. This field is
111
- * the nanosecond portion of the duration, not an alternative to seconds.
112
- * Negative second values with fractions must still have non-negative nanos
113
- * values that count forward in time. Must be between 0 and 999,999,999
110
+ * Non-negative fractions of a second at nanosecond resolution. Negative
111
+ * second values with fractions must still have non-negative nanos values
112
+ * that count forward in time. Must be from 0 to 999,999,999
114
113
  * inclusive.
115
114
  */
116
115
  nanos: number;
package/gen/test.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: test.proto
6
6
 
7
7
  /* eslint-disable */
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@shock-cinema/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
5
7
  "scripts": {
8
+ "build": "tsc -p tsconfig.build.json",
6
9
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
10
  },
8
11
  "files": [
@@ -16,5 +19,9 @@
16
19
  "@nestjs/microservices": "^11.1.11",
17
20
  "rxjs": "^7.8.2",
18
21
  "ts-proto": "^2.8.3"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^25.0.3",
25
+ "typescript": "^5.9.3"
19
26
  }
20
27
  }
package/proto/auth.proto CHANGED
@@ -4,6 +4,7 @@ package auth.v1;
4
4
 
5
5
  service AuthService {
6
6
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
7
8
  }
8
9
 
9
10
  message SendOtpRequest {
@@ -13,4 +14,15 @@ message SendOtpRequest {
13
14
 
14
15
  message SendOtpResponse {
15
16
  bool ok = 1;
17
+ }
18
+
19
+ message VerifyOtpRequest {
20
+ string identifier = 1;
21
+ string type = 2;
22
+ string code = 3;
23
+ }
24
+
25
+ message VerifyOtpResponse {
26
+ string access_token = 1;
27
+ string refresh_token = 2;
16
28
  }
@@ -0,0 +1,43 @@
1
+ syntax = "proto3";
2
+
3
+ package test.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+ import "google/protobuf/duration.proto";
8
+ import "google/protobuf/struct.proto";
9
+ import "google/protobuf/any.proto";
10
+
11
+ service TestService {
12
+ rpc Ping (google.protobuf.Empty) returns (PingResponse);
13
+ }
14
+
15
+ message PingResponse {
16
+
17
+ }
18
+
19
+ message UserSession {
20
+ string id = 1;
21
+ google.protobuf.Timestamp created_at = 2;
22
+ google.protobuf.Duration duration = 3;
23
+ }
24
+
25
+ message UserProfile {
26
+ string id = 1;
27
+ int32 age = 2;
28
+ double rating = 3;
29
+ bool verified = 4;
30
+ repeated string roles = 5;
31
+ map<string, string> meta = 6;
32
+ Status status = 7;
33
+ oneof contact {
34
+ string phone = 8;
35
+ string email = 9;
36
+ }
37
+ }
38
+
39
+ enum Status {
40
+ STATUS_UNKNOWN = 0;
41
+ STATUS_ACTIVE = 1;
42
+ STATUS_BANNED = 2;
43
+ }