@sa2-movie-ticket/contracts 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -113,6 +113,9 @@ If you need to generate code locally:
113
113
  bun run generate
114
114
  ```
115
115
 
116
+ ---
117
+ ---
118
+
116
119
  # Details
117
120
 
118
121
  Shared Protobuf contracts and TypeScript definitions for the Movie Ticket microservices.
package/dist/index.d.mts CHANGED
@@ -14,11 +14,12 @@ declare const SendOtpResponse: MessageFns<SendOtpResponse>;
14
14
  interface VerifyOtpRequest {
15
15
  identifier: string;
16
16
  type: string;
17
- otp: string;
17
+ code: string;
18
18
  }
19
19
  declare const VerifyOtpRequest: MessageFns<VerifyOtpRequest>;
20
20
  interface VerifyOtpResponse {
21
- token: string;
21
+ accessToken: string;
22
+ refreshToken: string;
22
23
  }
23
24
  declare const VerifyOtpResponse: MessageFns<VerifyOtpResponse>;
24
25
  type AuthServiceService = typeof AuthServiceService;
package/dist/index.d.ts CHANGED
@@ -14,11 +14,12 @@ declare const SendOtpResponse: MessageFns<SendOtpResponse>;
14
14
  interface VerifyOtpRequest {
15
15
  identifier: string;
16
16
  type: string;
17
- otp: string;
17
+ code: string;
18
18
  }
19
19
  declare const VerifyOtpRequest: MessageFns<VerifyOtpRequest>;
20
20
  interface VerifyOtpResponse {
21
- token: string;
21
+ accessToken: string;
22
+ refreshToken: string;
22
23
  }
23
24
  declare const VerifyOtpResponse: MessageFns<VerifyOtpResponse>;
24
25
  type AuthServiceService = typeof AuthServiceService;
package/dist/index.js CHANGED
@@ -155,7 +155,7 @@ var SendOtpResponse = {
155
155
  }
156
156
  };
157
157
  function createBaseVerifyOtpRequest() {
158
- return { identifier: "", type: "", otp: "" };
158
+ return { identifier: "", type: "", code: "" };
159
159
  }
160
160
  var VerifyOtpRequest = {
161
161
  encode(message, writer = new import_wire.BinaryWriter()) {
@@ -165,8 +165,8 @@ var VerifyOtpRequest = {
165
165
  if (message.type !== "") {
166
166
  writer.uint32(18).string(message.type);
167
167
  }
168
- if (message.otp !== "") {
169
- writer.uint32(26).string(message.otp);
168
+ if (message.code !== "") {
169
+ writer.uint32(26).string(message.code);
170
170
  }
171
171
  return writer;
172
172
  },
@@ -195,7 +195,7 @@ var VerifyOtpRequest = {
195
195
  if (tag !== 26) {
196
196
  break;
197
197
  }
198
- message.otp = reader.string();
198
+ message.code = reader.string();
199
199
  continue;
200
200
  }
201
201
  }
@@ -210,7 +210,7 @@ var VerifyOtpRequest = {
210
210
  return {
211
211
  identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
212
212
  type: isSet(object.type) ? globalThis.String(object.type) : "",
213
- otp: isSet(object.otp) ? globalThis.String(object.otp) : ""
213
+ code: isSet(object.code) ? globalThis.String(object.code) : ""
214
214
  };
215
215
  },
216
216
  toJSON(message) {
@@ -221,8 +221,8 @@ var VerifyOtpRequest = {
221
221
  if (message.type !== "") {
222
222
  obj.type = message.type;
223
223
  }
224
- if (message.otp !== "") {
225
- obj.otp = message.otp;
224
+ if (message.code !== "") {
225
+ obj.code = message.code;
226
226
  }
227
227
  return obj;
228
228
  },
@@ -233,17 +233,20 @@ var VerifyOtpRequest = {
233
233
  const message = createBaseVerifyOtpRequest();
234
234
  message.identifier = object.identifier ?? "";
235
235
  message.type = object.type ?? "";
236
- message.otp = object.otp ?? "";
236
+ message.code = object.code ?? "";
237
237
  return message;
238
238
  }
239
239
  };
240
240
  function createBaseVerifyOtpResponse() {
241
- return { token: "" };
241
+ return { accessToken: "", refreshToken: "" };
242
242
  }
243
243
  var VerifyOtpResponse = {
244
244
  encode(message, writer = new import_wire.BinaryWriter()) {
245
- if (message.token !== "") {
246
- writer.uint32(10).string(message.token);
245
+ if (message.accessToken !== "") {
246
+ writer.uint32(10).string(message.accessToken);
247
+ }
248
+ if (message.refreshToken !== "") {
249
+ writer.uint32(18).string(message.refreshToken);
247
250
  }
248
251
  return writer;
249
252
  },
@@ -258,7 +261,14 @@ var VerifyOtpResponse = {
258
261
  if (tag !== 10) {
259
262
  break;
260
263
  }
261
- message.token = reader.string();
264
+ message.accessToken = reader.string();
265
+ continue;
266
+ }
267
+ case 2: {
268
+ if (tag !== 18) {
269
+ break;
270
+ }
271
+ message.refreshToken = reader.string();
262
272
  continue;
263
273
  }
264
274
  }
@@ -270,12 +280,18 @@ var VerifyOtpResponse = {
270
280
  return message;
271
281
  },
272
282
  fromJSON(object) {
273
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
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
+ };
274
287
  },
275
288
  toJSON(message) {
276
289
  const obj = {};
277
- if (message.token !== "") {
278
- obj.token = message.token;
290
+ if (message.accessToken !== "") {
291
+ obj.accessToken = message.accessToken;
292
+ }
293
+ if (message.refreshToken !== "") {
294
+ obj.refreshToken = message.refreshToken;
279
295
  }
280
296
  return obj;
281
297
  },
@@ -284,7 +300,8 @@ var VerifyOtpResponse = {
284
300
  },
285
301
  fromPartial(object) {
286
302
  const message = createBaseVerifyOtpResponse();
287
- message.token = object.token ?? "";
303
+ message.accessToken = object.accessToken ?? "";
304
+ message.refreshToken = object.refreshToken ?? "";
288
305
  return message;
289
306
  }
290
307
  };
package/dist/index.mjs CHANGED
@@ -124,7 +124,7 @@ var SendOtpResponse = {
124
124
  }
125
125
  };
126
126
  function createBaseVerifyOtpRequest() {
127
- return { identifier: "", type: "", otp: "" };
127
+ return { identifier: "", type: "", code: "" };
128
128
  }
129
129
  var VerifyOtpRequest = {
130
130
  encode(message, writer = new BinaryWriter()) {
@@ -134,8 +134,8 @@ var VerifyOtpRequest = {
134
134
  if (message.type !== "") {
135
135
  writer.uint32(18).string(message.type);
136
136
  }
137
- if (message.otp !== "") {
138
- writer.uint32(26).string(message.otp);
137
+ if (message.code !== "") {
138
+ writer.uint32(26).string(message.code);
139
139
  }
140
140
  return writer;
141
141
  },
@@ -164,7 +164,7 @@ var VerifyOtpRequest = {
164
164
  if (tag !== 26) {
165
165
  break;
166
166
  }
167
- message.otp = reader.string();
167
+ message.code = reader.string();
168
168
  continue;
169
169
  }
170
170
  }
@@ -179,7 +179,7 @@ var VerifyOtpRequest = {
179
179
  return {
180
180
  identifier: isSet(object.identifier) ? globalThis.String(object.identifier) : "",
181
181
  type: isSet(object.type) ? globalThis.String(object.type) : "",
182
- otp: isSet(object.otp) ? globalThis.String(object.otp) : ""
182
+ code: isSet(object.code) ? globalThis.String(object.code) : ""
183
183
  };
184
184
  },
185
185
  toJSON(message) {
@@ -190,8 +190,8 @@ var VerifyOtpRequest = {
190
190
  if (message.type !== "") {
191
191
  obj.type = message.type;
192
192
  }
193
- if (message.otp !== "") {
194
- obj.otp = message.otp;
193
+ if (message.code !== "") {
194
+ obj.code = message.code;
195
195
  }
196
196
  return obj;
197
197
  },
@@ -202,17 +202,20 @@ var VerifyOtpRequest = {
202
202
  const message = createBaseVerifyOtpRequest();
203
203
  message.identifier = object.identifier ?? "";
204
204
  message.type = object.type ?? "";
205
- message.otp = object.otp ?? "";
205
+ message.code = object.code ?? "";
206
206
  return message;
207
207
  }
208
208
  };
209
209
  function createBaseVerifyOtpResponse() {
210
- return { token: "" };
210
+ return { accessToken: "", refreshToken: "" };
211
211
  }
212
212
  var VerifyOtpResponse = {
213
213
  encode(message, writer = new BinaryWriter()) {
214
- if (message.token !== "") {
215
- writer.uint32(10).string(message.token);
214
+ if (message.accessToken !== "") {
215
+ writer.uint32(10).string(message.accessToken);
216
+ }
217
+ if (message.refreshToken !== "") {
218
+ writer.uint32(18).string(message.refreshToken);
216
219
  }
217
220
  return writer;
218
221
  },
@@ -227,7 +230,14 @@ var VerifyOtpResponse = {
227
230
  if (tag !== 10) {
228
231
  break;
229
232
  }
230
- message.token = reader.string();
233
+ message.accessToken = reader.string();
234
+ continue;
235
+ }
236
+ case 2: {
237
+ if (tag !== 18) {
238
+ break;
239
+ }
240
+ message.refreshToken = reader.string();
231
241
  continue;
232
242
  }
233
243
  }
@@ -239,12 +249,18 @@ var VerifyOtpResponse = {
239
249
  return message;
240
250
  },
241
251
  fromJSON(object) {
242
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
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
+ };
243
256
  },
244
257
  toJSON(message) {
245
258
  const obj = {};
246
- if (message.token !== "") {
247
- obj.token = message.token;
259
+ if (message.accessToken !== "") {
260
+ obj.accessToken = message.accessToken;
261
+ }
262
+ if (message.refreshToken !== "") {
263
+ obj.refreshToken = message.refreshToken;
248
264
  }
249
265
  return obj;
250
266
  },
@@ -253,7 +269,8 @@ var VerifyOtpResponse = {
253
269
  },
254
270
  fromPartial(object) {
255
271
  const message = createBaseVerifyOtpResponse();
256
- message.token = object.token ?? "";
272
+ message.accessToken = object.accessToken ?? "";
273
+ message.refreshToken = object.refreshToken ?? "";
257
274
  return message;
258
275
  }
259
276
  };
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,12 +1,9 @@
1
1
  {
2
2
  "name": "@sa2-movie-ticket/contracts",
3
3
  "description": "Contracts for movie ticket microservices",
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",
7
- "publishConfig": {
8
- "access": "public"
9
- },
10
7
  "main": "dist/index.js",
11
8
  "module": "dist/index.mjs",
12
9
  "scripts": {
@@ -25,10 +22,11 @@
25
22
  "email": "sa2avroo@gmail.com",
26
23
  "url": "https://github.com/sa3akash"
27
24
  },
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/sa2-movie-ticket/contracts.git"
25
+ "publishConfig": {
26
+ "registry": "https://npm.pkg.github.com",
27
+ "access": "public"
31
28
  },
29
+ "repository": "sa2-movie-ticket/contracts",
32
30
  "devDependencies": {
33
31
  "@types/bun": "latest",
34
32
  "protoc": "^33.5.0",
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