Skip to content

Commit 5510042

Browse files
bhavanakarwadeKambleSahil3
authored andcommitted
feat: Support nested attributes while creating schema (#1166)
* wip: support nested attributes while creating schema Signed-off-by: bhavanakarwade <[email protected]> * wip: aligned issuance functionality with nested attributes structure Signed-off-by: bhavanakarwade <[email protected]> * refactor: modify csv to json function Signed-off-by: bhavanakarwade <[email protected]> * fix: formatting changes Signed-off-by: bhavanakarwade <[email protected]> * fix: resolved sonar cloud issue Signed-off-by: bhavanakarwade <[email protected]> * fix: security hotspot issue Signed-off-by: bhavanakarwade <[email protected]> * feat: added schema builder function Signed-off-by: bhavanakarwade <[email protected]> * fix: resolved issue Signed-off-by: bhavanakarwade <[email protected]> * refactor: modify extract attributes function Signed-off-by: bhavanakarwade <[email protected]> * fix: destructured objects Signed-off-by: bhavanakarwade <[email protected]> * feat: added description property Signed-off-by: bhavanakarwade <[email protected]> --------- Signed-off-by: bhavanakarwade <[email protected]> Signed-off-by: Sahil Kamble <[email protected]>
1 parent 684ab5a commit 5510042

29 files changed

+2753
-1455
lines changed

apps/api-gateway/src/dtos/create-schema.dto.ts

Lines changed: 321 additions & 169 deletions
Large diffs are not rendered by default.

apps/api-gateway/src/issuance/issuance.service.ts

Lines changed: 235 additions & 139 deletions
Large diffs are not rendered by default.

apps/issuance/interfaces/issuance.interfaces.ts

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,36 @@ export interface IAttributes {
1616
interface ICredentialsAttributes {
1717
connectionId: string;
1818
attributes: IAttributes[];
19-
credential?:ICredential;
20-
options?:IOptions
19+
credential?: ICredential;
20+
options?: IOptions;
2121
}
2222
export interface IIssuance {
2323
user?: IUserRequest;
2424
credentialDefinitionId: string;
2525
comment?: string;
2626
credentialData: ICredentialsAttributes[];
2727
orgId: string;
28-
autoAcceptCredential?: AutoAccept,
28+
autoAcceptCredential?: AutoAccept;
2929
protocolVersion?: string;
30-
goalCode?: string,
31-
parentThreadId?: string,
32-
willConfirm?: boolean,
33-
label?: string,
34-
credentialType: string,
30+
goalCode?: string;
31+
parentThreadId?: string;
32+
willConfirm?: boolean;
33+
label?: string;
34+
credentialType: string;
3535
}
3636

3737
interface IIndy {
38-
attributes: IAttributes[],
39-
credentialDefinitionId: string
38+
attributes: IAttributes[];
39+
credentialDefinitionId: string;
4040
}
4141

4242
export interface IIssueData {
4343
protocolVersion?: string;
4444
connectionId: string;
4545
credentialFormats: {
46-
indy: IIndy
47-
},
48-
autoAcceptCredential: string,
46+
indy: IIndy;
47+
};
48+
autoAcceptCredential: string;
4949
comment?: string;
5050
}
5151

@@ -90,8 +90,8 @@ export interface IPattern {
9090
}
9191

9292
export interface ISendOfferNatsPayload {
93-
issueData: IIssueData,
94-
url: string,
93+
issueData: IIssueData;
94+
url: string;
9595
apiKey?: string;
9696
orgId?: string;
9797
}
@@ -137,8 +137,8 @@ export interface ICredentialAttributesInterface {
137137
value: string;
138138
}
139139

140-
export interface ICredential{
141-
'@context':[];
140+
export interface ICredential {
141+
'@context': [];
142142
type: string[];
143143
prettyVc?: IPrettyVc;
144144
issuer?: {
@@ -152,15 +152,15 @@ interface ICredentialSubject {
152152
[key: string]: string;
153153
}
154154

155-
export interface IOptions{
156-
proofType:string;
157-
proofPurpose:string;
155+
export interface IOptions {
156+
proofType: string;
157+
proofPurpose: string;
158158
}
159159
export interface CredentialOffer {
160160
emailId: string;
161161
attributes: IAttributes[];
162-
credential?:ICredential;
163-
options?:IOptions
162+
credential?: ICredential;
163+
options?: IOptions;
164164
}
165165
export interface OutOfBandCredentialOfferPayload {
166166
credentialDefinitionId?: string;
@@ -171,13 +171,13 @@ export interface OutOfBandCredentialOfferPayload {
171171
attributes?: IAttributes[];
172172
protocolVersion?: string;
173173
isReuseConnection?: boolean;
174-
goalCode?: string,
175-
parentThreadId?: string,
176-
willConfirm?: boolean,
177-
label?: string,
178-
imageUrl?: string,
174+
goalCode?: string;
175+
parentThreadId?: string;
176+
willConfirm?: boolean;
177+
label?: string;
178+
imageUrl?: string;
179179
autoAcceptCredential?: string;
180-
credentialType?:IssueCredentialType;
180+
credentialType?: IssueCredentialType;
181181
}
182182

183183
export interface OutOfBandCredentialOffer {
@@ -199,30 +199,30 @@ export interface ImportFileDetails {
199199
isValidateSchema?: boolean;
200200
}
201201
export interface ICredentialPayload {
202-
schemaLedgerId: string,
203-
credentialDefinitionId: string,
204-
fileData: object,
205-
fileName: string,
206-
credentialType: string,
207-
schemaName?: string
202+
schemaLedgerId: string;
203+
credentialDefinitionId: string;
204+
fileData: object;
205+
fileName: string;
206+
credentialType: string;
207+
schemaName?: string;
208208
}
209209
export interface PreviewRequest {
210-
pageNumber: number,
211-
pageSize: number,
212-
searchByText: string,
213-
sortField?: string,
214-
sortBy?: string
210+
pageNumber: number;
211+
pageSize: number;
212+
searchByText: string;
213+
sortField?: string;
214+
sortBy?: string;
215215
}
216216

217217
export interface FileUpload {
218-
name?: string,
219-
upload_type?: string,
220-
status?: string,
221-
orgId?: string,
222-
createDateTime?: Date | null,
223-
lastChangedDateTime?: Date | null,
224-
credentialType?: string,
225-
templateId?: string
218+
name?: string;
219+
upload_type?: string;
220+
status?: string;
221+
orgId?: string;
222+
createDateTime?: Date | null;
223+
lastChangedDateTime?: Date | null;
224+
credentialType?: string;
225+
templateId?: string;
226226
}
227227

228228
export interface FileUploadData {
@@ -284,19 +284,19 @@ export interface SendEmailCredentialOffer {
284284
iterator: CredentialOffer;
285285
emailId: string;
286286
index: number;
287-
credentialType: IssueCredentialType;
287+
credentialType: IssueCredentialType;
288288
protocolVersion: string;
289289
isReuseConnection?: boolean;
290-
attributes: IAttributes[];
291-
credentialDefinitionId: string;
290+
attributes: IAttributes[];
291+
credentialDefinitionId: string;
292292
outOfBandCredential: OutOfBandCredentialOfferPayload;
293293
comment: string;
294-
organisation: organisation;
294+
organisation: organisation;
295295
errors;
296296
url: string;
297-
orgId: string;
297+
orgId: string;
298298
organizationDetails: organisation;
299-
platformName?: string,
299+
platformName?: string;
300300
organizationLogoUrl?: string;
301301
prettyVc?: IPrettyVc;
302302
isValidateSchema?: boolean;
@@ -321,12 +321,12 @@ export interface IJobDetails {
321321
schemaLedgerId: string;
322322
credentialDefinitionId?: string;
323323
status?: boolean;
324-
credential_data: CredentialData
324+
credential_data: CredentialData;
325325
orgId: string;
326326
credentialType: string;
327327
}
328328

329-
export interface IQueuePayload{
329+
export interface IQueuePayload {
330330
id: string;
331331
jobId: string;
332332
cacheId?: string;
@@ -356,17 +356,17 @@ export interface IQueuePayload{
356356
interface FileDetails {
357357
schemaLedgerId: string;
358358
credentialDefinitionId: string;
359-
fileData:object
359+
fileData: object;
360360
fileName: string;
361361
credentialType: string;
362362
schemaName: string;
363363
}
364364
export interface IBulkPayloadObject {
365-
parsedData?: unknown[],
366-
parsedFileDetails?: FileDetails,
367-
userId: string,
368-
fileUploadId: string
369-
};
365+
parsedData?: unknown[];
366+
parsedFileDetails?: FileDetails;
367+
userId: string;
368+
fileUploadId: string;
369+
}
370370
export interface ISchemaAttributes {
371371
attributeName: string;
372372
schemaDataType: string;
@@ -399,4 +399,4 @@ export interface BulkPayloadDetails {
399399

400400
export interface ISchemaId {
401401
schemaLedgerId: string;
402-
}
402+
}

0 commit comments

Comments
 (0)