diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index ab35d5fcc..a6c0d975a 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -814,7 +814,9 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO } const invitationUrl: string = credentialCreateOfferDetails.response?.invitationUrl; + const shortenUrl: string = await this.storeIssuanceObjectReturnUrl(invitationUrl); + const deeplLinkURL = convertUrlToDeepLinkUrl(shortenUrl); if (!invitationUrl) { diff --git a/apps/ledger/src/schema/repositories/schema.repository.ts b/apps/ledger/src/schema/repositories/schema.repository.ts index edc81e8e0..fadd449e5 100644 --- a/apps/ledger/src/schema/repositories/schema.repository.ts +++ b/apps/ledger/src/schema/repositories/schema.repository.ts @@ -5,7 +5,7 @@ import { ledgers, org_agents, org_agents_type, organisation, schema } from '@pri import { ISchema, ISchemaExist, ISchemaSearchCriteria } from '../interfaces/schema-payload.interface'; import { ResponseMessages } from '@credebl/common/response-messages'; import { AgentDetails, ISchemasWithCount } from '../interfaces/schema.interface'; -import { SortValue } from '@credebl/enum/enum'; +import { SchemaType, SortValue } from '@credebl/enum/enum'; import { ICredDefWithCount, IPlatformSchemas } from '@credebl/common/interfaces/schema.interface'; @Injectable() diff --git a/apps/ledger/src/schema/schema.service.ts b/apps/ledger/src/schema/schema.service.ts index 36b54e5b0..4fd90ee95 100644 --- a/apps/ledger/src/schema/schema.service.ts +++ b/apps/ledger/src/schema/schema.service.ts @@ -549,7 +549,7 @@ export class SchemaService extends BaseService { schema: { schemaName: schemaRequest.title, schemaVersion: W3CSchemaVersion.W3C_SCHEMA_VERSION, - attributes:extractedData, + attributes, id: schemaDetails.schemaUrl }, diff --git a/apps/organization/repositories/organization.repository.ts b/apps/organization/repositories/organization.repository.ts index 3b13946e3..7ce8c4ef3 100644 --- a/apps/organization/repositories/organization.repository.ts +++ b/apps/organization/repositories/organization.repository.ts @@ -621,6 +621,9 @@ export class OrganizationRepository { logoUrl: true, orgSlug: true, createDateTime: true, + countryId:true, + stateId: true, + cityId: true, ecosystemOrgs: { select: { ecosystemId: true @@ -874,7 +877,7 @@ export class OrganizationRepository { createDateTime: true, did: true, lastChangedDateTime: true, - isPrimaryDid: true + isPrimaryDid: true } }); } catch (error) { @@ -907,53 +910,52 @@ export class OrganizationRepository { ]); return ResponseMessages.organisation.success.didDetails; } catch (error) { - this.logger.error(`[setOrgsPrimaryDid] - Update DID details: ${JSON.stringify(error)}`); - throw error; + this.logger.error(`[setOrgsPrimaryDid] - Update DID details: ${JSON.stringify(error)}`); + throw error; } -} + } async getDidDetailsByDid(did:string): Promise { - try { - return this.prisma.org_dids.findFirstOrThrow({ - where: { - did - } - }); - } catch (error) { + try { + return this.prisma.org_dids.findFirstOrThrow({ + where: { + did + } + }); + } catch (error) { this.logger.error(`[getDidDetailsByDid] - get DID details: ${JSON.stringify(error)}`); throw error; + } } - } async getPerviousPrimaryDid(orgId:string): Promise { - try { - return this.prisma.org_dids.findFirstOrThrow({ - where: { - orgId, - isPrimaryDid: true - } - }); - } catch (error) { + try { + return this.prisma.org_dids.findFirstOrThrow({ + where: { + orgId, + isPrimaryDid: true + } + }); + } catch (error) { this.logger.error(`[getPerviousPrimaryDid] - get DID details: ${JSON.stringify(error)}`); throw error; + } } - } async setPreviousDidFlase(id:string): Promise { - try { - return this.prisma.org_dids.update({ - where: { - id - }, - data: { - isPrimaryDid: false - } - }); - } catch (error) { + try { + return this.prisma.org_dids.update({ + where: { + id + }, + data: { + isPrimaryDid: false + } + }); + } catch (error) { this.logger.error(`[setPreviousDidFlase] - Update DID details: ${JSON.stringify(error)}`); throw error; + } } - } - } diff --git a/apps/user/interfaces/user.interface.ts b/apps/user/interfaces/user.interface.ts index 9fabb6f4b..4db0a736d 100644 --- a/apps/user/interfaces/user.interface.ts +++ b/apps/user/interfaces/user.interface.ts @@ -120,31 +120,31 @@ export interface IUserCredentials { export interface IOrgUsers { totalPages: number, users: OrgUser[] - } - - export interface IDidList { - id: string; - createDateTime: Date; - did: string; - lastChangedDateTime: Date; - isPrimaryDid: boolean; - } - - interface OrgUser { - id: string; - username: string; - email: string; - firstName: string; - lastName: string; - isEmailVerified: boolean; - userOrgRoles: UserOrgRoles[]; - } - - interface UserOrgRoles { - id: string; - orgId: string; - orgRoleId: string; - orgRole: OrgRole; +} + +export interface IDidList { + id: string; + createDateTime: Date; + did: string; + lastChangedDateTime: Date; + isPrimaryDid: boolean; +} + +interface OrgUser { + id: string; + username: string; + email: string; + firstName: string; + lastName: string; + isEmailVerified: boolean; + userOrgRoles: UserOrgRoles[]; +} + +interface UserOrgRoles { + id: string; + orgId: string; + orgRoleId: string; + orgRole: OrgRole; organisation: Organization } interface OrgRole { diff --git a/apps/verification/src/verification.service.ts b/apps/verification/src/verification.service.ts index 2fec92269..e5ddd8948 100644 --- a/apps/verification/src/verification.service.ts +++ b/apps/verification/src/verification.service.ts @@ -417,6 +417,7 @@ export class VerificationService { if (ProofRequestType.INDY === type) { updateOutOfBandRequestProof.protocolVersion = updateOutOfBandRequestProof.protocolVersion || 'v1'; updateOutOfBandRequestProof.invitationDid = invitationDid || undefined; + updateOutOfBandRequestProof.imageUrl = getOrganization?.logoUrl || undefined; payload = { orgId: user.orgId, url, diff --git a/libs/common/src/interfaces/schema.interface.ts b/libs/common/src/interfaces/schema.interface.ts index 238974ad5..a51518e9b 100644 --- a/libs/common/src/interfaces/schema.interface.ts +++ b/libs/common/src/interfaces/schema.interface.ts @@ -40,6 +40,29 @@ export interface ISchemasWithPagination extends IPaginationDetails{ issuerId: string; } + interface Attribute { + attributeName: string; + schemaDataType: string; + displayName: string; + isRequired: boolean; + } + + export interface ISchemaDetail { + id: string; + createDateTime: string; + createdBy: string; + lastChangedDateTime: string; + lastChangedBy: string; + name: string; + version: string; + attributes: Attribute[]; + schemaLedgerId: string; + publisherDid: string; + issuerId: string; + orgId: string; + ledgerId: string; + type: string; + } export interface IPlatformSchemas { schemasCount: number; diff --git a/libs/common/src/response-messages/index.ts b/libs/common/src/response-messages/index.ts index 19af77b00..1bcbc9a7b 100644 --- a/libs/common/src/response-messages/index.ts +++ b/libs/common/src/response-messages/index.ts @@ -186,14 +186,38 @@ export const ResponseMessages = { credDefIdNotFound: 'Credential Definition Id not found' } }, - ledger: { - success: { - fetch: 'Ledger details retrieved successfully.', - fetchNetworkUrl: 'Network url retrieved successfully' - }, - error: { - NotFound: 'No ledgers found.' - } + error: { + invalidSchemaId: 'Invalid schema Id provided.', + invalidData: 'Invalid data provided.', + nameNotEmpty: 'Schema name is required', + versionNotEmpty: 'Schema version is required', + invalidVersion: 'Invalid schema version provided.', + insufficientAttributes: 'Please provide at least one attribute.', + uniqueAttributesnames: 'Please provide unique attribute names', + uniqueAttributesDisplaynames: 'Please provide unique display names for attributes', + emptyData: 'Please provide data for creating schema.', + exists: 'Schema already exists', + notCreated: 'Schema not created', + notFound: 'Schema records not found', + schemaIdNotFound: 'SchemaLedgerId not found', + credentialDefinitionNotFound: 'No credential definition exist', + notStoredCredential: 'User credential not stored', + agentDetailsNotFound: 'Agent details not found', + failedFetchSchema: 'Failed to fetch schema data', + atLeastOneRequired: 'At least one of the attributes should have isReuired as `true`', + schemaBuilder: 'Error while creating schema JSON', + schemaUploading: 'Error while uploading schema JSON', + W3CSchemaNotFOund: 'Error while resolving W3C schema', + storeW3CSchema: 'Error while storing W3C schema', + networkNotFound: 'Error while fetching network', + orgDidAndSchemaType: 'Organization DID and schema type does not match' + } + }, + credentialDefinition: { + success: { + fetch: 'Credential definition fetched successfully.', + create: 'Credential definition created successfully.', + template: 'Credential template fetched successfully.' }, agent: { success: {