Skip to content

Commit

Permalink
fix templates structure
Browse files Browse the repository at this point in the history
  • Loading branch information
IliasElbarnoussi committed Jun 12, 2024
1 parent 31282d6 commit 71f48b6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
21 changes: 9 additions & 12 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ export default class Paradym {
projectProfile: typeof ProjectProfileService
webhooks: typeof WebhooksService
templates: {
sdJwtVc: {
credentials: typeof SdJwtVcCredentialTemplatesService
presentations: typeof PresentationTemplatesService
}
anoncreds: {
credentials: typeof AnoncredsCredentialTemplatesService
presentations: typeof PresentationTemplatesService
credentials: {
sdJwtVc: typeof SdJwtVcCredentialTemplatesService
anoncreds: typeof AnoncredsCredentialTemplatesService
}
}

Expand Down Expand Up @@ -61,14 +59,13 @@ export default class Paradym {
this.webhooks = WebhooksService

this.templates = {
sdJwtVc: {
credentials: SdJwtVcCredentialTemplatesService,
presentations: PresentationTemplatesService,
},
anoncreds: {
credentials: AnoncredsCredentialTemplatesService,
presentations: PresentationTemplatesService,
credentials: {
sdJwtVc: SdJwtVcCredentialTemplatesService,
anoncreds: AnoncredsCredentialTemplatesService,
},
}

this.openId4Vc = {
issuance: OpenId4VcIssuanceService,
verification: OpenId4VcVerificationService,
Expand Down
4 changes: 2 additions & 2 deletions test/credentialTemplate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dotenv.config()
describe('Credential Template', () => {
it('should return all SdJwtVc credential templates', async () => {
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtCredentialTemplates = await client.templates.credentials.getAllSdJwtVcTemplates({
const sdJwtCredentialTemplates = await client.templates.credentials.sdJwtVc.getAllCredentialTemplates({
projectId: 'clwt6e610000101s69ubga6lk',
})

Expand All @@ -17,7 +17,7 @@ describe('Credential Template', () => {

it('should return a SdJwtVc credential template', async () => {
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtCredentialTemplate = await client.templates.credentials.getSdJwtVcTemplate({
const sdJwtCredentialTemplate = await client.templates.credentials.sdJwtVc.getSdJwtVcTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
credentialTemplateId: 'clwyt70o50021yylmethefm27',
})
Expand Down
2 changes: 1 addition & 1 deletion test/presentationTemplate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dotenv.config()
describe('Presentation Template', () => {
it('should return all SdJwtVc presentation templates', async () => {
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtPresentationTemplates = await client.templates.presentations.getAllPresentationTemplatesPaginated({
const sdJwtPresentationTemplates = await client.templates.presentations.getAllPresentationTemplates({
projectId: 'clwt6e610000101s69ubga6lk',
})

Expand Down

0 comments on commit 71f48b6

Please sign in to comment.