Skip to content

Commit

Permalink
fix: Upgrade apollo to latest.
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Ribó Labrador <elribonazo@gmail.com>
  • Loading branch information
elribonazo committed May 9, 2024
1 parent 72e4510 commit fb5f6f4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
"outputName": "junit.xml"
},
"dependencies": {
"@atala/apollo": "^1.2.10",
"@atala/apollo": "^1.2.16",
"@scure/bip32": "^1.3.0",
"@scure/bip39": "^1.1.1",
"@stablelib/base64": "^1.0.1",
Expand Down Expand Up @@ -210,4 +210,4 @@
"overrides": {
"crypto-js": "^4.2.0"
}
}
}
8 changes: 4 additions & 4 deletions src/domain/models/VerifiableCredential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ export type PresentationExchangeDefinitionRequest = {
}
}

export type AllData = {
export type PresentationDefinitionData = {
[CredentialType.AnonCreds]: PresentationAnoncredsRequest;
[CredentialType.JWT]: PresentationExchangeDefinitionRequest;
[CredentialType.Unknown]: unknown;
[CredentialType.W3C]: unknown;
[CredentialType.Unknown]: any;
[CredentialType.W3C]: any;
};

export type PresentationDefinitionRequest<Type extends CredentialType = CredentialType.JWT> = AllData[Type]
export type PresentationDefinitionRequest<Type extends CredentialType = CredentialType.JWT> = PresentationDefinitionData[Type]

export type DescriptorItem = {
id: string,
Expand Down
8 changes: 4 additions & 4 deletions src/pollux/Pollux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ export default class Pollux implements IPollux {
return true;
}

async createPresentationDefinitionRequest(
type: CredentialType,
async createPresentationDefinitionRequest<Type extends CredentialType = CredentialType.JWT>(
type: Type,
presentationClaims: PresentationClaims,
options: PresentationOptions
): Promise<PresentationDefinitionRequest> {
): Promise<PresentationDefinitionRequest<Type>> {
if (type !== CredentialType.JWT) {
throw new PolluxError.CredentialTypeNotSupported()
}
Expand Down Expand Up @@ -211,7 +211,7 @@ export default class Pollux implements IPollux {
format: format
}

const presentationDefinitionRequest: PresentationDefinitionRequest = {
const presentationDefinitionRequest: PresentationDefinitionRequest<Type> = {
presentation_definition: {
id: uuid(),
input_descriptors: [
Expand Down

0 comments on commit fb5f6f4

Please sign in to comment.