Files
contracts/gen/account.ts
2026-04-03 16:21:55 +00:00

158 lines
4.2 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.6
// protoc v3.21.12
// source: account.proto
/* eslint-disable */
import type { Metadata } from "@grpc/grpc-js";
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
import { Observable } from "rxjs";
export const protobufPackage = "account.v1";
export interface GetAccountRequest {
id: string;
}
export interface GetAccountResponse {
id: string;
username: string;
email: string;
phone: string;
fullName: string;
isLdap: boolean;
status: string;
roles: string[];
avatarUrl: string;
employeeId?: string | undefined;
presence: string;
lastActive: string;
customStatusText: string;
customStatusEmoji: string;
timezone: string;
language: string;
twoFaEnabled: boolean;
hasPin: boolean;
}
export interface ChangePasswordRequest {
userId: string;
accessToken: string;
oldPassword: string;
newPassword: string;
code?: string | undefined;
}
export interface ChangePasswordResponse {
success: boolean;
message: string;
}
export interface SetPinRequest {
userId: string;
accessToken: string;
pin: string;
}
export interface SetPinResponse {
success: boolean;
message: string;
}
export interface UnlockPinRequest {
accessToken: string;
pin: string;
}
export interface UnlockPinResponse {
success: boolean;
message: string;
}
export interface GetPinStatusRequest {
userId: string;
}
export interface GetPinStatusResponse {
hasPin: boolean;
isLocked: boolean;
lockUntil: string;
}
export interface RemovePinRequest {
pin: string;
userId: string;
accessToken: string;
}
export interface RemovePinResponse {
success: boolean;
message: string;
}
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
export interface AccountServiceClient {
getAccount(request: GetAccountRequest, metadata?: Metadata): Observable<GetAccountResponse>;
changePassword(request: ChangePasswordRequest, metadata?: Metadata): Observable<ChangePasswordResponse>;
setPin(request: SetPinRequest, metadata?: Metadata): Observable<SetPinResponse>;
unlockPin(request: UnlockPinRequest, metadata?: Metadata): Observable<UnlockPinResponse>;
getPinStatus(request: GetPinStatusRequest, metadata?: Metadata): Observable<GetPinStatusResponse>;
removePin(request: RemovePinRequest, metadata?: Metadata): Observable<RemovePinResponse>;
}
export interface AccountServiceController {
getAccount(
request: GetAccountRequest,
metadata?: Metadata,
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
changePassword(
request: ChangePasswordRequest,
metadata?: Metadata,
): Promise<ChangePasswordResponse> | Observable<ChangePasswordResponse> | ChangePasswordResponse;
setPin(
request: SetPinRequest,
metadata?: Metadata,
): Promise<SetPinResponse> | Observable<SetPinResponse> | SetPinResponse;
unlockPin(
request: UnlockPinRequest,
metadata?: Metadata,
): Promise<UnlockPinResponse> | Observable<UnlockPinResponse> | UnlockPinResponse;
getPinStatus(
request: GetPinStatusRequest,
metadata?: Metadata,
): Promise<GetPinStatusResponse> | Observable<GetPinStatusResponse> | GetPinStatusResponse;
removePin(
request: RemovePinRequest,
metadata?: Metadata,
): Promise<RemovePinResponse> | Observable<RemovePinResponse> | RemovePinResponse;
}
export function AccountServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ["getAccount", "changePassword", "setPin", "unlockPin", "getPinStatus", "removePin"];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
}
const grpcStreamMethods: string[] = [];
for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
}
};
}
export const ACCOUNT_SERVICE_NAME = "AccountService";