Skip to content

Commit

Permalink
fix: use default export for imports and rename client to paradym (#8)
Browse files Browse the repository at this point in the history
* fix: use default export for imports and rename client to paradym

Signed-off-by: Ilias Elbarnoussi <[email protected]>

* remove unnecessary createSdjWTcredential method call

Signed-off-by: Ilias Elbarnoussi <[email protected]>

* import correct credential service from generated services

Signed-off-by: Ilias Elbarnoussi <[email protected]>

* fix styling

Signed-off-by: Ilias Elbarnoussi <[email protected]>

---------

Signed-off-by: Ilias Elbarnoussi <[email protected]>
Co-authored-by: Ilias Elbarnoussi <[email protected]>
  • Loading branch information
IliasElbarnoussi and IliasElbarnoussi authored Jun 10, 2024
1 parent 1fcdda8 commit 1426c21
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
CredentialTemplatesService,
OpenAPI,
OpenId4VcIssuanceService,
OpenId4VcVerificationService,
PresentationTemplatesService,
ProjectProfileService,
ProjectsService,
SdJwtVcCredentialTemplatesService,
WebhooksService,
} from '../generated'

Expand All @@ -14,7 +14,7 @@ export default class Paradym {
projectProfile: typeof ProjectProfileService
webhooks: typeof WebhooksService
templates: {
credentials: typeof CredentialTemplatesService
credentials: typeof SdJwtVcCredentialTemplatesService
presentations: typeof PresentationTemplatesService
}
openId4Vc: {
Expand All @@ -34,7 +34,7 @@ export default class Paradym {
this.webhooks = WebhooksService

this.templates = {
credentials: CredentialTemplatesService,
credentials: SdJwtVcCredentialTemplatesService,
presentations: PresentationTemplatesService,
}
this.openId4Vc = {
Expand Down
6 changes: 3 additions & 3 deletions test/credentialTemplate.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Credential Template', () => {
it('should return all SdJwtVc credential templates', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtCredentialTemplates = await client.templates.credentials.getAllSdJwtVcTemplates({
projectId: 'clwt6e610000101s69ubga6lk',
})
Expand All @@ -16,7 +16,7 @@ describe('Credential Template', () => {
})

it('should return a SdJwtVc credential template', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtCredentialTemplate = await client.templates.credentials.getSdJwtVcTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
credentialTemplateId: 'clwyt70o50021yylmethefm27',
Expand Down
4 changes: 2 additions & 2 deletions test/issuanceSession.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Issuance Session', () => {
it('should return all issuance sessions', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const issuanceSessions = await client.openId4Vc.issuance.getAllOpenId4VcIssuanceSessions({
projectId: 'clwt6e610000101s69ubga6lk',
})
Expand Down
12 changes: 6 additions & 6 deletions test/presentationTemplate.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Presentation Template', () => {
it('should return all SdJwtVc presentation templates', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtPresentationTemplates = await client.templates.presentations.getAllPresentationTemplatesPaginated({
projectId: 'clwt6e610000101s69ubga6lk',
})
Expand All @@ -16,7 +16,7 @@ describe('Presentation Template', () => {
})

it('should return a SdJwtVc presentation template', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtPresentationTemplate = await client.templates.presentations.getPresentationTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
presentationTemplateId: 'clwyt7ed60022yylmit88dkom',
Expand All @@ -26,7 +26,7 @@ describe('Presentation Template', () => {
})

it('should create a SdJwtVc presentation template', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtPresentationTemplate = await client.templates.presentations.createPresentationTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('Presentation Template', () => {
})

it('should archive a SdJwtVc presentation template', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtPresentationTemplate = await client.templates.presentations.createPresentationTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
Expand Down Expand Up @@ -118,7 +118,7 @@ describe('Presentation Template', () => {
})

it('should update a SdJwtVc presentation template', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const sdJwtPresentationTemplate = await client.templates.presentations.updatePresentationTemplate({
projectId: 'clwt6e610000101s69ubga6lk',
presentationTemplateId: 'clwyt7ed60022yylmit88dkom',
Expand Down
6 changes: 3 additions & 3 deletions test/projectProfile.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Project Profile', () => {
it('should return project profile', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const projectProfile = await client.projectProfile.getProfile({
projectId: 'clwt6e610000101s69ubga6lk',
})
Expand All @@ -15,7 +15,7 @@ describe('Project Profile', () => {
})

it('should update project profile', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const updatedProjectProfile = await client.projectProfile.updateProfile({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
Expand Down
4 changes: 2 additions & 2 deletions test/projects.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Projects', () => {
it('should return atleast one project', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const projects = await client.projects.getAllProjects()

assert.ok(projects.data.length > 0)
Expand Down
4 changes: 2 additions & 2 deletions test/verificationSession.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { strict as assert } from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Verification Session', () => {
it('should return all issuance sessions', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const verificationSessions = await client.openId4Vc.verification.getAllOpenId4VcVerificationSessions({
projectId: 'clwt6e610000101s69ubga6lk',
})
Expand Down
6 changes: 3 additions & 3 deletions test/webhook.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import dotenv from 'dotenv'
import { Client } from '../src/client'
import Paradym from '../src/client'
dotenv.config()

describe('Webhooks', () => {
it('should return all webhooks', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const webhooks = await client.webhooks.getWebhooks({
projectId: 'clwt6e610000101s69ubga6lk',
})
Expand All @@ -16,7 +16,7 @@ describe('Webhooks', () => {
})

it('should create and delete a webhook', async () => {
const client = new Client({ apiKey: process.env.X_ACCESS_TOKEN as string })
const client = new Paradym({ apiKey: process.env.X_ACCESS_TOKEN as string })
const createdWebhook = await client.webhooks.createWebhook({
projectId: 'clwt6e610000101s69ubga6lk',
requestBody: {
Expand Down

0 comments on commit 1426c21

Please sign in to comment.