@sa2-movie-ticket/contracts 1.0.6 → 1.0.8

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.js CHANGED
@@ -1,35 +1 @@
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
- GRPC_PROTO_PATH: () => GRPC_PROTO_PATH
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
-
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")
31
- };
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- GRPC_PROTO_PATH
35
- });
1
+ 'use strict';var path=require('path');var t={AUTH:path.join(__dirname,"../../proto/auth.proto")};exports.GRPC_PROTO_PATH=t;
package/dist/index.mjs CHANGED
@@ -1,8 +1 @@
1
- // src/proto/path.ts
2
- import { join } from "path";
3
- var GRPC_PROTO_PATH = {
4
- AUTH: join(__dirname, "../../proto/auth.proto")
5
- };
6
- export {
7
- GRPC_PROTO_PATH
8
- };
1
+ import {join}from'path';var t={AUTH:join(__dirname,"../../proto/auth.proto")};export{t as GRPC_PROTO_PATH};
package/gen/ts/auth.ts CHANGED
@@ -41,6 +41,15 @@ export interface VerifyOtpResponse {
41
41
  refreshToken: string;
42
42
  }
43
43
 
44
+ export interface RefreshRequest {
45
+ refreshToken: string;
46
+ }
47
+
48
+ export interface RefreshResponse {
49
+ accessToken: string;
50
+ refreshToken: string;
51
+ }
52
+
44
53
  function createBaseSendOtpRequest(): SendOtpRequest {
45
54
  return { identifier: "", type: "" };
46
55
  }
@@ -351,6 +360,154 @@ export const VerifyOtpResponse: MessageFns<VerifyOtpResponse> = {
351
360
  },
352
361
  };
353
362
 
363
+ function createBaseRefreshRequest(): RefreshRequest {
364
+ return { refreshToken: "" };
365
+ }
366
+
367
+ export const RefreshRequest: MessageFns<RefreshRequest> = {
368
+ encode(message: RefreshRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
369
+ if (message.refreshToken !== "") {
370
+ writer.uint32(10).string(message.refreshToken);
371
+ }
372
+ return writer;
373
+ },
374
+
375
+ decode(input: BinaryReader | Uint8Array, length?: number): RefreshRequest {
376
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
377
+ const end = length === undefined ? reader.len : reader.pos + length;
378
+ const message = createBaseRefreshRequest();
379
+ while (reader.pos < end) {
380
+ const tag = reader.uint32();
381
+ switch (tag >>> 3) {
382
+ case 1: {
383
+ if (tag !== 10) {
384
+ break;
385
+ }
386
+
387
+ message.refreshToken = reader.string();
388
+ continue;
389
+ }
390
+ }
391
+ if ((tag & 7) === 4 || tag === 0) {
392
+ break;
393
+ }
394
+ reader.skip(tag & 7);
395
+ }
396
+ return message;
397
+ },
398
+
399
+ fromJSON(object: any): RefreshRequest {
400
+ return {
401
+ refreshToken: isSet(object.refreshToken)
402
+ ? globalThis.String(object.refreshToken)
403
+ : isSet(object.refresh_token)
404
+ ? globalThis.String(object.refresh_token)
405
+ : "",
406
+ };
407
+ },
408
+
409
+ toJSON(message: RefreshRequest): unknown {
410
+ const obj: any = {};
411
+ if (message.refreshToken !== "") {
412
+ obj.refreshToken = message.refreshToken;
413
+ }
414
+ return obj;
415
+ },
416
+
417
+ create<I extends Exact<DeepPartial<RefreshRequest>, I>>(base?: I): RefreshRequest {
418
+ return RefreshRequest.fromPartial(base ?? ({} as any));
419
+ },
420
+ fromPartial<I extends Exact<DeepPartial<RefreshRequest>, I>>(object: I): RefreshRequest {
421
+ const message = createBaseRefreshRequest();
422
+ message.refreshToken = object.refreshToken ?? "";
423
+ return message;
424
+ },
425
+ };
426
+
427
+ function createBaseRefreshResponse(): RefreshResponse {
428
+ return { accessToken: "", refreshToken: "" };
429
+ }
430
+
431
+ export const RefreshResponse: MessageFns<RefreshResponse> = {
432
+ encode(message: RefreshResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
433
+ if (message.accessToken !== "") {
434
+ writer.uint32(10).string(message.accessToken);
435
+ }
436
+ if (message.refreshToken !== "") {
437
+ writer.uint32(18).string(message.refreshToken);
438
+ }
439
+ return writer;
440
+ },
441
+
442
+ decode(input: BinaryReader | Uint8Array, length?: number): RefreshResponse {
443
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
444
+ const end = length === undefined ? reader.len : reader.pos + length;
445
+ const message = createBaseRefreshResponse();
446
+ while (reader.pos < end) {
447
+ const tag = reader.uint32();
448
+ switch (tag >>> 3) {
449
+ case 1: {
450
+ if (tag !== 10) {
451
+ break;
452
+ }
453
+
454
+ message.accessToken = reader.string();
455
+ continue;
456
+ }
457
+ case 2: {
458
+ if (tag !== 18) {
459
+ break;
460
+ }
461
+
462
+ message.refreshToken = reader.string();
463
+ continue;
464
+ }
465
+ }
466
+ if ((tag & 7) === 4 || tag === 0) {
467
+ break;
468
+ }
469
+ reader.skip(tag & 7);
470
+ }
471
+ return message;
472
+ },
473
+
474
+ fromJSON(object: any): RefreshResponse {
475
+ return {
476
+ accessToken: isSet(object.accessToken)
477
+ ? globalThis.String(object.accessToken)
478
+ : isSet(object.access_token)
479
+ ? globalThis.String(object.access_token)
480
+ : "",
481
+ refreshToken: isSet(object.refreshToken)
482
+ ? globalThis.String(object.refreshToken)
483
+ : isSet(object.refresh_token)
484
+ ? globalThis.String(object.refresh_token)
485
+ : "",
486
+ };
487
+ },
488
+
489
+ toJSON(message: RefreshResponse): unknown {
490
+ const obj: any = {};
491
+ if (message.accessToken !== "") {
492
+ obj.accessToken = message.accessToken;
493
+ }
494
+ if (message.refreshToken !== "") {
495
+ obj.refreshToken = message.refreshToken;
496
+ }
497
+ return obj;
498
+ },
499
+
500
+ create<I extends Exact<DeepPartial<RefreshResponse>, I>>(base?: I): RefreshResponse {
501
+ return RefreshResponse.fromPartial(base ?? ({} as any));
502
+ },
503
+ fromPartial<I extends Exact<DeepPartial<RefreshResponse>, I>>(object: I): RefreshResponse {
504
+ const message = createBaseRefreshResponse();
505
+ message.accessToken = object.accessToken ?? "";
506
+ message.refreshToken = object.refreshToken ?? "";
507
+ return message;
508
+ },
509
+ };
510
+
354
511
  export type AuthServiceService = typeof AuthServiceService;
355
512
  export const AuthServiceService = {
356
513
  sendOtp: {
@@ -371,11 +528,21 @@ export const AuthServiceService = {
371
528
  responseSerialize: (value: VerifyOtpResponse): Buffer => Buffer.from(VerifyOtpResponse.encode(value).finish()),
372
529
  responseDeserialize: (value: Buffer): VerifyOtpResponse => VerifyOtpResponse.decode(value),
373
530
  },
531
+ refresh: {
532
+ path: "/auth.v1.AuthService/Refresh",
533
+ requestStream: false,
534
+ responseStream: false,
535
+ requestSerialize: (value: RefreshRequest): Buffer => Buffer.from(RefreshRequest.encode(value).finish()),
536
+ requestDeserialize: (value: Buffer): RefreshRequest => RefreshRequest.decode(value),
537
+ responseSerialize: (value: RefreshResponse): Buffer => Buffer.from(RefreshResponse.encode(value).finish()),
538
+ responseDeserialize: (value: Buffer): RefreshResponse => RefreshResponse.decode(value),
539
+ },
374
540
  } as const;
375
541
 
376
542
  export interface AuthServiceServer extends UntypedServiceImplementation {
377
543
  sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
378
544
  verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
545
+ refresh: handleUnaryCall<RefreshRequest, RefreshResponse>;
379
546
  }
380
547
 
381
548
  export interface AuthServiceClient extends Client {
@@ -409,6 +576,21 @@ export interface AuthServiceClient extends Client {
409
576
  options: Partial<CallOptions>,
410
577
  callback: (error: ServiceError | null, response: VerifyOtpResponse) => void,
411
578
  ): ClientUnaryCall;
579
+ refresh(
580
+ request: RefreshRequest,
581
+ callback: (error: ServiceError | null, response: RefreshResponse) => void,
582
+ ): ClientUnaryCall;
583
+ refresh(
584
+ request: RefreshRequest,
585
+ metadata: Metadata,
586
+ callback: (error: ServiceError | null, response: RefreshResponse) => void,
587
+ ): ClientUnaryCall;
588
+ refresh(
589
+ request: RefreshRequest,
590
+ metadata: Metadata,
591
+ options: Partial<CallOptions>,
592
+ callback: (error: ServiceError | null, response: RefreshResponse) => void,
593
+ ): ClientUnaryCall;
412
594
  }
413
595
 
414
596
  export const AuthServiceClient = makeGenericClientConstructor(AuthServiceService, "auth.v1.AuthService") as unknown as {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sa2-movie-ticket/contracts",
3
3
  "description": "Contracts for movie ticket microservices",
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.mjs",
9
9
  "scripts": {
10
- "build": "tsup src/index.ts --format esm,cjs --dts --clean",
10
+ "build": "tsup",
11
11
  "generate": "bun run generate:ts && bun run generate:go",
12
12
  "generate:ts": "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
13
  "generate:go": "protoc --go_out=. --go_opt=module=github.com/sa2-movie-ticket/contracts --go-grpc_out=. --go-grpc_opt=module=github.com/sa2-movie-ticket/contracts -I=./proto ./proto/*.proto"
package/proto/auth.proto CHANGED
@@ -7,6 +7,7 @@ option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/auth";
7
7
  service AuthService {
8
8
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
9
9
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
10
+ rpc Refresh(RefreshRequest) returns (RefreshResponse);
10
11
  }
11
12
 
12
13
  message SendOtpRequest {
@@ -29,3 +30,12 @@ message VerifyOtpResponse {
29
30
  string refresh_token = 2;
30
31
  }
31
32
 
33
+ message RefreshRequest {
34
+ string refresh_token = 1;
35
+ }
36
+
37
+ message RefreshResponse {
38
+ string access_token = 1;
39
+ string refresh_token = 2;
40
+ }
41
+