@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
268 lines (231 loc) • 6.05 kB
text/typescript
import { FileTypeEnum } from '../../asset';
import { FilterParams, FilteredRequest, PagedRequest, PagedResponse } from '../../common';
import { ConsentActionTypesEnum, DocumentStatusEnum, UserRoleEnum, VerifyCredentialTypeEnum } from '../enums';
import { BeingIdHistory, EGovIdType, UserOrganization } from '../interfaces';
export type SearchUsersRequest = PagedRequest<{
name?: string;
username?: string;
email?: string;
phone?: string;
emailVerified?: boolean;
phoneVerified?: boolean;
appNames?: string[];
organizationIds?: string[];
roleIds?: string[];
includeRoles?: boolean;
showSoftDeleted?: boolean;
$resolveImages?: boolean;
isActive?: boolean;
showAllOrgUserType?: boolean;
}>;
export type ListUsersRequest = FilteredRequest<{
name?: string;
username?: string;
email?: string;
phone?: string;
emailVerified?: boolean;
phoneVerified?: boolean;
appNames?: string[];
organizationIds?: string[];
roleIds?: string[];
includeRoles?: boolean;
showSoftDeleted?: boolean;
$resolveImages?: boolean;
}>;
export interface EditUserRequest {
id: string; // Required as per the schema
username?: string; // Optional with a maxLength of 255
firstName?: string; // Optional with a maxLength of 100
lastName?: string; // Optional with a maxLength of 100
middleName?: string; // Optional with a maxLength of 100
avatarUrl?: string | null; // Optional, can be set to null to remove existing avatar
avatar?: string | null; // Optional Base64 string (can be set to null to remove existing avatar)
dateOfBirth?: string; // Optional, format: date
phone?: string; // Optional with a maxLength of 15
}
export interface GetUserRolesResponse {
global: Array<UserRoleEnum>; // Using an array of specific string literals for the enumerated values
apps: {
// Specific properties for 'apps' would need to be provided for a detailed structure.
// Assuming a dynamic key-value structure for now.
[key: string]: any;
};
orgs: {
// Similarly, assuming a dynamic key-value structure for 'orgs' for now.
[key: string]: any;
};
}
export interface ChangeEmailRequest {
email: string;
}
export interface VerifyEmailRequest {
ticket: string;
}
export interface VerifyPhoneRequest {
code: string;
}
interface UserRoleDataRequest {
userId: string;
roleId: number;
appName: string;
orgId: string;
}
export interface ManageUserRolesRequest {
roles: UserRoleDataRequest[];
}
export interface ChangePhoneRequest {
phone: string;
}
export interface VerifyCredentialsRequest {
type: VerifyCredentialTypeEnum;
faceCredentials: {
email: string;
photo: string; // Photo in base64
};
// No properties defined for this model
otpCredentials: object;
// No properties defined for this model
pinCredentials: object;
fycCredentials: {
userId: string;
transactionId: string;
token: string;
};
}
export interface VerifyCredentialsResponse {
status: boolean;
data: { token?: string };
}
export interface VerifyCredentialsWitnessRequest {
transactionId: string;
token: string;
}
export interface VerifyCredentialsWitnessResponse extends VerifyCredentialsResponse {
userId: string;
}
export interface SetBeingIdRequest {
userId: string;
level: number;
timestamp: string;
}
export interface RecalculateBeingIdRequest {
userId: string;
sessionId?: number;
forceLevel?: boolean;
}
export interface CompleteFycOnboardingRequest {
sessionId: string;
userId: string;
}
export type SearchOrgsRequest = PagedRequest<Partial<UserOrganization>>;
export type SearchOrgsResponse = PagedResponse<UserOrganization>;
export type ConsentActionRequest = {
type: ConsentActionTypesEnum;
isAccepted: boolean;
biometricsId: string;
incodeSession: string;
};
export interface ConsentActionResponse extends ConsentActionRequest {
id: string;
}
export interface ExportListUsersRequest extends ListUsersRequest {
reportType: FileTypeEnum;
}
export interface FycDocumentsRequest extends FilterParams {
userId?: string;
govIdType?: EGovIdType;
}
export type SearchUserDocumentsRequest = PagedRequest<{
userId?: string;
typeId?: string;
status?: DocumentStatusEnum;
}>;
export interface ListUserDocumentsRequest extends FilterParams {
userId?: string;
typeId?: string;
status?: DocumentStatusEnum;
}
export interface ShareUserDeepLinkRequest extends FilterParams {
to?: {
email: string;
name?: string;
}[];
}
export enum InviteTypeEnum {
Internal = 'INTERNAL',
External = 'EXTERNAL',
}
export interface ListInvitesRequest extends FilterParams {
email?: string;
appName?: string;
orgId?: string;
userIds?: string[];
type?: InviteTypeEnum;
}
export interface ShareableInfo {
all: boolean;
who: {
age: boolean;
dateOfBirth: boolean;
fullName: boolean;
firstName: boolean;
middleName: boolean;
lastName: boolean;
beingIdHistory: true;
};
what: any;
where: {
fullAddress: boolean;
city: boolean;
state: boolean;
country: boolean;
addressOnId: true;
};
tokens: {
currentlyOwned: boolean;
associated: boolean;
previouslyOwned: true;
};
}
export type IvdtRequestShareableRequest = ShareableInfo;
export interface IvdtRequestShareableResponse {
qrImgUrl: string;
token: string;
}
export interface IvdtShareableRequest {
token: string;
}
export interface IvdtShareableResponse {
who: {
age: number;
dateOfBirth: string;
fullName: string;
firstName: string;
middleName: string;
lastName: string;
beingIdHistory: BeingIdHistory[];
};
what: any;
where: {
address: string;
city: string;
state: string;
country: string;
addressOnId: string;
};
tokens: {
currentlyOwned: true;
associated: true;
previouslyOwned: true;
};
}
export interface SendVerificationCodeRequest {
phone: string;
}
export interface VerifyCodeRequest {
phone: string;
code: string;
}
export interface VerifyCodeResponse {
verified: boolean;
}