@chevre/domain
Version:
Chevre Domain Library for Node.js
86 lines (85 loc) • 2.52 kB
TypeScript
import type { CognitoIdentityProvider, UserType } from '@aws-sdk/client-cognito-identity-provider';
import type { AttributeType } from '@aws-sdk/client-cognito-identity-provider/dist-types/models/models_0';
import * as factory from '../factory';
type IPerson = factory.person.IPerson;
export type ISearchPeopleResult = IPerson & Pick<UserType, 'Username'>;
/**
* 会員リポジトリ
*/
export declare class PersonRepo {
readonly cognitoIdentityServiceProvider: CognitoIdentityProvider;
private readonly userPoolId;
constructor(options: {
cognitoIdentityServiceProvider: CognitoIdentityProvider;
userPoolId: string;
});
static ATTRIBUTE2PROFILE(params: {
attributes?: AttributeType[];
}): factory.person.IProfile;
static ATTRIBUTE2PERSON(params: {
username?: string;
userPoolId?: string;
attributes?: AttributeType[];
}): factory.person.IPerson;
static PROFILE2ATTRIBUTE(params: factory.person.IProfile): AttributeType[];
/**
* 管理者権限でユーザー属性を取得する
*/
getUserAttributes(params: {
username: string;
}): Promise<factory.person.IProfile>;
/**
* 管理者権限でプロフィール更新
*/
updateProfile(params: {
username: string;
profile: factory.person.IProfile;
}): Promise<void>;
/**
* 管理者権限でsubでユーザーを検索する
*/
findById(params: {
userId: string;
}): Promise<factory.person.IPerson>;
/**
* アクセストークンでユーザー属性を取得する
*/
getUserAttributesByAccessToken(accessToken: string): Promise<factory.person.IProfile>;
/**
* 会員プロフィール更新
*/
updateProfileByAccessToken(params: {
accessToken: string;
profile: factory.person.IProfile;
}): Promise<void>;
/**
* 削除
*/
deleteById(params: {
userId: string;
}): Promise<void>;
/**
* 無効化する
*/
disable(params: {
userId: string;
}): Promise<void>;
/**
* グローバルサインアウトかつ無効化
*/
globalSignOutAndDisable(params: {
userId: string;
}): Promise<void>;
/**
* 検索
*/
search(params: {
id?: string;
username?: string;
email?: string;
telephone?: string;
givenName?: string;
familyName?: string;
}): Promise<ISearchPeopleResult[]>;
}
export {};