@sa2-movie-ticket/testing 1.0.2 → 1.0.3

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.
@@ -4,120 +4,52 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - main
7
- workflow_dispatch:
8
7
 
9
8
  permissions:
10
9
  contents: write
11
10
 
12
11
  jobs:
13
- generate-and-publish:
12
+ publish:
14
13
  runs-on: ubuntu-latest
15
14
 
16
15
  steps:
17
- # ---------------------------
18
- # Checkout
19
- # ---------------------------
20
- - name: Checkout Repo
21
- uses: actions/checkout@v4
22
- with:
23
- fetch-depth: 0
16
+ - uses: actions/checkout@v4
24
17
 
25
- # ---------------------------
26
- # Setup Node (for npm publish)
27
- # ---------------------------
28
- - name: Setup Node
29
- uses: actions/setup-node@v4
18
+ - uses: actions/setup-node@v4
30
19
  with:
31
20
  node-version: 20
32
21
  registry-url: https://registry.npmjs.org/
33
22
 
34
- # ---------------------------
35
- # Setup Bun
36
- # ---------------------------
37
- - name: Setup Bun
38
- uses: oven-sh/setup-bun@v2
23
+ - uses: oven-sh/setup-bun@v2
39
24
  with:
40
25
  bun-version: latest
41
26
 
42
- # ---------------------------
43
- # Setup Go
44
- # ---------------------------
45
- - name: Setup Go
46
- uses: actions/setup-go@v5
27
+ - uses: actions/setup-go@v5
47
28
  with:
48
29
  go-version: "1.22"
49
30
 
50
- # ---------------------------
51
- # Install protoc
52
- # ---------------------------
53
31
  - name: Install Protoc
54
32
  run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
55
33
 
56
- # ---------------------------
57
- # Install Go protoc plugins
58
- # ---------------------------
59
- - name: Install Go Protobuf Plugins
34
+ - name: Install Go Plugins
60
35
  run: |
61
36
  go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
62
37
  go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
63
38
  echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
64
39
 
65
- # ---------------------------
66
- # Install dependencies (ts-proto local)
67
- # ---------------------------
68
40
  - name: Install Dependencies
69
41
  run: bun install --frozen-lockfile
70
42
 
71
- # ---------------------------
72
- # Create output folders
73
- # ---------------------------
74
- - name: Prepare Output Directories
75
- run: mkdir -p gen/ts gen/go
76
-
77
- # ---------------------------
78
- # Generate TS + Go code
79
- # ---------------------------
80
43
  - name: Generate Code
81
44
  run: bun run gen
82
45
 
83
- # ---------------------------
84
- # Build TS package (if needed)
85
- # ---------------------------
86
46
  # - name: Build
87
47
  # run: bun run build
88
48
 
89
- # ---------------------------
90
- # Configure Git
91
- # ---------------------------
92
- - name: Configure Git
93
- run: |
94
- git config user.name "github-actions"
95
- git config user.email "github-actions@github.com"
49
+ - name: Bump Version
50
+ run: npm version patch --no-git-tag-version
96
51
 
97
- # ---------------------------
98
- # Commit generated files (optional but recommended)
99
- # ---------------------------
100
- - name: Commit Generated Code
101
- run: |
102
- git add gen
103
- git diff --cached --quiet || git commit -m "chore: update generated code"
104
-
105
- # ---------------------------
106
- # Bump version
107
- # ---------------------------
108
- # - name: Bump Version
109
- # run: npm version patch -m "chore: bump version to %s"
110
-
111
- # ---------------------------
112
- # Push changes & tags
113
- # ---------------------------
114
- - name: Push Changes
115
- run: git push --follow-tags
116
-
117
- # ---------------------------
118
- # Publish to npm
119
- # ---------------------------
120
- - name: Publish Package
52
+ - name: Publish
121
53
  run: npm publish --access public
122
54
  env:
123
55
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -142,57 +74,113 @@ jobs:
142
74
  # runs-on: ubuntu-latest
143
75
 
144
76
  # steps:
77
+ # # ---------------------------
78
+ # # Checkout
79
+ # # ---------------------------
145
80
  # - name: Checkout Repo
146
81
  # uses: actions/checkout@v4
147
82
  # with:
148
83
  # fetch-depth: 0
149
84
 
150
- # # Setup Node (needed for npm publish)
85
+ # # ---------------------------
86
+ # # Setup Node (for npm publish)
87
+ # # ---------------------------
151
88
  # - name: Setup Node
152
89
  # uses: actions/setup-node@v4
153
90
  # with:
154
91
  # node-version: 20
155
92
  # registry-url: https://registry.npmjs.org/
156
93
 
94
+ # # ---------------------------
157
95
  # # Setup Bun
96
+ # # ---------------------------
158
97
  # - name: Setup Bun
159
98
  # uses: oven-sh/setup-bun@v2
160
99
  # with:
161
100
  # bun-version: latest
162
101
 
102
+ # # ---------------------------
103
+ # # Setup Go
104
+ # # ---------------------------
105
+ # - name: Setup Go
106
+ # uses: actions/setup-go@v5
107
+ # with:
108
+ # go-version: "1.22"
109
+
110
+ # # ---------------------------
163
111
  # # Install protoc
112
+ # # ---------------------------
164
113
  # - name: Install Protoc
165
114
  # run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
166
115
 
167
- # # Install dependencies
116
+ # # ---------------------------
117
+ # # Install Go protoc plugins
118
+ # # ---------------------------
119
+ # - name: Install Go Protobuf Plugins
120
+ # run: |
121
+ # go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
122
+ # go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
123
+ # echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
124
+
125
+ # # ---------------------------
126
+ # # Install dependencies (ts-proto local)
127
+ # # ---------------------------
168
128
  # - name: Install Dependencies
169
129
  # run: bun install --frozen-lockfile
170
130
 
171
- # # Generate TypeScript from proto
131
+ # # ---------------------------
132
+ # # Create output folders
133
+ # # ---------------------------
134
+ # - name: Prepare Output Directories
135
+ # run: mkdir -p gen/ts gen/go
136
+
137
+ # # ---------------------------
138
+ # # Generate TS + Go code
139
+ # # ---------------------------
172
140
  # - name: Generate Code
173
- # run: bun run generate
141
+ # run: bun run gen
174
142
 
175
- # # Build (ONLY if your package needs dist output)
143
+ # # ---------------------------
144
+ # # Build TS package (if needed)
145
+ # # ---------------------------
176
146
  # # - name: Build
177
147
  # # run: bun run build
178
148
 
179
- # # Configure git
149
+ # # ---------------------------
150
+ # # Configure Git
151
+ # # ---------------------------
180
152
  # - name: Configure Git
181
153
  # run: |
182
154
  # git config user.name "github-actions"
183
155
  # git config user.email "github-actions@github.com"
184
156
 
185
- # # Bump version + commit
186
- # - name: Bump Version
157
+ # # ---------------------------
158
+ # # Commit generated files (optional but recommended)
159
+ # # ---------------------------
160
+ # - name: Commit Generated Code
187
161
  # run: |
188
- # npm version patch -m "chore: bump version to %s"
189
-
190
- # # Push version commit
162
+ # git add gen
163
+ # git diff --cached --quiet || git commit -m "chore: update generated code"
164
+
165
+ # # ---------------------------
166
+ # # Bump version
167
+ # # ---------------------------
168
+ # # - name: Bump Version
169
+ # # run: npm version patch -m "chore: bump version to %s"
170
+
171
+ # # ---------------------------
172
+ # # Push changes & tags
173
+ # # ---------------------------
191
174
  # - name: Push Changes
192
175
  # run: git push --follow-tags
193
176
 
177
+ # # ---------------------------
194
178
  # # Publish to npm
179
+ # # ---------------------------
195
180
  # - name: Publish Package
196
181
  # run: npm publish --access public
197
182
  # env:
198
183
  # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
184
+
185
+
186
+
@@ -0,0 +1,310 @@
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-go v1.36.11
4
+ // protoc v3.21.12
5
+ // source: proto/auth.proto
6
+
7
+ package contracts
8
+
9
+ import (
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ reflect "reflect"
13
+ sync "sync"
14
+ unsafe "unsafe"
15
+ )
16
+
17
+ const (
18
+ // Verify that this generated code is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
20
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
21
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
22
+ )
23
+
24
+ type SendOtpRequest struct {
25
+ state protoimpl.MessageState `protogen:"open.v1"`
26
+ Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
27
+ Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
28
+ unknownFields protoimpl.UnknownFields
29
+ sizeCache protoimpl.SizeCache
30
+ }
31
+
32
+ func (x *SendOtpRequest) Reset() {
33
+ *x = SendOtpRequest{}
34
+ mi := &file_proto_auth_proto_msgTypes[0]
35
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
36
+ ms.StoreMessageInfo(mi)
37
+ }
38
+
39
+ func (x *SendOtpRequest) String() string {
40
+ return protoimpl.X.MessageStringOf(x)
41
+ }
42
+
43
+ func (*SendOtpRequest) ProtoMessage() {}
44
+
45
+ func (x *SendOtpRequest) ProtoReflect() protoreflect.Message {
46
+ mi := &file_proto_auth_proto_msgTypes[0]
47
+ if x != nil {
48
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
49
+ if ms.LoadMessageInfo() == nil {
50
+ ms.StoreMessageInfo(mi)
51
+ }
52
+ return ms
53
+ }
54
+ return mi.MessageOf(x)
55
+ }
56
+
57
+ // Deprecated: Use SendOtpRequest.ProtoReflect.Descriptor instead.
58
+ func (*SendOtpRequest) Descriptor() ([]byte, []int) {
59
+ return file_proto_auth_proto_rawDescGZIP(), []int{0}
60
+ }
61
+
62
+ func (x *SendOtpRequest) GetIdentifier() string {
63
+ if x != nil {
64
+ return x.Identifier
65
+ }
66
+ return ""
67
+ }
68
+
69
+ func (x *SendOtpRequest) GetType() string {
70
+ if x != nil {
71
+ return x.Type
72
+ }
73
+ return ""
74
+ }
75
+
76
+ type SendOtpResponse struct {
77
+ state protoimpl.MessageState `protogen:"open.v1"`
78
+ Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
79
+ unknownFields protoimpl.UnknownFields
80
+ sizeCache protoimpl.SizeCache
81
+ }
82
+
83
+ func (x *SendOtpResponse) Reset() {
84
+ *x = SendOtpResponse{}
85
+ mi := &file_proto_auth_proto_msgTypes[1]
86
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
87
+ ms.StoreMessageInfo(mi)
88
+ }
89
+
90
+ func (x *SendOtpResponse) String() string {
91
+ return protoimpl.X.MessageStringOf(x)
92
+ }
93
+
94
+ func (*SendOtpResponse) ProtoMessage() {}
95
+
96
+ func (x *SendOtpResponse) ProtoReflect() protoreflect.Message {
97
+ mi := &file_proto_auth_proto_msgTypes[1]
98
+ if x != nil {
99
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
100
+ if ms.LoadMessageInfo() == nil {
101
+ ms.StoreMessageInfo(mi)
102
+ }
103
+ return ms
104
+ }
105
+ return mi.MessageOf(x)
106
+ }
107
+
108
+ // Deprecated: Use SendOtpResponse.ProtoReflect.Descriptor instead.
109
+ func (*SendOtpResponse) Descriptor() ([]byte, []int) {
110
+ return file_proto_auth_proto_rawDescGZIP(), []int{1}
111
+ }
112
+
113
+ func (x *SendOtpResponse) GetOk() bool {
114
+ if x != nil {
115
+ return x.Ok
116
+ }
117
+ return false
118
+ }
119
+
120
+ type VerifyOtpRequest struct {
121
+ state protoimpl.MessageState `protogen:"open.v1"`
122
+ Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
123
+ Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
124
+ Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
125
+ unknownFields protoimpl.UnknownFields
126
+ sizeCache protoimpl.SizeCache
127
+ }
128
+
129
+ func (x *VerifyOtpRequest) Reset() {
130
+ *x = VerifyOtpRequest{}
131
+ mi := &file_proto_auth_proto_msgTypes[2]
132
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
133
+ ms.StoreMessageInfo(mi)
134
+ }
135
+
136
+ func (x *VerifyOtpRequest) String() string {
137
+ return protoimpl.X.MessageStringOf(x)
138
+ }
139
+
140
+ func (*VerifyOtpRequest) ProtoMessage() {}
141
+
142
+ func (x *VerifyOtpRequest) ProtoReflect() protoreflect.Message {
143
+ mi := &file_proto_auth_proto_msgTypes[2]
144
+ if x != nil {
145
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
146
+ if ms.LoadMessageInfo() == nil {
147
+ ms.StoreMessageInfo(mi)
148
+ }
149
+ return ms
150
+ }
151
+ return mi.MessageOf(x)
152
+ }
153
+
154
+ // Deprecated: Use VerifyOtpRequest.ProtoReflect.Descriptor instead.
155
+ func (*VerifyOtpRequest) Descriptor() ([]byte, []int) {
156
+ return file_proto_auth_proto_rawDescGZIP(), []int{2}
157
+ }
158
+
159
+ func (x *VerifyOtpRequest) GetIdentifier() string {
160
+ if x != nil {
161
+ return x.Identifier
162
+ }
163
+ return ""
164
+ }
165
+
166
+ func (x *VerifyOtpRequest) GetType() string {
167
+ if x != nil {
168
+ return x.Type
169
+ }
170
+ return ""
171
+ }
172
+
173
+ func (x *VerifyOtpRequest) GetCode() string {
174
+ if x != nil {
175
+ return x.Code
176
+ }
177
+ return ""
178
+ }
179
+
180
+ type VerifyOtpResponse struct {
181
+ state protoimpl.MessageState `protogen:"open.v1"`
182
+ AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
183
+ RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
184
+ unknownFields protoimpl.UnknownFields
185
+ sizeCache protoimpl.SizeCache
186
+ }
187
+
188
+ func (x *VerifyOtpResponse) Reset() {
189
+ *x = VerifyOtpResponse{}
190
+ mi := &file_proto_auth_proto_msgTypes[3]
191
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
192
+ ms.StoreMessageInfo(mi)
193
+ }
194
+
195
+ func (x *VerifyOtpResponse) String() string {
196
+ return protoimpl.X.MessageStringOf(x)
197
+ }
198
+
199
+ func (*VerifyOtpResponse) ProtoMessage() {}
200
+
201
+ func (x *VerifyOtpResponse) ProtoReflect() protoreflect.Message {
202
+ mi := &file_proto_auth_proto_msgTypes[3]
203
+ if x != nil {
204
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
205
+ if ms.LoadMessageInfo() == nil {
206
+ ms.StoreMessageInfo(mi)
207
+ }
208
+ return ms
209
+ }
210
+ return mi.MessageOf(x)
211
+ }
212
+
213
+ // Deprecated: Use VerifyOtpResponse.ProtoReflect.Descriptor instead.
214
+ func (*VerifyOtpResponse) Descriptor() ([]byte, []int) {
215
+ return file_proto_auth_proto_rawDescGZIP(), []int{3}
216
+ }
217
+
218
+ func (x *VerifyOtpResponse) GetAccessToken() string {
219
+ if x != nil {
220
+ return x.AccessToken
221
+ }
222
+ return ""
223
+ }
224
+
225
+ func (x *VerifyOtpResponse) GetRefreshToken() string {
226
+ if x != nil {
227
+ return x.RefreshToken
228
+ }
229
+ return ""
230
+ }
231
+
232
+ var File_proto_auth_proto protoreflect.FileDescriptor
233
+
234
+ const file_proto_auth_proto_rawDesc = "" +
235
+ "\n" +
236
+ "\x10proto/auth.proto\x12\aauth.v1\"D\n" +
237
+ "\x0eSendOtpRequest\x12\x1e\n" +
238
+ "\n" +
239
+ "identifier\x18\x01 \x01(\tR\n" +
240
+ "identifier\x12\x12\n" +
241
+ "\x04type\x18\x02 \x01(\tR\x04type\"!\n" +
242
+ "\x0fSendOtpResponse\x12\x0e\n" +
243
+ "\x02ok\x18\x01 \x01(\bR\x02ok\"Z\n" +
244
+ "\x10VerifyOtpRequest\x12\x1e\n" +
245
+ "\n" +
246
+ "identifier\x18\x01 \x01(\tR\n" +
247
+ "identifier\x12\x12\n" +
248
+ "\x04type\x18\x02 \x01(\tR\x04type\x12\x12\n" +
249
+ "\x04code\x18\x03 \x01(\tR\x04code\"[\n" +
250
+ "\x11VerifyOtpResponse\x12!\n" +
251
+ "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" +
252
+ "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken2\x8f\x01\n" +
253
+ "\vAuthService\x12<\n" +
254
+ "\aSendOtp\x12\x17.auth.v1.SendOtpRequest\x1a\x18.auth.v1.SendOtpResponse\x12B\n" +
255
+ "\tVerifyOtp\x12\x19.auth.v1.VerifyOtpRequest\x1a\x1a.auth.v1.VerifyOtpResponseB\x14Z\x12./gen/go;contractsb\x06proto3"
256
+
257
+ var (
258
+ file_proto_auth_proto_rawDescOnce sync.Once
259
+ file_proto_auth_proto_rawDescData []byte
260
+ )
261
+
262
+ func file_proto_auth_proto_rawDescGZIP() []byte {
263
+ file_proto_auth_proto_rawDescOnce.Do(func() {
264
+ file_proto_auth_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_auth_proto_rawDesc), len(file_proto_auth_proto_rawDesc)))
265
+ })
266
+ return file_proto_auth_proto_rawDescData
267
+ }
268
+
269
+ var file_proto_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
270
+ var file_proto_auth_proto_goTypes = []any{
271
+ (*SendOtpRequest)(nil), // 0: auth.v1.SendOtpRequest
272
+ (*SendOtpResponse)(nil), // 1: auth.v1.SendOtpResponse
273
+ (*VerifyOtpRequest)(nil), // 2: auth.v1.VerifyOtpRequest
274
+ (*VerifyOtpResponse)(nil), // 3: auth.v1.VerifyOtpResponse
275
+ }
276
+ var file_proto_auth_proto_depIdxs = []int32{
277
+ 0, // 0: auth.v1.AuthService.SendOtp:input_type -> auth.v1.SendOtpRequest
278
+ 2, // 1: auth.v1.AuthService.VerifyOtp:input_type -> auth.v1.VerifyOtpRequest
279
+ 1, // 2: auth.v1.AuthService.SendOtp:output_type -> auth.v1.SendOtpResponse
280
+ 3, // 3: auth.v1.AuthService.VerifyOtp:output_type -> auth.v1.VerifyOtpResponse
281
+ 2, // [2:4] is the sub-list for method output_type
282
+ 0, // [0:2] is the sub-list for method input_type
283
+ 0, // [0:0] is the sub-list for extension type_name
284
+ 0, // [0:0] is the sub-list for extension extendee
285
+ 0, // [0:0] is the sub-list for field type_name
286
+ }
287
+
288
+ func init() { file_proto_auth_proto_init() }
289
+ func file_proto_auth_proto_init() {
290
+ if File_proto_auth_proto != nil {
291
+ return
292
+ }
293
+ type x struct{}
294
+ out := protoimpl.TypeBuilder{
295
+ File: protoimpl.DescBuilder{
296
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
297
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_auth_proto_rawDesc), len(file_proto_auth_proto_rawDesc)),
298
+ NumEnums: 0,
299
+ NumMessages: 4,
300
+ NumExtensions: 0,
301
+ NumServices: 1,
302
+ },
303
+ GoTypes: file_proto_auth_proto_goTypes,
304
+ DependencyIndexes: file_proto_auth_proto_depIdxs,
305
+ MessageInfos: file_proto_auth_proto_msgTypes,
306
+ }.Build()
307
+ File_proto_auth_proto = out.File
308
+ file_proto_auth_proto_goTypes = nil
309
+ file_proto_auth_proto_depIdxs = nil
310
+ }
@@ -0,0 +1,159 @@
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+ // versions:
3
+ // - protoc-gen-go-grpc v1.6.1
4
+ // - protoc v3.21.12
5
+ // source: proto/auth.proto
6
+
7
+ package contracts
8
+
9
+ import (
10
+ context "context"
11
+ grpc "google.golang.org/grpc"
12
+ codes "google.golang.org/grpc/codes"
13
+ status "google.golang.org/grpc/status"
14
+ )
15
+
16
+ // This is a compile-time assertion to ensure that this generated file
17
+ // is compatible with the grpc package it is being compiled against.
18
+ // Requires gRPC-Go v1.64.0 or later.
19
+ const _ = grpc.SupportPackageIsVersion9
20
+
21
+ const (
22
+ AuthService_SendOtp_FullMethodName = "/auth.v1.AuthService/SendOtp"
23
+ AuthService_VerifyOtp_FullMethodName = "/auth.v1.AuthService/VerifyOtp"
24
+ )
25
+
26
+ // AuthServiceClient is the client API for AuthService service.
27
+ //
28
+ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
29
+ type AuthServiceClient interface {
30
+ SendOtp(ctx context.Context, in *SendOtpRequest, opts ...grpc.CallOption) (*SendOtpResponse, error)
31
+ VerifyOtp(ctx context.Context, in *VerifyOtpRequest, opts ...grpc.CallOption) (*VerifyOtpResponse, error)
32
+ }
33
+
34
+ type authServiceClient struct {
35
+ cc grpc.ClientConnInterface
36
+ }
37
+
38
+ func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
39
+ return &authServiceClient{cc}
40
+ }
41
+
42
+ func (c *authServiceClient) SendOtp(ctx context.Context, in *SendOtpRequest, opts ...grpc.CallOption) (*SendOtpResponse, error) {
43
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
44
+ out := new(SendOtpResponse)
45
+ err := c.cc.Invoke(ctx, AuthService_SendOtp_FullMethodName, in, out, cOpts...)
46
+ if err != nil {
47
+ return nil, err
48
+ }
49
+ return out, nil
50
+ }
51
+
52
+ func (c *authServiceClient) VerifyOtp(ctx context.Context, in *VerifyOtpRequest, opts ...grpc.CallOption) (*VerifyOtpResponse, error) {
53
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
54
+ out := new(VerifyOtpResponse)
55
+ err := c.cc.Invoke(ctx, AuthService_VerifyOtp_FullMethodName, in, out, cOpts...)
56
+ if err != nil {
57
+ return nil, err
58
+ }
59
+ return out, nil
60
+ }
61
+
62
+ // AuthServiceServer is the server API for AuthService service.
63
+ // All implementations must embed UnimplementedAuthServiceServer
64
+ // for forward compatibility.
65
+ type AuthServiceServer interface {
66
+ SendOtp(context.Context, *SendOtpRequest) (*SendOtpResponse, error)
67
+ VerifyOtp(context.Context, *VerifyOtpRequest) (*VerifyOtpResponse, error)
68
+ mustEmbedUnimplementedAuthServiceServer()
69
+ }
70
+
71
+ // UnimplementedAuthServiceServer must be embedded to have
72
+ // forward compatible implementations.
73
+ //
74
+ // NOTE: this should be embedded by value instead of pointer to avoid a nil
75
+ // pointer dereference when methods are called.
76
+ type UnimplementedAuthServiceServer struct{}
77
+
78
+ func (UnimplementedAuthServiceServer) SendOtp(context.Context, *SendOtpRequest) (*SendOtpResponse, error) {
79
+ return nil, status.Error(codes.Unimplemented, "method SendOtp not implemented")
80
+ }
81
+ func (UnimplementedAuthServiceServer) VerifyOtp(context.Context, *VerifyOtpRequest) (*VerifyOtpResponse, error) {
82
+ return nil, status.Error(codes.Unimplemented, "method VerifyOtp not implemented")
83
+ }
84
+ func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
85
+ func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
86
+
87
+ // UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
88
+ // Use of this interface is not recommended, as added methods to AuthServiceServer will
89
+ // result in compilation errors.
90
+ type UnsafeAuthServiceServer interface {
91
+ mustEmbedUnimplementedAuthServiceServer()
92
+ }
93
+
94
+ func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
95
+ // If the following call panics, it indicates UnimplementedAuthServiceServer was
96
+ // embedded by pointer and is nil. This will cause panics if an
97
+ // unimplemented method is ever invoked, so we test this at initialization
98
+ // time to prevent it from happening at runtime later due to I/O.
99
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
100
+ t.testEmbeddedByValue()
101
+ }
102
+ s.RegisterService(&AuthService_ServiceDesc, srv)
103
+ }
104
+
105
+ func _AuthService_SendOtp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
106
+ in := new(SendOtpRequest)
107
+ if err := dec(in); err != nil {
108
+ return nil, err
109
+ }
110
+ if interceptor == nil {
111
+ return srv.(AuthServiceServer).SendOtp(ctx, in)
112
+ }
113
+ info := &grpc.UnaryServerInfo{
114
+ Server: srv,
115
+ FullMethod: AuthService_SendOtp_FullMethodName,
116
+ }
117
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
118
+ return srv.(AuthServiceServer).SendOtp(ctx, req.(*SendOtpRequest))
119
+ }
120
+ return interceptor(ctx, in, info, handler)
121
+ }
122
+
123
+ func _AuthService_VerifyOtp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
124
+ in := new(VerifyOtpRequest)
125
+ if err := dec(in); err != nil {
126
+ return nil, err
127
+ }
128
+ if interceptor == nil {
129
+ return srv.(AuthServiceServer).VerifyOtp(ctx, in)
130
+ }
131
+ info := &grpc.UnaryServerInfo{
132
+ Server: srv,
133
+ FullMethod: AuthService_VerifyOtp_FullMethodName,
134
+ }
135
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
136
+ return srv.(AuthServiceServer).VerifyOtp(ctx, req.(*VerifyOtpRequest))
137
+ }
138
+ return interceptor(ctx, in, info, handler)
139
+ }
140
+
141
+ // AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
142
+ // It's only intended for direct use with grpc.RegisterService,
143
+ // and not to be introspected or modified (even as a copy)
144
+ var AuthService_ServiceDesc = grpc.ServiceDesc{
145
+ ServiceName: "auth.v1.AuthService",
146
+ HandlerType: (*AuthServiceServer)(nil),
147
+ Methods: []grpc.MethodDesc{
148
+ {
149
+ MethodName: "SendOtp",
150
+ Handler: _AuthService_SendOtp_Handler,
151
+ },
152
+ {
153
+ MethodName: "VerifyOtp",
154
+ Handler: _AuthService_VerifyOtp_Handler,
155
+ },
156
+ },
157
+ Streams: []grpc.StreamDesc{},
158
+ Metadata: "proto/auth.proto",
159
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@sa2-movie-ticket/testing",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
7
- "generate": "mkdir -p gen && protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./gen proto/*.proto",
8
- "gen": "mkdir -p gen && protoc --ts_proto_out=gen/ts --ts_proto_opt=outputServices=grpc-js --go_out=gen/go --go-grpc_out=gen/go proto/*.proto",
7
+ "generate": "mkdir -p gen && protoc --ts_proto_out=gen/ts --ts_proto_opt=outputServices=grpc-js --go_out=gen/go --go-grpc_out=gen/go proto/*.proto",
8
+ "gen": "mkdir -p gen && protoc --ts_proto_out=gen/ts --ts_proto_opt=outputServices=grpc-js,esModuleInterop=true --go_out=paths=source_relative:gen/go --go-grpc_out=paths=source_relative:gen/go proto/*.proto",
9
9
  "start": "node src/index.js"
10
10
  },
11
11
  "keywords": [],
package/proto/auth.proto CHANGED
@@ -2,7 +2,8 @@ syntax = "proto3";
2
2
 
3
3
  package auth.v1;
4
4
 
5
- option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/auth";
5
+ option go_package = "./gen/go;contracts";
6
+
6
7
 
7
8
  service AuthService {
8
9
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);