Skip to content
Snippets Groups Projects

feat: ocm did svdx generation for sender OP#250

Merged Alexey Lunin requested to merge feat/250-hin-ocm into main
All threads resolved!
Files
4
@@ -11,11 +11,11 @@ export class CatalogClient {
this.catalogConfig = this.configService.get<IConfCatalog>("catalog")!;
}
lookupEmail = async (email: string): Promise<string | null> => {
this.logger.debug(`lookupEmail`, email);
searchAccount = async (email: string): Promise<string | null> => {
this.logger.debug(`searchAccount`, email);
try {
const response = await axios.post(
`${this.catalogConfig.catalogUrl}/lookup-email`,
`${this.catalogConfig.catalogUrl}/v1/accounts/search`,
{
email: email,
},
@@ -26,9 +26,9 @@ export class CatalogClient {
},
},
);
return response.data.didSvdx;
return response.data.did;
} catch (e) {
this.logger.debug("lookupEmail failed", e);
this.logger.debug("searchAccount failed", e);
if (e instanceof AxiosError && e.status === 404) {
return null;
@@ -38,14 +38,14 @@ export class CatalogClient {
}
};
storeMapping = async (email: string, didSvdx: string): Promise<void> => {
this.logger.debug(`storeMapping`, email);
createAccount = async (email: string, didSvdx: string): Promise<void> => {
this.logger.debug(`createAccount`, email);
try {
await axios.post(
`${this.catalogConfig.catalogUrl}/store`,
`${this.catalogConfig.catalogUrl}/v1/accounts`,
{
email: email,
didSvdx: didSvdx,
did: didSvdx,
},
{
auth: {
Loading