@sa2-movie-ticket/contracts 1.0.4 → 1.0.6

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 CHANGED
@@ -1,86 +1,5 @@
1
- import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
- import { Client, ServiceError, ClientUnaryCall, Metadata, CallOptions, ChannelCredentials, ClientOptions, UntypedServiceImplementation, handleUnaryCall } from '@grpc/grpc-js';
3
-
4
- declare const protobufPackage = "auth.v1";
5
- interface SendOtpRequest {
6
- identifier: string;
7
- type: string;
8
- }
9
- declare const SendOtpRequest: MessageFns<SendOtpRequest>;
10
- interface SendOtpResponse {
11
- ok: boolean;
12
- }
13
- declare const SendOtpResponse: MessageFns<SendOtpResponse>;
14
- interface VerifyOtpRequest {
15
- identifier: string;
16
- type: string;
17
- otp: string;
18
- }
19
- declare const VerifyOtpRequest: MessageFns<VerifyOtpRequest>;
20
- interface VerifyOtpResponse {
21
- token: string;
22
- }
23
- declare const VerifyOtpResponse: MessageFns<VerifyOtpResponse>;
24
- type AuthServiceService = typeof AuthServiceService;
25
- declare const AuthServiceService: {
26
- readonly sendOtp: {
27
- readonly path: "/auth.v1.AuthService/SendOtp";
28
- readonly requestStream: false;
29
- readonly responseStream: false;
30
- readonly requestSerialize: (value: SendOtpRequest) => Buffer;
31
- readonly requestDeserialize: (value: Buffer) => SendOtpRequest;
32
- readonly responseSerialize: (value: SendOtpResponse) => Buffer;
33
- readonly responseDeserialize: (value: Buffer) => SendOtpResponse;
34
- };
35
- readonly verifyOtp: {
36
- readonly path: "/auth.v1.AuthService/VerifyOtp";
37
- readonly requestStream: false;
38
- readonly responseStream: false;
39
- readonly requestSerialize: (value: VerifyOtpRequest) => Buffer;
40
- readonly requestDeserialize: (value: Buffer) => VerifyOtpRequest;
41
- readonly responseSerialize: (value: VerifyOtpResponse) => Buffer;
42
- readonly responseDeserialize: (value: Buffer) => VerifyOtpResponse;
43
- };
44
- };
45
- interface AuthServiceServer extends UntypedServiceImplementation {
46
- sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
47
- verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
48
- }
49
- interface AuthServiceClient extends Client {
50
- sendOtp(request: SendOtpRequest, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
51
- sendOtp(request: SendOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
52
- sendOtp(request: SendOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
53
- verifyOtp(request: VerifyOtpRequest, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
54
- verifyOtp(request: VerifyOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
55
- verifyOtp(request: VerifyOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
56
- }
57
- declare const AuthServiceClient: {
58
- new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): AuthServiceClient;
59
- service: typeof AuthServiceService;
60
- serviceName: string;
61
- };
62
- type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
63
- type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
64
- [K in keyof T]?: DeepPartial<T[K]>;
65
- } : Partial<T>;
66
- type KeysOfUnion<T> = T extends T ? keyof T : never;
67
- type Exact<P, I extends P> = P extends Builtin ? P : P & {
68
- [K in keyof P]: Exact<P[K], I[K]>;
69
- } & {
70
- [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
71
- };
72
- interface MessageFns<T> {
73
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
74
- decode(input: BinaryReader | Uint8Array, length?: number): T;
75
- fromJSON(object: any): T;
76
- toJSON(message: T): unknown;
77
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
78
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
79
- }
80
-
81
- declare const _default: {
82
- a: number;
83
- hello: () => void;
1
+ declare const GRPC_PROTO_PATH: {
2
+ readonly AUTH: string;
84
3
  };
85
4
 
86
- export { AuthServiceClient, type AuthServiceServer, AuthServiceService, type DeepPartial, type Exact, type MessageFns, SendOtpRequest, SendOtpResponse, VerifyOtpRequest, VerifyOtpResponse, _default as default, protobufPackage };
5
+ export { GRPC_PROTO_PATH };
package/dist/index.d.ts CHANGED
@@ -1,86 +1,5 @@
1
- import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
2
- import { Client, ServiceError, ClientUnaryCall, Metadata, CallOptions, ChannelCredentials, ClientOptions, UntypedServiceImplementation, handleUnaryCall } from '@grpc/grpc-js';
3
-
4
- declare const protobufPackage = "auth.v1";
5
- interface SendOtpRequest {
6
- identifier: string;
7
- type: string;
8
- }
9
- declare const SendOtpRequest: MessageFns<SendOtpRequest>;
10
- interface SendOtpResponse {
11
- ok: boolean;
12
- }
13
- declare const SendOtpResponse: MessageFns<SendOtpResponse>;
14
- interface VerifyOtpRequest {
15
- identifier: string;
16
- type: string;
17
- otp: string;
18
- }
19
- declare const VerifyOtpRequest: MessageFns<VerifyOtpRequest>;
20
- interface VerifyOtpResponse {
21
- token: string;
22
- }
23
- declare const VerifyOtpResponse: MessageFns<VerifyOtpResponse>;
24
- type AuthServiceService = typeof AuthServiceService;
25
- declare const AuthServiceService: {
26
- readonly sendOtp: {
27
- readonly path: "/auth.v1.AuthService/SendOtp";
28
- readonly requestStream: false;
29
- readonly responseStream: false;
30
- readonly requestSerialize: (value: SendOtpRequest) => Buffer;
31
- readonly requestDeserialize: (value: Buffer) => SendOtpRequest;
32
- readonly responseSerialize: (value: SendOtpResponse) => Buffer;
33
- readonly responseDeserialize: (value: Buffer) => SendOtpResponse;
34
- };
35
- readonly verifyOtp: {
36
- readonly path: "/auth.v1.AuthService/VerifyOtp";
37
- readonly requestStream: false;
38
- readonly responseStream: false;
39
- readonly requestSerialize: (value: VerifyOtpRequest) => Buffer;
40
- readonly requestDeserialize: (value: Buffer) => VerifyOtpRequest;
41
- readonly responseSerialize: (value: VerifyOtpResponse) => Buffer;
42
- readonly responseDeserialize: (value: Buffer) => VerifyOtpResponse;
43
- };
44
- };
45
- interface AuthServiceServer extends UntypedServiceImplementation {
46
- sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
47
- verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
48
- }
49
- interface AuthServiceClient extends Client {
50
- sendOtp(request: SendOtpRequest, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
51
- sendOtp(request: SendOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
52
- sendOtp(request: SendOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
53
- verifyOtp(request: VerifyOtpRequest, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
54
- verifyOtp(request: VerifyOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
55
- verifyOtp(request: VerifyOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
56
- }
57
- declare const AuthServiceClient: {
58
- new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): AuthServiceClient;
59
- service: typeof AuthServiceService;
60
- serviceName: string;
61
- };
62
- type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
63
- type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
64
- [K in keyof T]?: DeepPartial<T[K]>;
65
- } : Partial<T>;
66
- type KeysOfUnion<T> = T extends T ? keyof T : never;
67
- type Exact<P, I extends P> = P extends Builtin ? P : P & {
68
- [K in keyof P]: Exact<P[K], I[K]>;
69
- } & {
70
- [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
71
- };
72
- interface MessageFns<T> {
73
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
74
- decode(input: BinaryReader | Uint8Array, length?: number): T;
75
- fromJSON(object: any): T;
76
- toJSON(message: T): unknown;
77
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
78
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
79
- }
80
-
81
- declare const _default: {
82
- a: number;
83
- hello: () => void;
1
+ declare const GRPC_PROTO_PATH: {
2
+ readonly AUTH: string;
84
3
  };
85
4
 
86
- export { AuthServiceClient, type AuthServiceServer, AuthServiceService, type DeepPartial, type Exact, type MessageFns, SendOtpRequest, SendOtpResponse, VerifyOtpRequest, VerifyOtpResponse, _default as default, protobufPackage };
5
+ export { GRPC_PROTO_PATH };
package/dist/index.js CHANGED
@@ -20,312 +20,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- AuthServiceClient: () => AuthServiceClient,
24
- AuthServiceService: () => AuthServiceService,
25
- SendOtpRequest: () => SendOtpRequest,
26
- SendOtpResponse: () => SendOtpResponse,
27
- VerifyOtpRequest: () => VerifyOtpRequest,
28
- VerifyOtpResponse: () => VerifyOtpResponse,
29
- default: () => index_default,
30
- protobufPackage: () => protobufPackage
23
+ GRPC_PROTO_PATH: () => GRPC_PROTO_PATH
31
24
  });
32
25
  module.exports = __toCommonJS(index_exports);
33
26
 
34
- // gen/ts/auth.ts
35
- var import_wire = require("@bufbuild/protobuf/wire");
36
- var import_grpc_js = require("@grpc/grpc-js");
37
- var protobufPackage = "auth.v1";
38
- function createBaseSendOtpRequest() {
39
- return { identifier: "", type: "" };
40
- }
41
- var SendOtpRequest = {
42
- encode(message, writer = new import_wire.BinaryWriter()) {
43
- if (message.identifier !== "") {
44
- writer.uint32(10).string(message.identifier);
45
- }
46
- if (message.type !== "") {
47
- writer.uint32(18).string(message.type);
48
- }
49
- return writer;
50
- },
51
- decode(input, length) {
52
- const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
53
- const end = length === void 0 ? reader.len : reader.pos + length;
54
- const message = createBaseSendOtpRequest();
55
- while (reader.pos < end) {
56
- const tag = reader.uint32();
57
- switch (tag >>> 3) {
58
- case 1: {
59
- if (tag !== 10) {
60
- break;
61
- }
62
- message.identifier = reader.string();
63
- continue;
64
- }
65
- case 2: {
66
- if (tag !== 18) {
67
- break;
68
- }
69
- message.type = reader.string();
70
- continue;
71
- }
72
- }
73
- if ((tag & 7) === 4 || tag === 0) {
74
- break;
75
- }
76
- reader.skip(tag & 7);
77
- }
78
- return message;
79
- },
80
- fromJSON(object) {
81
- return {
82
- identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
83
- type: isSet(object.type) ? globalThis.String(object.type) : ""
84
- };
85
- },
86
- toJSON(message) {
87
- const obj = {};
88
- if (message.identifier !== "") {
89
- obj.identifier = message.identifier;
90
- }
91
- if (message.type !== "") {
92
- obj.type = message.type;
93
- }
94
- return obj;
95
- },
96
- create(base) {
97
- return SendOtpRequest.fromPartial(base ?? {});
98
- },
99
- fromPartial(object) {
100
- const message = createBaseSendOtpRequest();
101
- message.identifier = object.identifier ?? "";
102
- message.type = object.type ?? "";
103
- return message;
104
- }
105
- };
106
- function createBaseSendOtpResponse() {
107
- return { ok: false };
108
- }
109
- var SendOtpResponse = {
110
- encode(message, writer = new import_wire.BinaryWriter()) {
111
- if (message.ok !== false) {
112
- writer.uint32(8).bool(message.ok);
113
- }
114
- return writer;
115
- },
116
- decode(input, length) {
117
- const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
118
- const end = length === void 0 ? reader.len : reader.pos + length;
119
- const message = createBaseSendOtpResponse();
120
- while (reader.pos < end) {
121
- const tag = reader.uint32();
122
- switch (tag >>> 3) {
123
- case 1: {
124
- if (tag !== 8) {
125
- break;
126
- }
127
- message.ok = reader.bool();
128
- continue;
129
- }
130
- }
131
- if ((tag & 7) === 4 || tag === 0) {
132
- break;
133
- }
134
- reader.skip(tag & 7);
135
- }
136
- return message;
137
- },
138
- fromJSON(object) {
139
- return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
140
- },
141
- toJSON(message) {
142
- const obj = {};
143
- if (message.ok !== false) {
144
- obj.ok = message.ok;
145
- }
146
- return obj;
147
- },
148
- create(base) {
149
- return SendOtpResponse.fromPartial(base ?? {});
150
- },
151
- fromPartial(object) {
152
- const message = createBaseSendOtpResponse();
153
- message.ok = object.ok ?? false;
154
- return message;
155
- }
156
- };
157
- function createBaseVerifyOtpRequest() {
158
- return { identifier: "", type: "", otp: "" };
159
- }
160
- var VerifyOtpRequest = {
161
- encode(message, writer = new import_wire.BinaryWriter()) {
162
- if (message.identifier !== "") {
163
- writer.uint32(10).string(message.identifier);
164
- }
165
- if (message.type !== "") {
166
- writer.uint32(18).string(message.type);
167
- }
168
- if (message.otp !== "") {
169
- writer.uint32(26).string(message.otp);
170
- }
171
- return writer;
172
- },
173
- decode(input, length) {
174
- const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
175
- const end = length === void 0 ? reader.len : reader.pos + length;
176
- const message = createBaseVerifyOtpRequest();
177
- while (reader.pos < end) {
178
- const tag = reader.uint32();
179
- switch (tag >>> 3) {
180
- case 1: {
181
- if (tag !== 10) {
182
- break;
183
- }
184
- message.identifier = reader.string();
185
- continue;
186
- }
187
- case 2: {
188
- if (tag !== 18) {
189
- break;
190
- }
191
- message.type = reader.string();
192
- continue;
193
- }
194
- case 3: {
195
- if (tag !== 26) {
196
- break;
197
- }
198
- message.otp = reader.string();
199
- continue;
200
- }
201
- }
202
- if ((tag & 7) === 4 || tag === 0) {
203
- break;
204
- }
205
- reader.skip(tag & 7);
206
- }
207
- return message;
208
- },
209
- fromJSON(object) {
210
- return {
211
- identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
212
- type: isSet(object.type) ? globalThis.String(object.type) : "",
213
- otp: isSet(object.otp) ? globalThis.String(object.otp) : ""
214
- };
215
- },
216
- toJSON(message) {
217
- const obj = {};
218
- if (message.identifier !== "") {
219
- obj.identifier = message.identifier;
220
- }
221
- if (message.type !== "") {
222
- obj.type = message.type;
223
- }
224
- if (message.otp !== "") {
225
- obj.otp = message.otp;
226
- }
227
- return obj;
228
- },
229
- create(base) {
230
- return VerifyOtpRequest.fromPartial(base ?? {});
231
- },
232
- fromPartial(object) {
233
- const message = createBaseVerifyOtpRequest();
234
- message.identifier = object.identifier ?? "";
235
- message.type = object.type ?? "";
236
- message.otp = object.otp ?? "";
237
- return message;
238
- }
239
- };
240
- function createBaseVerifyOtpResponse() {
241
- return { token: "" };
242
- }
243
- var VerifyOtpResponse = {
244
- encode(message, writer = new import_wire.BinaryWriter()) {
245
- if (message.token !== "") {
246
- writer.uint32(10).string(message.token);
247
- }
248
- return writer;
249
- },
250
- decode(input, length) {
251
- const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
252
- const end = length === void 0 ? reader.len : reader.pos + length;
253
- const message = createBaseVerifyOtpResponse();
254
- while (reader.pos < end) {
255
- const tag = reader.uint32();
256
- switch (tag >>> 3) {
257
- case 1: {
258
- if (tag !== 10) {
259
- break;
260
- }
261
- message.token = reader.string();
262
- continue;
263
- }
264
- }
265
- if ((tag & 7) === 4 || tag === 0) {
266
- break;
267
- }
268
- reader.skip(tag & 7);
269
- }
270
- return message;
271
- },
272
- fromJSON(object) {
273
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
274
- },
275
- toJSON(message) {
276
- const obj = {};
277
- if (message.token !== "") {
278
- obj.token = message.token;
279
- }
280
- return obj;
281
- },
282
- create(base) {
283
- return VerifyOtpResponse.fromPartial(base ?? {});
284
- },
285
- fromPartial(object) {
286
- const message = createBaseVerifyOtpResponse();
287
- message.token = object.token ?? "";
288
- return message;
289
- }
290
- };
291
- var AuthServiceService = {
292
- sendOtp: {
293
- path: "/auth.v1.AuthService/SendOtp",
294
- requestStream: false,
295
- responseStream: false,
296
- requestSerialize: (value) => Buffer.from(SendOtpRequest.encode(value).finish()),
297
- requestDeserialize: (value) => SendOtpRequest.decode(value),
298
- responseSerialize: (value) => Buffer.from(SendOtpResponse.encode(value).finish()),
299
- responseDeserialize: (value) => SendOtpResponse.decode(value)
300
- },
301
- verifyOtp: {
302
- path: "/auth.v1.AuthService/VerifyOtp",
303
- requestStream: false,
304
- responseStream: false,
305
- requestSerialize: (value) => Buffer.from(VerifyOtpRequest.encode(value).finish()),
306
- requestDeserialize: (value) => VerifyOtpRequest.decode(value),
307
- responseSerialize: (value) => Buffer.from(VerifyOtpResponse.encode(value).finish()),
308
- responseDeserialize: (value) => VerifyOtpResponse.decode(value)
309
- }
310
- };
311
- var AuthServiceClient = (0, import_grpc_js.makeGenericClientConstructor)(AuthServiceService, "auth.v1.AuthService");
312
- function isSet(value) {
313
- return value !== null && value !== void 0;
314
- }
315
-
316
- // src/index.ts
317
- var a = 1;
318
- var hello = () => {
319
- console.log("Hello World");
27
+ // src/proto/path.ts
28
+ var import_node_path = require("path");
29
+ var GRPC_PROTO_PATH = {
30
+ AUTH: (0, import_node_path.join)(__dirname, "../../proto/auth.proto")
320
31
  };
321
- var index_default = { a, hello };
322
32
  // Annotate the CommonJS export names for ESM import in node:
323
33
  0 && (module.exports = {
324
- AuthServiceClient,
325
- AuthServiceService,
326
- SendOtpRequest,
327
- SendOtpResponse,
328
- VerifyOtpRequest,
329
- VerifyOtpResponse,
330
- protobufPackage
34
+ GRPC_PROTO_PATH
331
35
  });
package/dist/index.mjs CHANGED
@@ -1,300 +1,8 @@
1
- // gen/ts/auth.ts
2
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
3
- import {
4
- makeGenericClientConstructor
5
- } from "@grpc/grpc-js";
6
- var protobufPackage = "auth.v1";
7
- function createBaseSendOtpRequest() {
8
- return { identifier: "", type: "" };
9
- }
10
- var SendOtpRequest = {
11
- encode(message, writer = new BinaryWriter()) {
12
- if (message.identifier !== "") {
13
- writer.uint32(10).string(message.identifier);
14
- }
15
- if (message.type !== "") {
16
- writer.uint32(18).string(message.type);
17
- }
18
- return writer;
19
- },
20
- decode(input, length) {
21
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
22
- const end = length === void 0 ? reader.len : reader.pos + length;
23
- const message = createBaseSendOtpRequest();
24
- while (reader.pos < end) {
25
- const tag = reader.uint32();
26
- switch (tag >>> 3) {
27
- case 1: {
28
- if (tag !== 10) {
29
- break;
30
- }
31
- message.identifier = reader.string();
32
- continue;
33
- }
34
- case 2: {
35
- if (tag !== 18) {
36
- break;
37
- }
38
- message.type = reader.string();
39
- continue;
40
- }
41
- }
42
- if ((tag & 7) === 4 || tag === 0) {
43
- break;
44
- }
45
- reader.skip(tag & 7);
46
- }
47
- return message;
48
- },
49
- fromJSON(object) {
50
- return {
51
- identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
52
- type: isSet(object.type) ? globalThis.String(object.type) : ""
53
- };
54
- },
55
- toJSON(message) {
56
- const obj = {};
57
- if (message.identifier !== "") {
58
- obj.identifier = message.identifier;
59
- }
60
- if (message.type !== "") {
61
- obj.type = message.type;
62
- }
63
- return obj;
64
- },
65
- create(base) {
66
- return SendOtpRequest.fromPartial(base ?? {});
67
- },
68
- fromPartial(object) {
69
- const message = createBaseSendOtpRequest();
70
- message.identifier = object.identifier ?? "";
71
- message.type = object.type ?? "";
72
- return message;
73
- }
1
+ // src/proto/path.ts
2
+ import { join } from "path";
3
+ var GRPC_PROTO_PATH = {
4
+ AUTH: join(__dirname, "../../proto/auth.proto")
74
5
  };
75
- function createBaseSendOtpResponse() {
76
- return { ok: false };
77
- }
78
- var SendOtpResponse = {
79
- encode(message, writer = new BinaryWriter()) {
80
- if (message.ok !== false) {
81
- writer.uint32(8).bool(message.ok);
82
- }
83
- return writer;
84
- },
85
- decode(input, length) {
86
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
87
- const end = length === void 0 ? reader.len : reader.pos + length;
88
- const message = createBaseSendOtpResponse();
89
- while (reader.pos < end) {
90
- const tag = reader.uint32();
91
- switch (tag >>> 3) {
92
- case 1: {
93
- if (tag !== 8) {
94
- break;
95
- }
96
- message.ok = reader.bool();
97
- continue;
98
- }
99
- }
100
- if ((tag & 7) === 4 || tag === 0) {
101
- break;
102
- }
103
- reader.skip(tag & 7);
104
- }
105
- return message;
106
- },
107
- fromJSON(object) {
108
- return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
109
- },
110
- toJSON(message) {
111
- const obj = {};
112
- if (message.ok !== false) {
113
- obj.ok = message.ok;
114
- }
115
- return obj;
116
- },
117
- create(base) {
118
- return SendOtpResponse.fromPartial(base ?? {});
119
- },
120
- fromPartial(object) {
121
- const message = createBaseSendOtpResponse();
122
- message.ok = object.ok ?? false;
123
- return message;
124
- }
125
- };
126
- function createBaseVerifyOtpRequest() {
127
- return { identifier: "", type: "", otp: "" };
128
- }
129
- var VerifyOtpRequest = {
130
- encode(message, writer = new BinaryWriter()) {
131
- if (message.identifier !== "") {
132
- writer.uint32(10).string(message.identifier);
133
- }
134
- if (message.type !== "") {
135
- writer.uint32(18).string(message.type);
136
- }
137
- if (message.otp !== "") {
138
- writer.uint32(26).string(message.otp);
139
- }
140
- return writer;
141
- },
142
- decode(input, length) {
143
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
144
- const end = length === void 0 ? reader.len : reader.pos + length;
145
- const message = createBaseVerifyOtpRequest();
146
- while (reader.pos < end) {
147
- const tag = reader.uint32();
148
- switch (tag >>> 3) {
149
- case 1: {
150
- if (tag !== 10) {
151
- break;
152
- }
153
- message.identifier = reader.string();
154
- continue;
155
- }
156
- case 2: {
157
- if (tag !== 18) {
158
- break;
159
- }
160
- message.type = reader.string();
161
- continue;
162
- }
163
- case 3: {
164
- if (tag !== 26) {
165
- break;
166
- }
167
- message.otp = reader.string();
168
- continue;
169
- }
170
- }
171
- if ((tag & 7) === 4 || tag === 0) {
172
- break;
173
- }
174
- reader.skip(tag & 7);
175
- }
176
- return message;
177
- },
178
- fromJSON(object) {
179
- return {
180
- identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
181
- type: isSet(object.type) ? globalThis.String(object.type) : "",
182
- otp: isSet(object.otp) ? globalThis.String(object.otp) : ""
183
- };
184
- },
185
- toJSON(message) {
186
- const obj = {};
187
- if (message.identifier !== "") {
188
- obj.identifier = message.identifier;
189
- }
190
- if (message.type !== "") {
191
- obj.type = message.type;
192
- }
193
- if (message.otp !== "") {
194
- obj.otp = message.otp;
195
- }
196
- return obj;
197
- },
198
- create(base) {
199
- return VerifyOtpRequest.fromPartial(base ?? {});
200
- },
201
- fromPartial(object) {
202
- const message = createBaseVerifyOtpRequest();
203
- message.identifier = object.identifier ?? "";
204
- message.type = object.type ?? "";
205
- message.otp = object.otp ?? "";
206
- return message;
207
- }
208
- };
209
- function createBaseVerifyOtpResponse() {
210
- return { token: "" };
211
- }
212
- var VerifyOtpResponse = {
213
- encode(message, writer = new BinaryWriter()) {
214
- if (message.token !== "") {
215
- writer.uint32(10).string(message.token);
216
- }
217
- return writer;
218
- },
219
- decode(input, length) {
220
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
221
- const end = length === void 0 ? reader.len : reader.pos + length;
222
- const message = createBaseVerifyOtpResponse();
223
- while (reader.pos < end) {
224
- const tag = reader.uint32();
225
- switch (tag >>> 3) {
226
- case 1: {
227
- if (tag !== 10) {
228
- break;
229
- }
230
- message.token = reader.string();
231
- continue;
232
- }
233
- }
234
- if ((tag & 7) === 4 || tag === 0) {
235
- break;
236
- }
237
- reader.skip(tag & 7);
238
- }
239
- return message;
240
- },
241
- fromJSON(object) {
242
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
243
- },
244
- toJSON(message) {
245
- const obj = {};
246
- if (message.token !== "") {
247
- obj.token = message.token;
248
- }
249
- return obj;
250
- },
251
- create(base) {
252
- return VerifyOtpResponse.fromPartial(base ?? {});
253
- },
254
- fromPartial(object) {
255
- const message = createBaseVerifyOtpResponse();
256
- message.token = object.token ?? "";
257
- return message;
258
- }
259
- };
260
- var AuthServiceService = {
261
- sendOtp: {
262
- path: "/auth.v1.AuthService/SendOtp",
263
- requestStream: false,
264
- responseStream: false,
265
- requestSerialize: (value) => Buffer.from(SendOtpRequest.encode(value).finish()),
266
- requestDeserialize: (value) => SendOtpRequest.decode(value),
267
- responseSerialize: (value) => Buffer.from(SendOtpResponse.encode(value).finish()),
268
- responseDeserialize: (value) => SendOtpResponse.decode(value)
269
- },
270
- verifyOtp: {
271
- path: "/auth.v1.AuthService/VerifyOtp",
272
- requestStream: false,
273
- responseStream: false,
274
- requestSerialize: (value) => Buffer.from(VerifyOtpRequest.encode(value).finish()),
275
- requestDeserialize: (value) => VerifyOtpRequest.decode(value),
276
- responseSerialize: (value) => Buffer.from(VerifyOtpResponse.encode(value).finish()),
277
- responseDeserialize: (value) => VerifyOtpResponse.decode(value)
278
- }
279
- };
280
- var AuthServiceClient = makeGenericClientConstructor(AuthServiceService, "auth.v1.AuthService");
281
- function isSet(value) {
282
- return value !== null && value !== void 0;
283
- }
284
-
285
- // src/index.ts
286
- var a = 1;
287
- var hello = () => {
288
- console.log("Hello World");
289
- };
290
- var index_default = { a, hello };
291
6
  export {
292
- AuthServiceClient,
293
- AuthServiceService,
294
- SendOtpRequest,
295
- SendOtpResponse,
296
- VerifyOtpRequest,
297
- VerifyOtpResponse,
298
- index_default as default,
299
- protobufPackage
7
+ GRPC_PROTO_PATH
300
8
  };
package/gen/ts/auth.ts CHANGED
@@ -33,11 +33,12 @@ export interface SendOtpResponse {
33
33
  export interface VerifyOtpRequest {
34
34
  identifier: string;
35
35
  type: string;
36
- otp: string;
36
+ code: string;
37
37
  }
38
38
 
39
39
  export interface VerifyOtpResponse {
40
- token: string;
40
+ accessToken: string;
41
+ refreshToken: string;
41
42
  }
42
43
 
43
44
  function createBaseSendOtpRequest(): SendOtpRequest {
@@ -175,7 +176,7 @@ export const SendOtpResponse: MessageFns<SendOtpResponse> = {
175
176
  };
176
177
 
177
178
  function createBaseVerifyOtpRequest(): VerifyOtpRequest {
178
- return { identifier: "", type: "", otp: "" };
179
+ return { identifier: "", type: "", code: "" };
179
180
  }
180
181
 
181
182
  export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
@@ -186,8 +187,8 @@ export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
186
187
  if (message.type !== "") {
187
188
  writer.uint32(18).string(message.type);
188
189
  }
189
- if (message.otp !== "") {
190
- writer.uint32(26).string(message.otp);
190
+ if (message.code !== "") {
191
+ writer.uint32(26).string(message.code);
191
192
  }
192
193
  return writer;
193
194
  },
@@ -220,7 +221,7 @@ export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
220
221
  break;
221
222
  }
222
223
 
223
- message.otp = reader.string();
224
+ message.code = reader.string();
224
225
  continue;
225
226
  }
226
227
  }
@@ -236,7 +237,7 @@ export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
236
237
  return {
237
238
  identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
238
239
  type: isSet(object.type) ? globalThis.String(object.type) : "",
239
- otp: isSet(object.otp) ? globalThis.String(object.otp) : "",
240
+ code: isSet(object.code) ? globalThis.String(object.code) : "",
240
241
  };
241
242
  },
242
243
 
@@ -248,8 +249,8 @@ export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
248
249
  if (message.type !== "") {
249
250
  obj.type = message.type;
250
251
  }
251
- if (message.otp !== "") {
252
- obj.otp = message.otp;
252
+ if (message.code !== "") {
253
+ obj.code = message.code;
253
254
  }
254
255
  return obj;
255
256
  },
@@ -261,19 +262,22 @@ export const VerifyOtpRequest: MessageFns<VerifyOtpRequest> = {
261
262
  const message = createBaseVerifyOtpRequest();
262
263
  message.identifier = object.identifier ?? "";
263
264
  message.type = object.type ?? "";
264
- message.otp = object.otp ?? "";
265
+ message.code = object.code ?? "";
265
266
  return message;
266
267
  },
267
268
  };
268
269
 
269
270
  function createBaseVerifyOtpResponse(): VerifyOtpResponse {
270
- return { token: "" };
271
+ return { accessToken: "", refreshToken: "" };
271
272
  }
272
273
 
273
274
  export const VerifyOtpResponse: MessageFns<VerifyOtpResponse> = {
274
275
  encode(message: VerifyOtpResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
275
- if (message.token !== "") {
276
- writer.uint32(10).string(message.token);
276
+ if (message.accessToken !== "") {
277
+ writer.uint32(10).string(message.accessToken);
278
+ }
279
+ if (message.refreshToken !== "") {
280
+ writer.uint32(18).string(message.refreshToken);
277
281
  }
278
282
  return writer;
279
283
  },
@@ -290,7 +294,15 @@ export const VerifyOtpResponse: MessageFns<VerifyOtpResponse> = {
290
294
  break;
291
295
  }
292
296
 
293
- message.token = reader.string();
297
+ message.accessToken = reader.string();
298
+ continue;
299
+ }
300
+ case 2: {
301
+ if (tag !== 18) {
302
+ break;
303
+ }
304
+
305
+ message.refreshToken = reader.string();
294
306
  continue;
295
307
  }
296
308
  }
@@ -303,13 +315,27 @@ export const VerifyOtpResponse: MessageFns<VerifyOtpResponse> = {
303
315
  },
304
316
 
305
317
  fromJSON(object: any): VerifyOtpResponse {
306
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
318
+ return {
319
+ accessToken: isSet(object.accessToken)
320
+ ? globalThis.String(object.accessToken)
321
+ : isSet(object.access_token)
322
+ ? globalThis.String(object.access_token)
323
+ : "",
324
+ refreshToken: isSet(object.refreshToken)
325
+ ? globalThis.String(object.refreshToken)
326
+ : isSet(object.refresh_token)
327
+ ? globalThis.String(object.refresh_token)
328
+ : "",
329
+ };
307
330
  },
308
331
 
309
332
  toJSON(message: VerifyOtpResponse): unknown {
310
333
  const obj: any = {};
311
- if (message.token !== "") {
312
- obj.token = message.token;
334
+ if (message.accessToken !== "") {
335
+ obj.accessToken = message.accessToken;
336
+ }
337
+ if (message.refreshToken !== "") {
338
+ obj.refreshToken = message.refreshToken;
313
339
  }
314
340
  return obj;
315
341
  },
@@ -319,7 +345,8 @@ export const VerifyOtpResponse: MessageFns<VerifyOtpResponse> = {
319
345
  },
320
346
  fromPartial<I extends Exact<DeepPartial<VerifyOtpResponse>, I>>(object: I): VerifyOtpResponse {
321
347
  const message = createBaseVerifyOtpResponse();
322
- message.token = object.token ?? "";
348
+ message.accessToken = object.accessToken ?? "";
349
+ message.refreshToken = object.refreshToken ?? "";
323
350
  return message;
324
351
  },
325
352
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sa2-movie-ticket/contracts",
3
3
  "description": "Contracts for movie ticket microservices",
4
- "version": "1.0.4",
4
+ "version": "1.0.6",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
@@ -29,7 +29,6 @@
29
29
  "repository": "sa2-movie-ticket/contracts",
30
30
  "devDependencies": {
31
31
  "@types/bun": "latest",
32
- "protoc": "^33.5.0",
33
32
  "ts-proto": "^2.11.2",
34
33
  "tsup": "^8.5.1"
35
34
  },
@@ -38,4 +37,4 @@
38
37
  "@bufbuild/protobuf": "^2.11.0",
39
38
  "@grpc/grpc-js": "^1.14.3"
40
39
  }
41
- }
40
+ }
package/proto/auth.proto CHANGED
@@ -21,10 +21,11 @@ message SendOtpResponse {
21
21
  message VerifyOtpRequest {
22
22
  string identifier = 1;
23
23
  string type = 2;
24
- string otp = 3;
24
+ string code = 3;
25
25
  }
26
26
 
27
27
  message VerifyOtpResponse {
28
- string token = 1;
28
+ string access_token = 1;
29
+ string refresh_token = 2;
29
30
  }
30
31