Skip to content

Commit

Permalink
[BRO-48] Enable ZK proof generations with new company identities
Browse files Browse the repository at this point in the history
Created additional type for IDENTITY_SUBJECT_SCHEMA
  • Loading branch information
Ivan-Mahda committed Sep 12, 2024
1 parent d45077b commit c042332
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions packages/sdk/src/web3-id/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type CredentialSchemaAttributes = {
title?: string;
description?: string;
type: 'object';
properties: Record<AttributeKey, CredentialSchemaProperty | TimestampProperty>;
properties: Record<string, CredentialSchemaProperty | TimestampProperty>;
required: string[];
};

Expand All @@ -100,7 +100,22 @@ export type CredentialSchemaSubject = {
required: string[];
};

export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = {
type Override<Type, NewType> = Omit<Type, keyof NewType> & NewType;

type IdCredentialSchemaSubject = Override<
CredentialSchemaSubject,
{
properties: {
id: IdDetails;
attributes: Override<
CredentialSchemaAttributes,
{ properties: Record<AttributeKey, CredentialSchemaProperty | TimestampProperty> }
>;
};
}
>;

export const IDENTITY_SUBJECT_SCHEMA: IdCredentialSchemaSubject = {
type: 'object',
properties: {
id: {
Expand Down Expand Up @@ -165,7 +180,7 @@ export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = {
},
lei: {
title: 'Legal Entity Identifier (LEI)',
type: 'string'
type: 'string',
},
legalName: {
title: 'Legal Name',
Expand All @@ -182,7 +197,7 @@ export const IDENTITY_SUBJECT_SCHEMA: CredentialSchemaSubject = {
registrationAuth: {
title: 'Registration Authority',
type: 'string',
}
},
},
required: [],
},
Expand Down

0 comments on commit c042332

Please sign in to comment.