geniebox-shared-lib 1.0.29 → 1.0.31

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.
@@ -51,9 +51,7 @@ export interface ResetPasswordRequest {
51
51
  code: string;
52
52
  newPassword: string;
53
53
  }
54
- export interface RefreshTokenRequest {
55
- userId: string;
56
- sessionId: string;
54
+ export interface RefreshRequest {
57
55
  refreshToken: string;
58
56
  }
59
57
  export interface RefreshTokenResponse {
@@ -68,16 +66,18 @@ export declare const UserResponse: MessageFns<UserResponse>;
68
66
  export declare const LogoutRequest: MessageFns<LogoutRequest>;
69
67
  export declare const ForgotPasswordRequest: MessageFns<ForgotPasswordRequest>;
70
68
  export declare const ResetPasswordRequest: MessageFns<ResetPasswordRequest>;
71
- export declare const RefreshTokenRequest: MessageFns<RefreshTokenRequest>;
69
+ export declare const RefreshRequest: MessageFns<RefreshRequest>;
72
70
  export declare const RefreshTokenResponse: MessageFns<RefreshTokenResponse>;
73
71
  export interface AuthServiceClient {
74
72
  login(request: LoginCredentials, metadata?: Metadata): Observable<AuthResponse>;
75
73
  register(request: RegisterCredentials, metadata?: Metadata): Observable<AuthResponse>;
74
+ refresh(request: RefreshRequest, metadata?: Metadata): Observable<AuthResponse>;
76
75
  logout(request: LogoutRequest, metadata?: Metadata): Observable<Empty>;
77
76
  }
78
77
  export interface AuthServiceController {
79
78
  login(request: LoginCredentials, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
80
79
  register(request: RegisterCredentials, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
80
+ refresh(request: RefreshRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
81
81
  logout(request: LogoutRequest, metadata?: Metadata): void;
82
82
  }
83
83
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
@@ -102,6 +102,15 @@ export declare const AuthServiceService: {
102
102
  readonly responseSerialize: (value: AuthResponse) => Buffer;
103
103
  readonly responseDeserialize: (value: Buffer) => AuthResponse;
104
104
  };
105
+ readonly refresh: {
106
+ readonly path: "/auth.AuthService/refresh";
107
+ readonly requestStream: false;
108
+ readonly responseStream: false;
109
+ readonly requestSerialize: (value: RefreshRequest) => Buffer;
110
+ readonly requestDeserialize: (value: Buffer) => RefreshRequest;
111
+ readonly responseSerialize: (value: AuthResponse) => Buffer;
112
+ readonly responseDeserialize: (value: Buffer) => AuthResponse;
113
+ };
105
114
  readonly logout: {
106
115
  readonly path: "/auth.AuthService/logout";
107
116
  readonly requestStream: false;
@@ -115,6 +124,7 @@ export declare const AuthServiceService: {
115
124
  export interface AuthServiceServer extends UntypedServiceImplementation {
116
125
  login: handleUnaryCall<LoginCredentials, AuthResponse>;
117
126
  register: handleUnaryCall<RegisterCredentials, AuthResponse>;
127
+ refresh: handleUnaryCall<RefreshRequest, AuthResponse>;
118
128
  logout: handleUnaryCall<LogoutRequest, Empty>;
119
129
  }
120
130
  export interface MessageFns<T> {
@@ -5,7 +5,7 @@
5
5
  // protoc v5.28.2
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AuthServiceService = exports.AUTH_SERVICE_NAME = exports.RefreshTokenResponse = exports.RefreshTokenRequest = exports.ResetPasswordRequest = exports.ForgotPasswordRequest = exports.LogoutRequest = exports.UserResponse = exports.AuthResponse = exports.Tokens = exports.LoginCredentials = exports.RegisterCredentials = exports.AUTH_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.AuthServiceService = exports.AUTH_SERVICE_NAME = exports.RefreshTokenResponse = exports.RefreshRequest = exports.ResetPasswordRequest = exports.ForgotPasswordRequest = exports.LogoutRequest = exports.UserResponse = exports.AuthResponse = exports.Tokens = exports.LoginCredentials = exports.RegisterCredentials = exports.AUTH_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const wire_1 = require("@bufbuild/protobuf/wire");
@@ -517,26 +517,20 @@ exports.ResetPasswordRequest = {
517
517
  return message;
518
518
  },
519
519
  };
520
- function createBaseRefreshTokenRequest() {
521
- return { userId: "", sessionId: "", refreshToken: "" };
520
+ function createBaseRefreshRequest() {
521
+ return { refreshToken: "" };
522
522
  }
523
- exports.RefreshTokenRequest = {
523
+ exports.RefreshRequest = {
524
524
  encode(message, writer = new wire_1.BinaryWriter()) {
525
- if (message.userId !== "") {
526
- writer.uint32(10).string(message.userId);
527
- }
528
- if (message.sessionId !== "") {
529
- writer.uint32(18).string(message.sessionId);
530
- }
531
525
  if (message.refreshToken !== "") {
532
- writer.uint32(26).string(message.refreshToken);
526
+ writer.uint32(10).string(message.refreshToken);
533
527
  }
534
528
  return writer;
535
529
  },
536
530
  decode(input, length) {
537
531
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
538
532
  const end = length === undefined ? reader.len : reader.pos + length;
539
- const message = createBaseRefreshTokenRequest();
533
+ const message = createBaseRefreshRequest();
540
534
  while (reader.pos < end) {
541
535
  const tag = reader.uint32();
542
536
  switch (tag >>> 3) {
@@ -544,20 +538,6 @@ exports.RefreshTokenRequest = {
544
538
  if (tag !== 10) {
545
539
  break;
546
540
  }
547
- message.userId = reader.string();
548
- continue;
549
- }
550
- case 2: {
551
- if (tag !== 18) {
552
- break;
553
- }
554
- message.sessionId = reader.string();
555
- continue;
556
- }
557
- case 3: {
558
- if (tag !== 26) {
559
- break;
560
- }
561
541
  message.refreshToken = reader.string();
562
542
  continue;
563
543
  }
@@ -605,7 +585,7 @@ exports.RefreshTokenResponse = {
605
585
  };
606
586
  function AuthServiceControllerMethods() {
607
587
  return function (constructor) {
608
- const grpcMethods = ["login", "register", "logout"];
588
+ const grpcMethods = ["login", "register", "refresh", "logout"];
609
589
  for (const method of grpcMethods) {
610
590
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
611
591
  (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -637,6 +617,15 @@ exports.AuthServiceService = {
637
617
  responseSerialize: (value) => Buffer.from(exports.AuthResponse.encode(value).finish()),
638
618
  responseDeserialize: (value) => exports.AuthResponse.decode(value),
639
619
  },
620
+ refresh: {
621
+ path: "/auth.AuthService/refresh",
622
+ requestStream: false,
623
+ responseStream: false,
624
+ requestSerialize: (value) => Buffer.from(exports.RefreshRequest.encode(value).finish()),
625
+ requestDeserialize: (value) => exports.RefreshRequest.decode(value),
626
+ responseSerialize: (value) => Buffer.from(exports.AuthResponse.encode(value).finish()),
627
+ responseDeserialize: (value) => exports.AuthResponse.decode(value),
628
+ },
640
629
  logout: {
641
630
  path: "/auth.AuthService/logout",
642
631
  requestStream: false,
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { SharedModule } from "./shared.module";
2
2
  export { UsersClient } from "./user/user.client";
3
3
  export { AuthClient } from "./auth/auth.client";
4
4
  export { MessageFns as UserMessageFns, protobufPackage as UserProtobufPackage, User, CreateUserRequest, CreateUserPersonal, UpdateUserRequest, GetByIdRequest, UserResponse, UsersResponse, UserServiceService as UserService, } from "./user/user.interface";
5
- export { MessageFns as AuthMessageFns, protobufPackage as AuthProtobufPackage, LoginCredentials, RegisterCredentials, LogoutRequest, AuthResponse, } from "./auth/auth.interface";
5
+ export { MessageFns as AuthMessageFns, protobufPackage as AuthProtobufPackage, LoginCredentials, RegisterCredentials, LogoutRequest, RefreshRequest, AuthResponse, RefreshTokenResponse, } from "./auth/auth.interface";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthResponse = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.UsersResponse = exports.UserResponse = exports.GetByIdRequest = exports.UpdateUserRequest = exports.CreateUserPersonal = exports.CreateUserRequest = exports.User = exports.UserProtobufPackage = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
3
+ exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.UsersResponse = exports.UserResponse = exports.GetByIdRequest = exports.UpdateUserRequest = exports.CreateUserPersonal = exports.CreateUserRequest = exports.User = exports.UserProtobufPackage = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
4
4
  var shared_module_1 = require("./shared.module");
5
5
  Object.defineProperty(exports, "SharedModule", { enumerable: true, get: function () { return shared_module_1.SharedModule; } });
6
6
  var user_client_1 = require("./user/user.client");
@@ -22,4 +22,6 @@ Object.defineProperty(exports, "AuthProtobufPackage", { enumerable: true, get: f
22
22
  Object.defineProperty(exports, "LoginCredentials", { enumerable: true, get: function () { return auth_interface_1.LoginCredentials; } });
23
23
  Object.defineProperty(exports, "RegisterCredentials", { enumerable: true, get: function () { return auth_interface_1.RegisterCredentials; } });
24
24
  Object.defineProperty(exports, "LogoutRequest", { enumerable: true, get: function () { return auth_interface_1.LogoutRequest; } });
25
+ Object.defineProperty(exports, "RefreshRequest", { enumerable: true, get: function () { return auth_interface_1.RefreshRequest; } });
25
26
  Object.defineProperty(exports, "AuthResponse", { enumerable: true, get: function () { return auth_interface_1.AuthResponse; } });
27
+ Object.defineProperty(exports, "RefreshTokenResponse", { enumerable: true, get: function () { return auth_interface_1.RefreshTokenResponse; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geniebox-shared-lib",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Shared NestJS library with gRPC clients",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",