@sa2-movie-ticket/contracts 1.0.5 → 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 +3 -85
- package/dist/index.d.ts +3 -85
- package/dist/index.js +6 -319
- package/dist/index.mjs +5 -314
- package/package.json +2 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,87 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
code: string;
|
|
18
|
-
}
|
|
19
|
-
declare const VerifyOtpRequest: MessageFns<VerifyOtpRequest>;
|
|
20
|
-
interface VerifyOtpResponse {
|
|
21
|
-
accessToken: string;
|
|
22
|
-
refreshToken: string;
|
|
23
|
-
}
|
|
24
|
-
declare const VerifyOtpResponse: MessageFns<VerifyOtpResponse>;
|
|
25
|
-
type AuthServiceService = typeof AuthServiceService;
|
|
26
|
-
declare const AuthServiceService: {
|
|
27
|
-
readonly sendOtp: {
|
|
28
|
-
readonly path: "/auth.v1.AuthService/SendOtp";
|
|
29
|
-
readonly requestStream: false;
|
|
30
|
-
readonly responseStream: false;
|
|
31
|
-
readonly requestSerialize: (value: SendOtpRequest) => Buffer;
|
|
32
|
-
readonly requestDeserialize: (value: Buffer) => SendOtpRequest;
|
|
33
|
-
readonly responseSerialize: (value: SendOtpResponse) => Buffer;
|
|
34
|
-
readonly responseDeserialize: (value: Buffer) => SendOtpResponse;
|
|
35
|
-
};
|
|
36
|
-
readonly verifyOtp: {
|
|
37
|
-
readonly path: "/auth.v1.AuthService/VerifyOtp";
|
|
38
|
-
readonly requestStream: false;
|
|
39
|
-
readonly responseStream: false;
|
|
40
|
-
readonly requestSerialize: (value: VerifyOtpRequest) => Buffer;
|
|
41
|
-
readonly requestDeserialize: (value: Buffer) => VerifyOtpRequest;
|
|
42
|
-
readonly responseSerialize: (value: VerifyOtpResponse) => Buffer;
|
|
43
|
-
readonly responseDeserialize: (value: Buffer) => VerifyOtpResponse;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
interface AuthServiceServer extends UntypedServiceImplementation {
|
|
47
|
-
sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
|
|
48
|
-
verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
|
|
49
|
-
}
|
|
50
|
-
interface AuthServiceClient extends Client {
|
|
51
|
-
sendOtp(request: SendOtpRequest, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
|
|
52
|
-
sendOtp(request: SendOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
|
|
53
|
-
sendOtp(request: SendOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
|
|
54
|
-
verifyOtp(request: VerifyOtpRequest, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
|
|
55
|
-
verifyOtp(request: VerifyOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
|
|
56
|
-
verifyOtp(request: VerifyOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
|
|
57
|
-
}
|
|
58
|
-
declare const AuthServiceClient: {
|
|
59
|
-
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): AuthServiceClient;
|
|
60
|
-
service: typeof AuthServiceService;
|
|
61
|
-
serviceName: string;
|
|
62
|
-
};
|
|
63
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
64
|
-
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 {} ? {
|
|
65
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
66
|
-
} : Partial<T>;
|
|
67
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
68
|
-
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
69
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
70
|
-
} & {
|
|
71
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
72
|
-
};
|
|
73
|
-
interface MessageFns<T> {
|
|
74
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
75
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
76
|
-
fromJSON(object: any): T;
|
|
77
|
-
toJSON(message: T): unknown;
|
|
78
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
79
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare const _default: {
|
|
83
|
-
a: number;
|
|
84
|
-
hello: () => void;
|
|
1
|
+
declare const GRPC_PROTO_PATH: {
|
|
2
|
+
readonly AUTH: string;
|
|
85
3
|
};
|
|
86
4
|
|
|
87
|
-
export {
|
|
5
|
+
export { GRPC_PROTO_PATH };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,87 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
code: string;
|
|
18
|
-
}
|
|
19
|
-
declare const VerifyOtpRequest: MessageFns<VerifyOtpRequest>;
|
|
20
|
-
interface VerifyOtpResponse {
|
|
21
|
-
accessToken: string;
|
|
22
|
-
refreshToken: string;
|
|
23
|
-
}
|
|
24
|
-
declare const VerifyOtpResponse: MessageFns<VerifyOtpResponse>;
|
|
25
|
-
type AuthServiceService = typeof AuthServiceService;
|
|
26
|
-
declare const AuthServiceService: {
|
|
27
|
-
readonly sendOtp: {
|
|
28
|
-
readonly path: "/auth.v1.AuthService/SendOtp";
|
|
29
|
-
readonly requestStream: false;
|
|
30
|
-
readonly responseStream: false;
|
|
31
|
-
readonly requestSerialize: (value: SendOtpRequest) => Buffer;
|
|
32
|
-
readonly requestDeserialize: (value: Buffer) => SendOtpRequest;
|
|
33
|
-
readonly responseSerialize: (value: SendOtpResponse) => Buffer;
|
|
34
|
-
readonly responseDeserialize: (value: Buffer) => SendOtpResponse;
|
|
35
|
-
};
|
|
36
|
-
readonly verifyOtp: {
|
|
37
|
-
readonly path: "/auth.v1.AuthService/VerifyOtp";
|
|
38
|
-
readonly requestStream: false;
|
|
39
|
-
readonly responseStream: false;
|
|
40
|
-
readonly requestSerialize: (value: VerifyOtpRequest) => Buffer;
|
|
41
|
-
readonly requestDeserialize: (value: Buffer) => VerifyOtpRequest;
|
|
42
|
-
readonly responseSerialize: (value: VerifyOtpResponse) => Buffer;
|
|
43
|
-
readonly responseDeserialize: (value: Buffer) => VerifyOtpResponse;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
interface AuthServiceServer extends UntypedServiceImplementation {
|
|
47
|
-
sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
|
|
48
|
-
verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
|
|
49
|
-
}
|
|
50
|
-
interface AuthServiceClient extends Client {
|
|
51
|
-
sendOtp(request: SendOtpRequest, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
|
|
52
|
-
sendOtp(request: SendOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
|
|
53
|
-
sendOtp(request: SendOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: SendOtpResponse) => void): ClientUnaryCall;
|
|
54
|
-
verifyOtp(request: VerifyOtpRequest, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
|
|
55
|
-
verifyOtp(request: VerifyOtpRequest, metadata: Metadata, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
|
|
56
|
-
verifyOtp(request: VerifyOtpRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: VerifyOtpResponse) => void): ClientUnaryCall;
|
|
57
|
-
}
|
|
58
|
-
declare const AuthServiceClient: {
|
|
59
|
-
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): AuthServiceClient;
|
|
60
|
-
service: typeof AuthServiceService;
|
|
61
|
-
serviceName: string;
|
|
62
|
-
};
|
|
63
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
64
|
-
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 {} ? {
|
|
65
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
66
|
-
} : Partial<T>;
|
|
67
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
68
|
-
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
69
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
70
|
-
} & {
|
|
71
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
72
|
-
};
|
|
73
|
-
interface MessageFns<T> {
|
|
74
|
-
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
75
|
-
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
76
|
-
fromJSON(object: any): T;
|
|
77
|
-
toJSON(message: T): unknown;
|
|
78
|
-
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
79
|
-
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare const _default: {
|
|
83
|
-
a: number;
|
|
84
|
-
hello: () => void;
|
|
1
|
+
declare const GRPC_PROTO_PATH: {
|
|
2
|
+
readonly AUTH: string;
|
|
85
3
|
};
|
|
86
4
|
|
|
87
|
-
export {
|
|
5
|
+
export { GRPC_PROTO_PATH };
|
package/dist/index.js
CHANGED
|
@@ -20,329 +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
|
-
|
|
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
|
-
//
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
|
|
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: "", code: "" };
|
|
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.code !== "") {
|
|
169
|
-
writer.uint32(26).string(message.code);
|
|
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.code = 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
|
-
code: isSet(object.code) ? globalThis.String(object.code) : ""
|
|
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.code !== "") {
|
|
225
|
-
obj.code = message.code;
|
|
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.code = object.code ?? "";
|
|
237
|
-
return message;
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
function createBaseVerifyOtpResponse() {
|
|
241
|
-
return { accessToken: "", refreshToken: "" };
|
|
242
|
-
}
|
|
243
|
-
var VerifyOtpResponse = {
|
|
244
|
-
encode(message, writer = new import_wire.BinaryWriter()) {
|
|
245
|
-
if (message.accessToken !== "") {
|
|
246
|
-
writer.uint32(10).string(message.accessToken);
|
|
247
|
-
}
|
|
248
|
-
if (message.refreshToken !== "") {
|
|
249
|
-
writer.uint32(18).string(message.refreshToken);
|
|
250
|
-
}
|
|
251
|
-
return writer;
|
|
252
|
-
},
|
|
253
|
-
decode(input, length) {
|
|
254
|
-
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
|
|
255
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
256
|
-
const message = createBaseVerifyOtpResponse();
|
|
257
|
-
while (reader.pos < end) {
|
|
258
|
-
const tag = reader.uint32();
|
|
259
|
-
switch (tag >>> 3) {
|
|
260
|
-
case 1: {
|
|
261
|
-
if (tag !== 10) {
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
message.accessToken = reader.string();
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
case 2: {
|
|
268
|
-
if (tag !== 18) {
|
|
269
|
-
break;
|
|
270
|
-
}
|
|
271
|
-
message.refreshToken = reader.string();
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
276
|
-
break;
|
|
277
|
-
}
|
|
278
|
-
reader.skip(tag & 7);
|
|
279
|
-
}
|
|
280
|
-
return message;
|
|
281
|
-
},
|
|
282
|
-
fromJSON(object) {
|
|
283
|
-
return {
|
|
284
|
-
accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : isSet(object.access_token) ? globalThis.String(object.access_token) : "",
|
|
285
|
-
refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : isSet(object.refresh_token) ? globalThis.String(object.refresh_token) : ""
|
|
286
|
-
};
|
|
287
|
-
},
|
|
288
|
-
toJSON(message) {
|
|
289
|
-
const obj = {};
|
|
290
|
-
if (message.accessToken !== "") {
|
|
291
|
-
obj.accessToken = message.accessToken;
|
|
292
|
-
}
|
|
293
|
-
if (message.refreshToken !== "") {
|
|
294
|
-
obj.refreshToken = message.refreshToken;
|
|
295
|
-
}
|
|
296
|
-
return obj;
|
|
297
|
-
},
|
|
298
|
-
create(base) {
|
|
299
|
-
return VerifyOtpResponse.fromPartial(base ?? {});
|
|
300
|
-
},
|
|
301
|
-
fromPartial(object) {
|
|
302
|
-
const message = createBaseVerifyOtpResponse();
|
|
303
|
-
message.accessToken = object.accessToken ?? "";
|
|
304
|
-
message.refreshToken = object.refreshToken ?? "";
|
|
305
|
-
return message;
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
var AuthServiceService = {
|
|
309
|
-
sendOtp: {
|
|
310
|
-
path: "/auth.v1.AuthService/SendOtp",
|
|
311
|
-
requestStream: false,
|
|
312
|
-
responseStream: false,
|
|
313
|
-
requestSerialize: (value) => Buffer.from(SendOtpRequest.encode(value).finish()),
|
|
314
|
-
requestDeserialize: (value) => SendOtpRequest.decode(value),
|
|
315
|
-
responseSerialize: (value) => Buffer.from(SendOtpResponse.encode(value).finish()),
|
|
316
|
-
responseDeserialize: (value) => SendOtpResponse.decode(value)
|
|
317
|
-
},
|
|
318
|
-
verifyOtp: {
|
|
319
|
-
path: "/auth.v1.AuthService/VerifyOtp",
|
|
320
|
-
requestStream: false,
|
|
321
|
-
responseStream: false,
|
|
322
|
-
requestSerialize: (value) => Buffer.from(VerifyOtpRequest.encode(value).finish()),
|
|
323
|
-
requestDeserialize: (value) => VerifyOtpRequest.decode(value),
|
|
324
|
-
responseSerialize: (value) => Buffer.from(VerifyOtpResponse.encode(value).finish()),
|
|
325
|
-
responseDeserialize: (value) => VerifyOtpResponse.decode(value)
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
var AuthServiceClient = (0, import_grpc_js.makeGenericClientConstructor)(AuthServiceService, "auth.v1.AuthService");
|
|
329
|
-
function isSet(value) {
|
|
330
|
-
return value !== null && value !== void 0;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// src/index.ts
|
|
334
|
-
var a = 1;
|
|
335
|
-
var hello = () => {
|
|
336
|
-
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")
|
|
337
31
|
};
|
|
338
|
-
var index_default = { a, hello };
|
|
339
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
340
33
|
0 && (module.exports = {
|
|
341
|
-
|
|
342
|
-
AuthServiceService,
|
|
343
|
-
SendOtpRequest,
|
|
344
|
-
SendOtpResponse,
|
|
345
|
-
VerifyOtpRequest,
|
|
346
|
-
VerifyOtpResponse,
|
|
347
|
-
protobufPackage
|
|
34
|
+
GRPC_PROTO_PATH
|
|
348
35
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,317 +1,8 @@
|
|
|
1
|
-
//
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
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: "", code: "" };
|
|
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.code !== "") {
|
|
138
|
-
writer.uint32(26).string(message.code);
|
|
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.code = 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
|
-
code: isSet(object.code) ? globalThis.String(object.code) : ""
|
|
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.code !== "") {
|
|
194
|
-
obj.code = message.code;
|
|
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.code = object.code ?? "";
|
|
206
|
-
return message;
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
function createBaseVerifyOtpResponse() {
|
|
210
|
-
return { accessToken: "", refreshToken: "" };
|
|
211
|
-
}
|
|
212
|
-
var VerifyOtpResponse = {
|
|
213
|
-
encode(message, writer = new BinaryWriter()) {
|
|
214
|
-
if (message.accessToken !== "") {
|
|
215
|
-
writer.uint32(10).string(message.accessToken);
|
|
216
|
-
}
|
|
217
|
-
if (message.refreshToken !== "") {
|
|
218
|
-
writer.uint32(18).string(message.refreshToken);
|
|
219
|
-
}
|
|
220
|
-
return writer;
|
|
221
|
-
},
|
|
222
|
-
decode(input, length) {
|
|
223
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
224
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
225
|
-
const message = createBaseVerifyOtpResponse();
|
|
226
|
-
while (reader.pos < end) {
|
|
227
|
-
const tag = reader.uint32();
|
|
228
|
-
switch (tag >>> 3) {
|
|
229
|
-
case 1: {
|
|
230
|
-
if (tag !== 10) {
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
message.accessToken = reader.string();
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
case 2: {
|
|
237
|
-
if (tag !== 18) {
|
|
238
|
-
break;
|
|
239
|
-
}
|
|
240
|
-
message.refreshToken = reader.string();
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
reader.skip(tag & 7);
|
|
248
|
-
}
|
|
249
|
-
return message;
|
|
250
|
-
},
|
|
251
|
-
fromJSON(object) {
|
|
252
|
-
return {
|
|
253
|
-
accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : isSet(object.access_token) ? globalThis.String(object.access_token) : "",
|
|
254
|
-
refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : isSet(object.refresh_token) ? globalThis.String(object.refresh_token) : ""
|
|
255
|
-
};
|
|
256
|
-
},
|
|
257
|
-
toJSON(message) {
|
|
258
|
-
const obj = {};
|
|
259
|
-
if (message.accessToken !== "") {
|
|
260
|
-
obj.accessToken = message.accessToken;
|
|
261
|
-
}
|
|
262
|
-
if (message.refreshToken !== "") {
|
|
263
|
-
obj.refreshToken = message.refreshToken;
|
|
264
|
-
}
|
|
265
|
-
return obj;
|
|
266
|
-
},
|
|
267
|
-
create(base) {
|
|
268
|
-
return VerifyOtpResponse.fromPartial(base ?? {});
|
|
269
|
-
},
|
|
270
|
-
fromPartial(object) {
|
|
271
|
-
const message = createBaseVerifyOtpResponse();
|
|
272
|
-
message.accessToken = object.accessToken ?? "";
|
|
273
|
-
message.refreshToken = object.refreshToken ?? "";
|
|
274
|
-
return message;
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
var AuthServiceService = {
|
|
278
|
-
sendOtp: {
|
|
279
|
-
path: "/auth.v1.AuthService/SendOtp",
|
|
280
|
-
requestStream: false,
|
|
281
|
-
responseStream: false,
|
|
282
|
-
requestSerialize: (value) => Buffer.from(SendOtpRequest.encode(value).finish()),
|
|
283
|
-
requestDeserialize: (value) => SendOtpRequest.decode(value),
|
|
284
|
-
responseSerialize: (value) => Buffer.from(SendOtpResponse.encode(value).finish()),
|
|
285
|
-
responseDeserialize: (value) => SendOtpResponse.decode(value)
|
|
286
|
-
},
|
|
287
|
-
verifyOtp: {
|
|
288
|
-
path: "/auth.v1.AuthService/VerifyOtp",
|
|
289
|
-
requestStream: false,
|
|
290
|
-
responseStream: false,
|
|
291
|
-
requestSerialize: (value) => Buffer.from(VerifyOtpRequest.encode(value).finish()),
|
|
292
|
-
requestDeserialize: (value) => VerifyOtpRequest.decode(value),
|
|
293
|
-
responseSerialize: (value) => Buffer.from(VerifyOtpResponse.encode(value).finish()),
|
|
294
|
-
responseDeserialize: (value) => VerifyOtpResponse.decode(value)
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
var AuthServiceClient = makeGenericClientConstructor(AuthServiceService, "auth.v1.AuthService");
|
|
298
|
-
function isSet(value) {
|
|
299
|
-
return value !== null && value !== void 0;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// src/index.ts
|
|
303
|
-
var a = 1;
|
|
304
|
-
var hello = () => {
|
|
305
|
-
console.log("Hello World");
|
|
306
|
-
};
|
|
307
|
-
var index_default = { a, hello };
|
|
308
6
|
export {
|
|
309
|
-
|
|
310
|
-
AuthServiceService,
|
|
311
|
-
SendOtpRequest,
|
|
312
|
-
SendOtpResponse,
|
|
313
|
-
VerifyOtpRequest,
|
|
314
|
-
VerifyOtpResponse,
|
|
315
|
-
index_default as default,
|
|
316
|
-
protobufPackage
|
|
7
|
+
GRPC_PROTO_PATH
|
|
317
8
|
};
|
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
|
+
"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
|
+
}
|