@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
480 lines (424 loc) • 9.19 kB
text/typescript
import { ApiResponse } from '../../api/interfaces/api-response';
import { IpfsMetadata } from '../../common';
import { SellerTypeEnum, SocialMediaSiteTypeEnum } from '../enums';
import { AddAddressRequest } from '../services';
import { BaseAddress } from './address';
import { EndUser } from './user';
export interface Profile {
id: string;
userId: string;
appName: string;
isDefault: boolean;
createdAt: string;
updateAt?: string;
}
export interface SocialMediaSiteData {
type: SocialMediaSiteTypeEnum;
value: string;
}
export interface CreatorProfile extends Profile {
officialSiteUrl?: string;
bio?: string;
socialMediaSites: SocialMediaSiteData[];
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface BuyerProfile extends Profile { }
export interface SellerProfile extends Profile {
type: SellerTypeEnum;
taxId: string;
}
export enum EAddressType {
Billing = 'Billing',
Home = 'Home',
Office = 'Office',
Warehouse = 'Warehouse',
Company = 'Company',
Factory = 'Factory',
Others = 'Others',
}
export enum EBeingLevel {
GovWitness = 1,
GovRealId = 2,
SecGovId = 3,
WitnessConfirm = 4,
MultiEvents = 5,
Human = 6,
}
interface SocialMedia {
type: string;
value: string;
}
interface DocumentAttachments {
name: string;
data: string;
}
interface BeingIdHistory {
level: number;
timestamp: string;
}
export type ShippingDetails = {
id?: string;
type: EAddressType;
name: string;
address: string;
phoneNumber: string;
city: string;
state: string;
zip: string;
country: string;
shipInternationally: boolean;
isDefault?: boolean;
};
export interface GetProfilePayload {
userId: string;
}
export type GetEndUserAddressesPayload = {
userId?: string;
name?: string;
address?: string;
$ids?: string[];
$order?: string;
};
export interface SocialMediaSite {
type: string;
value: string;
}
export interface GetCreatorProfileRes {
id: string;
userId: string;
appName: string;
isDefault: boolean;
createdAt: string;
updateAt?: string;
officialSiteUrl?: string;
bio?: string;
socialMediaSites?: SocialMediaSite[];
// memberDetails: {
// beingId: string;
// beingIdGrad: string;
// memberSince: string;
// type: string;
// user: string;
// };
}
export type GetCreatorProfilesListRes = GetCreatorProfileRes[];
export interface GetSellerProfileRes {
document_ids: string[];
shippingDetails: [
{
address: string;
city: string;
country: string;
id: string;
name: string;
phone_number: string;
state: string;
type: string;
zip: string;
}
];
id: string;
type: string;
userId: string;
}
export type CreateProfileRes = ApiResponse<EndUser>;
export interface UpdateAvatarInput {
image: string;
}
export interface UpdateFaceTemplateInput {
template: string;
}
export interface VerifyCredentialsPayload {
email?: string;
photoBase64?: string;
userId?: string;
transactionId?: string;
token?: string;
}
export interface VerifyCredentialsInput {
type: string;
faceCredentials?: {
email: string;
photo: string;
};
fycCredentials?: {
userId?: string;
transactionId?: string;
token?: string;
};
}
export type VerifyCredentialsRes = ApiResponse<{ token: string }>;
export interface GetDeviceByIdPayload {
deviceId: string;
}
export interface GetDeviceByExternalIdPayload {
externalId: string;
}
export type RegisterDevicePayload = RegisterDeviceInput;
export interface RegisterDeviceInput {
appName: string;
owner: {
id: string;
isPersonal: boolean;
};
externalId: string;
name: string;
typeId: number;
deviceInfo?: {
model?: string;
os?: string;
imei?: string;
macAddress?: string;
};
locationId?: string;
latitude: number;
longitude: number;
meanSeaLevel: number;
platform: string;
recipientAddress: string;
}
export interface GetDeviceVdtResponse {
platform: string;
immutableTime: string;
nftTokenId: string;
nftMetadataUrl: string;
nftSmartContractAddress: string;
immutableTransactionHash: string;
walletAddress: string;
deviceId: string;
}
export interface CreatorProfilePayload {
id?: string;
officialSiteUrl?: string;
bio?: string;
socialMediaSites?: SocialMedia[];
isDefault: boolean;
}
export interface CreateSellerProfilePayload {
type: 'Company' | 'Individual';
userId: string;
appName: string;
isDefault: boolean;
}
export interface CreateSellerProfileRes {
id: string;
userId: string;
type: 'Company' | 'Individual';
shippingDetails: ShippingDetails[];
document_ids: [];
tin: string;
paymentDetails: {
bankName: string;
accountNumber: string;
bankIFSCCode: string;
};
createdAt: string;
updatedAt: string;
}
export interface GetDocumentsTypesRes {
items: [
{
id: string;
name: string;
photoRequirements: [
{
name: string;
}
];
}
];
page: number;
perPage: number;
totalPages: number;
totalCount: number;
}
export interface GetDocumentsRes {
attachments: [
{
name: string;
path: string;
url: string;
}
];
id: string;
number: string;
status: string;
typeId: string;
userId: string;
}
export interface CreateDocumentPayload {
userId: string;
typeId: number;
number: string;
attachments: DocumentAttachments[];
}
export interface CreateDocumentRes {
id?: string;
userId: string;
typeId: string;
number: string;
attachments: [{ name: string; data: string; url?: string }];
status?: string;
}
export type CreateAddressesRes = BaseAddress;
export type UpdateAddressPayload = AddAddressRequest & { id: string };
export type CreateShippingAddressesRes = BaseAddress & {
id?:string;
userId:string;
profileId: string;
isDefault: boolean;
phoneNumber: string;
shipInternationally?: boolean;
};
export type CreateSellerDocumentPayload = CreateDocumentPayload & {
docId?: string;
profileId: string;
};
export type CreateSellerDocumentRes = CreateDocumentRes & {
profileId: string;
};
export type DeleteShippingAddressPayload = {
id: string;
profileId: string;
};
export type PaymentDataProps = {
bankName?: string;
accountNumber?: string;
routingNumber?: string;
nameOnCard?: string;
cardNumber?: string;
expiryDate?: string;
cvv?: string;
username?: string;
email?: string;
};
export type CreatePaymentPayload = {
userId?: string;
type?: string;
isDefault?: boolean;
profileId?: string;
paymentDetailId?: string;
data?: PaymentDataProps;
};
export type CreatePaymentRes = CreatePaymentPayload & {
id?: string;
createdAt?: string;
updatedAt?: string;
};
export type GetBuyerProfileRes = {
id: string;
userId: string;
appName: string;
isDefault: true;
createdAt: string;
updateAt: string;
};
export type CreateBuyerProfilePayload = {
userId: string;
appName: string;
isDefault: boolean;
};
export interface ValidateDevicePayload {
id: string;
externalId: string;
isPersonal: boolean;
}
export interface GetOrganizationProfileRes {
id: string;
name: string;
description?: string;
contacts?: {
id: string;
name: string;
job: string;
email: string;
phone: string;
}[];
logoUrl?: string;
isSuper: string;
createdAt?: string;
updatedAt?: string;
}
export interface GetOrganizationProfileByIdRes {
userId: string;
orgId: string;
startedAt: string;
jobTitle: string;
endedAt: string;
}
export interface GetUserRolesRes {
global?: string[];
apps?: any;
}
export interface UserVdtResponse {
platform: string;
immutableTime: string;
nftTokenId: string;
nftMetadataUrl: string;
nftSmartContractAddress: string;
immutableTransactionHash: string;
walletAddress: string;
userId: string;
}
export interface UserVdtByQrIdResponse {
platform: string;
immutableTime: string;
nftTokenId: string;
nftMetadataUrl: string;
nftSmartContractAddress: string;
immutableTransactionHash: string;
walletAddress: string;
userId: string;
ipfsMetadata: IpfsMetadata;
}
export interface GetUserBeingIdRes {
userId: string;
updatedAt: string;
level: number;
history: BeingIdHistory[];
}
export interface SetUserBeingIdPayload {
userId: string;
level: number;
}
export interface RecalculateUserBeingIdPayload {
userId: string;
sessionId?: number;
forceLevel?: boolean;
}
export interface CompleteOnboardingPayload {
userId: string;
sessionId: string;
}
export interface EndUserOrganizationResponse {
userId: string;
orgId: string;
startedAt: string;
jobTitle: string;
endedAt: string;
}
export interface GetOrganizationsRes {
items: [
{
userId: string;
orgId: string;
startedAt: string;
jobTitle: string;
endedAt: string;
}
];
page: number;
perPage: number;
totalPages: number;
totalCount: number;
}
export interface OrganizationInviteResponse {
id: string;
type?: { description?: string };
email: string;
appName: string;
orgId: string;
jobTitle: string;
roleIds: string[];
createdAt: string;
}