geniebox-shared-lib 1.0.31 → 1.0.33

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.
@@ -26,7 +26,6 @@ export interface Tokens {
26
26
  export interface AuthResponse {
27
27
  userId: string;
28
28
  sessionId: string;
29
- email: string;
30
29
  tokens?: Tokens | undefined;
31
30
  }
32
31
  export interface UserResponse {
@@ -43,7 +42,7 @@ export interface LogoutRequest {
43
42
  userId: string;
44
43
  sessionId: string;
45
44
  }
46
- export interface ForgotPasswordRequest {
45
+ export interface RecoverRequest {
47
46
  email: string;
48
47
  }
49
48
  export interface ResetPasswordRequest {
@@ -64,7 +63,7 @@ export declare const Tokens: MessageFns<Tokens>;
64
63
  export declare const AuthResponse: MessageFns<AuthResponse>;
65
64
  export declare const UserResponse: MessageFns<UserResponse>;
66
65
  export declare const LogoutRequest: MessageFns<LogoutRequest>;
67
- export declare const ForgotPasswordRequest: MessageFns<ForgotPasswordRequest>;
66
+ export declare const RecoverRequest: MessageFns<RecoverRequest>;
68
67
  export declare const ResetPasswordRequest: MessageFns<ResetPasswordRequest>;
69
68
  export declare const RefreshRequest: MessageFns<RefreshRequest>;
70
69
  export declare const RefreshTokenResponse: MessageFns<RefreshTokenResponse>;
@@ -73,12 +72,14 @@ export interface AuthServiceClient {
73
72
  register(request: RegisterCredentials, metadata?: Metadata): Observable<AuthResponse>;
74
73
  refresh(request: RefreshRequest, metadata?: Metadata): Observable<AuthResponse>;
75
74
  logout(request: LogoutRequest, metadata?: Metadata): Observable<Empty>;
75
+ recover(request: RecoverRequest, metadata?: Metadata): Observable<Empty>;
76
76
  }
77
77
  export interface AuthServiceController {
78
78
  login(request: LoginCredentials, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
79
79
  register(request: RegisterCredentials, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
80
80
  refresh(request: RefreshRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
81
81
  logout(request: LogoutRequest, metadata?: Metadata): void;
82
+ recover(request: RecoverRequest, metadata?: Metadata): void;
82
83
  }
83
84
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
84
85
  export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -120,12 +121,22 @@ export declare const AuthServiceService: {
120
121
  readonly responseSerialize: (value: Empty) => Buffer;
121
122
  readonly responseDeserialize: (value: Buffer) => Empty;
122
123
  };
124
+ readonly recover: {
125
+ readonly path: "/auth.AuthService/recover";
126
+ readonly requestStream: false;
127
+ readonly responseStream: false;
128
+ readonly requestSerialize: (value: RecoverRequest) => Buffer;
129
+ readonly requestDeserialize: (value: Buffer) => RecoverRequest;
130
+ readonly responseSerialize: (value: Empty) => Buffer;
131
+ readonly responseDeserialize: (value: Buffer) => Empty;
132
+ };
123
133
  };
124
134
  export interface AuthServiceServer extends UntypedServiceImplementation {
125
135
  login: handleUnaryCall<LoginCredentials, AuthResponse>;
126
136
  register: handleUnaryCall<RegisterCredentials, AuthResponse>;
127
137
  refresh: handleUnaryCall<RefreshRequest, AuthResponse>;
128
138
  logout: handleUnaryCall<LogoutRequest, Empty>;
139
+ recover: handleUnaryCall<RecoverRequest, Empty>;
129
140
  }
130
141
  export interface MessageFns<T> {
131
142
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
@@ -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.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;
8
+ exports.AuthServiceService = exports.AUTH_SERVICE_NAME = exports.RefreshTokenResponse = exports.RefreshRequest = exports.ResetPasswordRequest = exports.RecoverRequest = 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");
@@ -223,7 +223,7 @@ exports.Tokens = {
223
223
  },
224
224
  };
225
225
  function createBaseAuthResponse() {
226
- return { userId: "", sessionId: "", email: "" };
226
+ return { userId: "", sessionId: "" };
227
227
  }
228
228
  exports.AuthResponse = {
229
229
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -233,11 +233,8 @@ exports.AuthResponse = {
233
233
  if (message.sessionId !== "") {
234
234
  writer.uint32(18).string(message.sessionId);
235
235
  }
236
- if (message.email !== "") {
237
- writer.uint32(26).string(message.email);
238
- }
239
236
  if (message.tokens !== undefined) {
240
- exports.Tokens.encode(message.tokens, writer.uint32(34).fork()).join();
237
+ exports.Tokens.encode(message.tokens, writer.uint32(26).fork()).join();
241
238
  }
242
239
  return writer;
243
240
  },
@@ -266,13 +263,6 @@ exports.AuthResponse = {
266
263
  if (tag !== 26) {
267
264
  break;
268
265
  }
269
- message.email = reader.string();
270
- continue;
271
- }
272
- case 4: {
273
- if (tag !== 34) {
274
- break;
275
- }
276
266
  message.tokens = exports.Tokens.decode(reader, reader.uint32());
277
267
  continue;
278
268
  }
@@ -431,10 +421,10 @@ exports.LogoutRequest = {
431
421
  return message;
432
422
  },
433
423
  };
434
- function createBaseForgotPasswordRequest() {
424
+ function createBaseRecoverRequest() {
435
425
  return { email: "" };
436
426
  }
437
- exports.ForgotPasswordRequest = {
427
+ exports.RecoverRequest = {
438
428
  encode(message, writer = new wire_1.BinaryWriter()) {
439
429
  if (message.email !== "") {
440
430
  writer.uint32(10).string(message.email);
@@ -444,7 +434,7 @@ exports.ForgotPasswordRequest = {
444
434
  decode(input, length) {
445
435
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
446
436
  const end = length === undefined ? reader.len : reader.pos + length;
447
- const message = createBaseForgotPasswordRequest();
437
+ const message = createBaseRecoverRequest();
448
438
  while (reader.pos < end) {
449
439
  const tag = reader.uint32();
450
440
  switch (tag >>> 3) {
@@ -585,7 +575,7 @@ exports.RefreshTokenResponse = {
585
575
  };
586
576
  function AuthServiceControllerMethods() {
587
577
  return function (constructor) {
588
- const grpcMethods = ["login", "register", "refresh", "logout"];
578
+ const grpcMethods = ["login", "register", "refresh", "logout", "recover"];
589
579
  for (const method of grpcMethods) {
590
580
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
591
581
  (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
@@ -635,4 +625,13 @@ exports.AuthServiceService = {
635
625
  responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
636
626
  responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
637
627
  },
628
+ recover: {
629
+ path: "/auth.AuthService/recover",
630
+ requestStream: false,
631
+ responseStream: false,
632
+ requestSerialize: (value) => Buffer.from(exports.RecoverRequest.encode(value).finish()),
633
+ requestDeserialize: (value) => exports.RecoverRequest.decode(value),
634
+ responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
635
+ responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
636
+ },
638
637
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { SharedModule } from "./shared.module";
2
2
  export { UsersClient } from "./user/user.client";
3
3
  export { AuthClient } from "./auth/auth.client";
4
- export { MessageFns as UserMessageFns, protobufPackage as UserProtobufPackage, User, CreateUserRequest, CreateUserPersonal, UpdateUserRequest, GetByIdRequest, UserResponse, UsersResponse, UserServiceService as UserService, } from "./user/user.interface";
4
+ export { MessageFns as UserMessageFns, protobufPackage as UserProtobufPackage, User, CreateUserRequest, CreateUserPersonal, UpdateUserRequest, GetByIdRequest, UserResponse, UsersResponse, FindByEmailRequest, FindByPhoneRequest, UpdatePasswordRequest, UserServiceService as UserService, } from "./user/user.interface";
5
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.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;
3
+ exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.UpdatePasswordRequest = exports.FindByPhoneRequest = exports.FindByEmailRequest = 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");
@@ -16,6 +16,9 @@ Object.defineProperty(exports, "UpdateUserRequest", { enumerable: true, get: fun
16
16
  Object.defineProperty(exports, "GetByIdRequest", { enumerable: true, get: function () { return user_interface_1.GetByIdRequest; } });
17
17
  Object.defineProperty(exports, "UserResponse", { enumerable: true, get: function () { return user_interface_1.UserResponse; } });
18
18
  Object.defineProperty(exports, "UsersResponse", { enumerable: true, get: function () { return user_interface_1.UsersResponse; } });
19
+ Object.defineProperty(exports, "FindByEmailRequest", { enumerable: true, get: function () { return user_interface_1.FindByEmailRequest; } });
20
+ Object.defineProperty(exports, "FindByPhoneRequest", { enumerable: true, get: function () { return user_interface_1.FindByPhoneRequest; } });
21
+ Object.defineProperty(exports, "UpdatePasswordRequest", { enumerable: true, get: function () { return user_interface_1.UpdatePasswordRequest; } });
19
22
  Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return user_interface_1.UserServiceService; } });
20
23
  var auth_interface_1 = require("./auth/auth.interface");
21
24
  Object.defineProperty(exports, "AuthProtobufPackage", { enumerable: true, get: function () { return auth_interface_1.protobufPackage; } });
@@ -59,6 +59,10 @@ export interface UpdateUserRequest {
59
59
  personal?: UserPersonal | undefined;
60
60
  authentication?: UserAuthentication | undefined;
61
61
  }
62
+ export interface UpdatePasswordRequest {
63
+ uuid: string;
64
+ password: string;
65
+ }
62
66
  export interface RemoveUserRequest {
63
67
  uuid: string;
64
68
  }
@@ -88,6 +92,7 @@ export declare const GetByIdRequest: MessageFns<GetByIdRequest>;
88
92
  export declare const FindByEmailRequest: MessageFns<FindByEmailRequest>;
89
93
  export declare const FindByPhoneRequest: MessageFns<FindByPhoneRequest>;
90
94
  export declare const UpdateUserRequest: MessageFns<UpdateUserRequest>;
95
+ export declare const UpdatePasswordRequest: MessageFns<UpdatePasswordRequest>;
91
96
  export declare const RemoveUserRequest: MessageFns<RemoveUserRequest>;
92
97
  export declare const UserResponse: MessageFns<UserResponse>;
93
98
  export declare const UsersResponse: MessageFns<UsersResponse>;
@@ -98,6 +103,7 @@ export interface UserServiceClient {
98
103
  findByPhone(request: FindByPhoneRequest, metadata?: Metadata): Observable<User>;
99
104
  findAll(request: Empty, metadata?: Metadata): Observable<UsersResponse>;
100
105
  update(request: UpdateUserRequest, metadata?: Metadata): Observable<UserResponse>;
106
+ updatePassword(request: UpdatePasswordRequest, metadata?: Metadata): Observable<Empty>;
101
107
  remove(request: RemoveUserRequest, metadata?: Metadata): Observable<Empty>;
102
108
  }
103
109
  export interface UserServiceController {
@@ -107,6 +113,7 @@ export interface UserServiceController {
107
113
  findByPhone(request: FindByPhoneRequest, metadata?: Metadata): Promise<User> | Observable<User> | User;
108
114
  findAll(request: Empty, metadata?: Metadata): Promise<UsersResponse> | Observable<UsersResponse> | UsersResponse;
109
115
  update(request: UpdateUserRequest, metadata?: Metadata): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
116
+ updatePassword(request: UpdatePasswordRequest, metadata?: Metadata): void;
110
117
  remove(request: RemoveUserRequest, metadata?: Metadata): void;
111
118
  }
112
119
  export declare function UserServiceControllerMethods(): (constructor: Function) => void;
@@ -167,6 +174,15 @@ export declare const UserServiceService: {
167
174
  readonly responseSerialize: (value: UserResponse) => Buffer;
168
175
  readonly responseDeserialize: (value: Buffer) => UserResponse;
169
176
  };
177
+ readonly updatePassword: {
178
+ readonly path: "/user.UserService/updatePassword";
179
+ readonly requestStream: false;
180
+ readonly responseStream: false;
181
+ readonly requestSerialize: (value: UpdatePasswordRequest) => Buffer;
182
+ readonly requestDeserialize: (value: Buffer) => UpdatePasswordRequest;
183
+ readonly responseSerialize: (value: Empty) => Buffer;
184
+ readonly responseDeserialize: (value: Buffer) => Empty;
185
+ };
170
186
  readonly remove: {
171
187
  readonly path: "/user.UserService/remove";
172
188
  readonly requestStream: false;
@@ -184,6 +200,7 @@ export interface UserServiceServer extends UntypedServiceImplementation {
184
200
  findByPhone: handleUnaryCall<FindByPhoneRequest, User>;
185
201
  findAll: handleUnaryCall<Empty, UsersResponse>;
186
202
  update: handleUnaryCall<UpdateUserRequest, UserResponse>;
203
+ updatePassword: handleUnaryCall<UpdatePasswordRequest, Empty>;
187
204
  remove: handleUnaryCall<RemoveUserRequest, Empty>;
188
205
  }
189
206
  export interface MessageFns<T> {
@@ -5,7 +5,7 @@
5
5
  // protoc v5.28.2
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.UserServiceService = exports.USER_SERVICE_NAME = exports.UsersResponse = exports.UserResponse = exports.RemoveUserRequest = exports.UpdateUserRequest = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.GetByIdRequest = exports.CreateUserRequest = exports.CreateUserAuthentication = exports.CreateUserPersonal = exports.User = exports.UserAuthentication = exports.UserPersonal = exports.USER_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.UserServiceService = exports.USER_SERVICE_NAME = exports.UsersResponse = exports.UserResponse = exports.RemoveUserRequest = exports.UpdatePasswordRequest = exports.UpdateUserRequest = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.GetByIdRequest = exports.CreateUserRequest = exports.CreateUserAuthentication = exports.CreateUserPersonal = exports.User = exports.UserAuthentication = exports.UserPersonal = exports.USER_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.UserServiceControllerMethods = UserServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const wire_1 = require("@bufbuild/protobuf/wire");
@@ -595,6 +595,49 @@ exports.UpdateUserRequest = {
595
595
  return message;
596
596
  },
597
597
  };
598
+ function createBaseUpdatePasswordRequest() {
599
+ return { uuid: "", password: "" };
600
+ }
601
+ exports.UpdatePasswordRequest = {
602
+ encode(message, writer = new wire_1.BinaryWriter()) {
603
+ if (message.uuid !== "") {
604
+ writer.uint32(10).string(message.uuid);
605
+ }
606
+ if (message.password !== "") {
607
+ writer.uint32(18).string(message.password);
608
+ }
609
+ return writer;
610
+ },
611
+ decode(input, length) {
612
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
613
+ const end = length === undefined ? reader.len : reader.pos + length;
614
+ const message = createBaseUpdatePasswordRequest();
615
+ while (reader.pos < end) {
616
+ const tag = reader.uint32();
617
+ switch (tag >>> 3) {
618
+ case 1: {
619
+ if (tag !== 10) {
620
+ break;
621
+ }
622
+ message.uuid = reader.string();
623
+ continue;
624
+ }
625
+ case 2: {
626
+ if (tag !== 18) {
627
+ break;
628
+ }
629
+ message.password = reader.string();
630
+ continue;
631
+ }
632
+ }
633
+ if ((tag & 7) === 4 || tag === 0) {
634
+ break;
635
+ }
636
+ reader.skip(tag & 7);
637
+ }
638
+ return message;
639
+ },
640
+ };
598
641
  function createBaseRemoveUserRequest() {
599
642
  return { uuid: "" };
600
643
  }
@@ -797,7 +840,16 @@ exports.UsersResponse = {
797
840
  };
798
841
  function UserServiceControllerMethods() {
799
842
  return function (constructor) {
800
- const grpcMethods = ["create", "findOne", "findByEmail", "findByPhone", "findAll", "update", "remove"];
843
+ const grpcMethods = [
844
+ "create",
845
+ "findOne",
846
+ "findByEmail",
847
+ "findByPhone",
848
+ "findAll",
849
+ "update",
850
+ "updatePassword",
851
+ "remove",
852
+ ];
801
853
  for (const method of grpcMethods) {
802
854
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
803
855
  (0, microservices_1.GrpcMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
@@ -865,6 +917,15 @@ exports.UserServiceService = {
865
917
  responseSerialize: (value) => Buffer.from(exports.UserResponse.encode(value).finish()),
866
918
  responseDeserialize: (value) => exports.UserResponse.decode(value),
867
919
  },
920
+ updatePassword: {
921
+ path: "/user.UserService/updatePassword",
922
+ requestStream: false,
923
+ responseStream: false,
924
+ requestSerialize: (value) => Buffer.from(exports.UpdatePasswordRequest.encode(value).finish()),
925
+ requestDeserialize: (value) => exports.UpdatePasswordRequest.decode(value),
926
+ responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
927
+ responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
928
+ },
868
929
  remove: {
869
930
  path: "/user.UserService/remove",
870
931
  requestStream: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geniebox-shared-lib",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Shared NestJS library with gRPC clients",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",