@sa2-movie-ticket/contracts 1.0.0
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/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +30 -0
- package/dist/index.mjs +9 -0
- package/gen/ts/auth.ts +416 -0
- package/package.json +30 -0
- package/proto/auth.proto +28 -0
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
default: () => index_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
var a = 1;
|
|
27
|
+
var hello = () => {
|
|
28
|
+
console.log("Hello World");
|
|
29
|
+
};
|
|
30
|
+
var index_default = { a, hello };
|
package/dist/index.mjs
ADDED
package/gen/ts/auth.ts
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
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 { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import {
|
|
10
|
+
type CallOptions,
|
|
11
|
+
type ChannelCredentials,
|
|
12
|
+
Client,
|
|
13
|
+
type ClientOptions,
|
|
14
|
+
type ClientUnaryCall,
|
|
15
|
+
type handleUnaryCall,
|
|
16
|
+
makeGenericClientConstructor,
|
|
17
|
+
type Metadata,
|
|
18
|
+
type ServiceError,
|
|
19
|
+
type UntypedServiceImplementation,
|
|
20
|
+
} from "@grpc/grpc-js";
|
|
21
|
+
|
|
22
|
+
export const protobufPackage = "auth.v1";
|
|
23
|
+
|
|
24
|
+
export interface SendOtpRequest {
|
|
25
|
+
identifier: string;
|
|
26
|
+
type: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface SendOtpResponse {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface VerifyOtpRequest {
|
|
34
|
+
identifier: string;
|
|
35
|
+
type: string;
|
|
36
|
+
otp: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface VerifyOtpResponse {
|
|
40
|
+
token: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function createBaseSendOtpRequest(): SendOtpRequest {
|
|
44
|
+
return { identifier: "", type: "" };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const SendOtpRequest: MessageFns<SendOtpRequest> = {
|
|
48
|
+
encode(message: SendOtpRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
49
|
+
if (message.identifier !== "") {
|
|
50
|
+
writer.uint32(10).string(message.identifier);
|
|
51
|
+
}
|
|
52
|
+
if (message.type !== "") {
|
|
53
|
+
writer.uint32(18).string(message.type);
|
|
54
|
+
}
|
|
55
|
+
return writer;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SendOtpRequest {
|
|
59
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
60
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
61
|
+
const message = createBaseSendOtpRequest();
|
|
62
|
+
while (reader.pos < end) {
|
|
63
|
+
const tag = reader.uint32();
|
|
64
|
+
switch (tag >>> 3) {
|
|
65
|
+
case 1: {
|
|
66
|
+
if (tag !== 10) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message.identifier = reader.string();
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
case 2: {
|
|
74
|
+
if (tag !== 18) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message.type = reader.string();
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
reader.skip(tag & 7);
|
|
86
|
+
}
|
|
87
|
+
return message;
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
fromJSON(object: any): SendOtpRequest {
|
|
91
|
+
return {
|
|
92
|
+
identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
|
|
93
|
+
type: isSet(object.type) ? globalThis.String(object.type) : "",
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
toJSON(message: SendOtpRequest): unknown {
|
|
98
|
+
const obj: any = {};
|
|
99
|
+
if (message.identifier !== "") {
|
|
100
|
+
obj.identifier = message.identifier;
|
|
101
|
+
}
|
|
102
|
+
if (message.type !== "") {
|
|
103
|
+
obj.type = message.type;
|
|
104
|
+
}
|
|
105
|
+
return obj;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
create<I extends Exact<DeepPartial<SendOtpRequest>, I>>(base?: I): SendOtpRequest {
|
|
109
|
+
return SendOtpRequest.fromPartial(base ?? ({} as any));
|
|
110
|
+
},
|
|
111
|
+
fromPartial<I extends Exact<DeepPartial<SendOtpRequest>, I>>(object: I): SendOtpRequest {
|
|
112
|
+
const message = createBaseSendOtpRequest();
|
|
113
|
+
message.identifier = object.identifier ?? "";
|
|
114
|
+
message.type = object.type ?? "";
|
|
115
|
+
return message;
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
function createBaseSendOtpResponse(): SendOtpResponse {
|
|
120
|
+
return { ok: false };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const SendOtpResponse: MessageFns<SendOtpResponse> = {
|
|
124
|
+
encode(message: SendOtpResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
125
|
+
if (message.ok !== false) {
|
|
126
|
+
writer.uint32(8).bool(message.ok);
|
|
127
|
+
}
|
|
128
|
+
return writer;
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SendOtpResponse {
|
|
132
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
133
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
134
|
+
const message = createBaseSendOtpResponse();
|
|
135
|
+
while (reader.pos < end) {
|
|
136
|
+
const tag = reader.uint32();
|
|
137
|
+
switch (tag >>> 3) {
|
|
138
|
+
case 1: {
|
|
139
|
+
if (tag !== 8) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
message.ok = reader.bool();
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
reader.skip(tag & 7);
|
|
151
|
+
}
|
|
152
|
+
return message;
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
fromJSON(object: any): SendOtpResponse {
|
|
156
|
+
return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
toJSON(message: SendOtpResponse): unknown {
|
|
160
|
+
const obj: any = {};
|
|
161
|
+
if (message.ok !== false) {
|
|
162
|
+
obj.ok = message.ok;
|
|
163
|
+
}
|
|
164
|
+
return obj;
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
create<I extends Exact<DeepPartial<SendOtpResponse>, I>>(base?: I): SendOtpResponse {
|
|
168
|
+
return SendOtpResponse.fromPartial(base ?? ({} as any));
|
|
169
|
+
},
|
|
170
|
+
fromPartial<I extends Exact<DeepPartial<SendOtpResponse>, I>>(object: I): SendOtpResponse {
|
|
171
|
+
const message = createBaseSendOtpResponse();
|
|
172
|
+
message.ok = object.ok ?? false;
|
|
173
|
+
return message;
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
function createBaseVerifyOtpRequest(): VerifyOtpRequest {
|
|
178
|
+
return { identifier: "", type: "", otp: "" };
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
|
|
182
|
+
encode(message: VerifyOtpRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
183
|
+
if (message.identifier !== "") {
|
|
184
|
+
writer.uint32(10).string(message.identifier);
|
|
185
|
+
}
|
|
186
|
+
if (message.type !== "") {
|
|
187
|
+
writer.uint32(18).string(message.type);
|
|
188
|
+
}
|
|
189
|
+
if (message.otp !== "") {
|
|
190
|
+
writer.uint32(26).string(message.otp);
|
|
191
|
+
}
|
|
192
|
+
return writer;
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
decode(input: BinaryReader | Uint8Array, length?: number): VerifyOtpRequest {
|
|
196
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
197
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
198
|
+
const message = createBaseVerifyOtpRequest();
|
|
199
|
+
while (reader.pos < end) {
|
|
200
|
+
const tag = reader.uint32();
|
|
201
|
+
switch (tag >>> 3) {
|
|
202
|
+
case 1: {
|
|
203
|
+
if (tag !== 10) {
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
message.identifier = reader.string();
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
case 2: {
|
|
211
|
+
if (tag !== 18) {
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
message.type = reader.string();
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
case 3: {
|
|
219
|
+
if (tag !== 26) {
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
message.otp = reader.string();
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
reader.skip(tag & 7);
|
|
231
|
+
}
|
|
232
|
+
return message;
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
fromJSON(object: any): VerifyOtpRequest {
|
|
236
|
+
return {
|
|
237
|
+
identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
|
|
238
|
+
type: isSet(object.type) ? globalThis.String(object.type) : "",
|
|
239
|
+
otp: isSet(object.otp) ? globalThis.String(object.otp) : "",
|
|
240
|
+
};
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
toJSON(message: VerifyOtpRequest): unknown {
|
|
244
|
+
const obj: any = {};
|
|
245
|
+
if (message.identifier !== "") {
|
|
246
|
+
obj.identifier = message.identifier;
|
|
247
|
+
}
|
|
248
|
+
if (message.type !== "") {
|
|
249
|
+
obj.type = message.type;
|
|
250
|
+
}
|
|
251
|
+
if (message.otp !== "") {
|
|
252
|
+
obj.otp = message.otp;
|
|
253
|
+
}
|
|
254
|
+
return obj;
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
create<I extends Exact<DeepPartial<VerifyOtpRequest>, I>>(base?: I): VerifyOtpRequest {
|
|
258
|
+
return VerifyOtpRequest.fromPartial(base ?? ({} as any));
|
|
259
|
+
},
|
|
260
|
+
fromPartial<I extends Exact<DeepPartial<VerifyOtpRequest>, I>>(object: I): VerifyOtpRequest {
|
|
261
|
+
const message = createBaseVerifyOtpRequest();
|
|
262
|
+
message.identifier = object.identifier ?? "";
|
|
263
|
+
message.type = object.type ?? "";
|
|
264
|
+
message.otp = object.otp ?? "";
|
|
265
|
+
return message;
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
function createBaseVerifyOtpResponse(): VerifyOtpResponse {
|
|
270
|
+
return { token: "" };
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export const VerifyOtpResponse: MessageFns<VerifyOtpResponse> = {
|
|
274
|
+
encode(message: VerifyOtpResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
275
|
+
if (message.token !== "") {
|
|
276
|
+
writer.uint32(10).string(message.token);
|
|
277
|
+
}
|
|
278
|
+
return writer;
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
decode(input: BinaryReader | Uint8Array, length?: number): VerifyOtpResponse {
|
|
282
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
283
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
284
|
+
const message = createBaseVerifyOtpResponse();
|
|
285
|
+
while (reader.pos < end) {
|
|
286
|
+
const tag = reader.uint32();
|
|
287
|
+
switch (tag >>> 3) {
|
|
288
|
+
case 1: {
|
|
289
|
+
if (tag !== 10) {
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
message.token = reader.string();
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
reader.skip(tag & 7);
|
|
301
|
+
}
|
|
302
|
+
return message;
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
fromJSON(object: any): VerifyOtpResponse {
|
|
306
|
+
return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
toJSON(message: VerifyOtpResponse): unknown {
|
|
310
|
+
const obj: any = {};
|
|
311
|
+
if (message.token !== "") {
|
|
312
|
+
obj.token = message.token;
|
|
313
|
+
}
|
|
314
|
+
return obj;
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
create<I extends Exact<DeepPartial<VerifyOtpResponse>, I>>(base?: I): VerifyOtpResponse {
|
|
318
|
+
return VerifyOtpResponse.fromPartial(base ?? ({} as any));
|
|
319
|
+
},
|
|
320
|
+
fromPartial<I extends Exact<DeepPartial<VerifyOtpResponse>, I>>(object: I): VerifyOtpResponse {
|
|
321
|
+
const message = createBaseVerifyOtpResponse();
|
|
322
|
+
message.token = object.token ?? "";
|
|
323
|
+
return message;
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export type AuthServiceService = typeof AuthServiceService;
|
|
328
|
+
export const AuthServiceService = {
|
|
329
|
+
sendOtp: {
|
|
330
|
+
path: "/auth.v1.AuthService/SendOtp",
|
|
331
|
+
requestStream: false,
|
|
332
|
+
responseStream: false,
|
|
333
|
+
requestSerialize: (value: SendOtpRequest): Buffer => Buffer.from(SendOtpRequest.encode(value).finish()),
|
|
334
|
+
requestDeserialize: (value: Buffer): SendOtpRequest => SendOtpRequest.decode(value),
|
|
335
|
+
responseSerialize: (value: SendOtpResponse): Buffer => Buffer.from(SendOtpResponse.encode(value).finish()),
|
|
336
|
+
responseDeserialize: (value: Buffer): SendOtpResponse => SendOtpResponse.decode(value),
|
|
337
|
+
},
|
|
338
|
+
verifyOtp: {
|
|
339
|
+
path: "/auth.v1.AuthService/VerifyOtp",
|
|
340
|
+
requestStream: false,
|
|
341
|
+
responseStream: false,
|
|
342
|
+
requestSerialize: (value: VerifyOtpRequest): Buffer => Buffer.from(VerifyOtpRequest.encode(value).finish()),
|
|
343
|
+
requestDeserialize: (value: Buffer): VerifyOtpRequest => VerifyOtpRequest.decode(value),
|
|
344
|
+
responseSerialize: (value: VerifyOtpResponse): Buffer => Buffer.from(VerifyOtpResponse.encode(value).finish()),
|
|
345
|
+
responseDeserialize: (value: Buffer): VerifyOtpResponse => VerifyOtpResponse.decode(value),
|
|
346
|
+
},
|
|
347
|
+
} as const;
|
|
348
|
+
|
|
349
|
+
export interface AuthServiceServer extends UntypedServiceImplementation {
|
|
350
|
+
sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
|
|
351
|
+
verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface AuthServiceClient extends Client {
|
|
355
|
+
sendOtp(
|
|
356
|
+
request: SendOtpRequest,
|
|
357
|
+
callback: (error: ServiceError | null, response: SendOtpResponse) => void,
|
|
358
|
+
): ClientUnaryCall;
|
|
359
|
+
sendOtp(
|
|
360
|
+
request: SendOtpRequest,
|
|
361
|
+
metadata: Metadata,
|
|
362
|
+
callback: (error: ServiceError | null, response: SendOtpResponse) => void,
|
|
363
|
+
): ClientUnaryCall;
|
|
364
|
+
sendOtp(
|
|
365
|
+
request: SendOtpRequest,
|
|
366
|
+
metadata: Metadata,
|
|
367
|
+
options: Partial<CallOptions>,
|
|
368
|
+
callback: (error: ServiceError | null, response: SendOtpResponse) => void,
|
|
369
|
+
): ClientUnaryCall;
|
|
370
|
+
verifyOtp(
|
|
371
|
+
request: VerifyOtpRequest,
|
|
372
|
+
callback: (error: ServiceError | null, response: VerifyOtpResponse) => void,
|
|
373
|
+
): ClientUnaryCall;
|
|
374
|
+
verifyOtp(
|
|
375
|
+
request: VerifyOtpRequest,
|
|
376
|
+
metadata: Metadata,
|
|
377
|
+
callback: (error: ServiceError | null, response: VerifyOtpResponse) => void,
|
|
378
|
+
): ClientUnaryCall;
|
|
379
|
+
verifyOtp(
|
|
380
|
+
request: VerifyOtpRequest,
|
|
381
|
+
metadata: Metadata,
|
|
382
|
+
options: Partial<CallOptions>,
|
|
383
|
+
callback: (error: ServiceError | null, response: VerifyOtpResponse) => void,
|
|
384
|
+
): ClientUnaryCall;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export const AuthServiceClient = makeGenericClientConstructor(AuthServiceService, "auth.v1.AuthService") as unknown as {
|
|
388
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): AuthServiceClient;
|
|
389
|
+
service: typeof AuthServiceService;
|
|
390
|
+
serviceName: string;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
394
|
+
|
|
395
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
396
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
397
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
398
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
399
|
+
: Partial<T>;
|
|
400
|
+
|
|
401
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
402
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
403
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
404
|
+
|
|
405
|
+
function isSet(value: any): boolean {
|
|
406
|
+
return value !== null && value !== undefined;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export interface MessageFns<T> {
|
|
410
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
411
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
412
|
+
fromJSON(object: any): T;
|
|
413
|
+
toJSON(message: T): unknown;
|
|
414
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
415
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
416
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sa2-movie-ticket/contracts",
|
|
3
|
+
"description": "Contracts for movie ticket microservices",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
12
|
+
"generate": "protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto.exe --ts_proto_out=./gen/ts --ts_proto_opt=esModuleInterop=true,forceLong=bigint,outputServices=grpc-js,package=omit -I=./proto ./proto/*.proto"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"proto",
|
|
17
|
+
"gen"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/bun": "latest",
|
|
21
|
+
"protoc": "^33.5.0",
|
|
22
|
+
"ts-proto": "^2.11.2",
|
|
23
|
+
"tsup": "^8.5.1"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"typescript": "^5",
|
|
27
|
+
"@bufbuild/protobuf": "^2.11.0",
|
|
28
|
+
"@grpc/grpc-js": "^1.14.3"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/proto/auth.proto
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
service AuthService {
|
|
6
|
+
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message SendOtpRequest {
|
|
11
|
+
string identifier = 1;
|
|
12
|
+
string type = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message SendOtpResponse {
|
|
16
|
+
bool ok = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message VerifyOtpRequest {
|
|
20
|
+
string identifier = 1;
|
|
21
|
+
string type = 2;
|
|
22
|
+
string otp = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message VerifyOtpResponse {
|
|
26
|
+
string token = 1;
|
|
27
|
+
}
|
|
28
|
+
|