-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: implement isHmacValid function to verify HMAC signatures Signed-off-by: Ilias Elbarnoussi <[email protected]> * hmac validation with nobles/hashes * Update package.json Co-authored-by: Berend Sliedrecht <[email protected]> * add biomejs and pnpm Signed-off-by: Ilias Elbarnoussi <[email protected]> * change license in package.json & add license in root Signed-off-by: Ilias Elbarnoussi <[email protected]> * add client with the bundled services Signed-off-by: Ilias Elbarnoussi <[email protected]> * resolve comments Signed-off-by: Ilias Elbarnoussi <[email protected]> * remove generated from gitignore && yarn style fixes Signed-off-by: Ilias Elbarnoussi <[email protected]> * gitignore generated directory Signed-off-by: Ilias Elbarnoussi <[email protected]> * delete generated directory Signed-off-by: Ilias Elbarnoussi <[email protected]> --------- Signed-off-by: Ilias Elbarnoussi <[email protected]> Co-authored-by: Ilias Elbarnoussi <[email protected]> Co-authored-by: Berend Sliedrecht <[email protected]>
- Loading branch information
1 parent
170f64b
commit 571ecdc
Showing
10 changed files
with
191 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
name: Validate code (Biome Linting, Biome Formatting, TypeScript) | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
- name: Setup Biome CLI | ||
uses: biomejs/setup-biome@v2 | ||
with: | ||
version: latest | ||
|
||
- name: Run Biome | ||
run: biome ci . | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Generate output files | ||
env: | ||
SERVER: https://api.paradym.id | ||
run: pnpm generate | ||
|
||
- name: Build packages | ||
run: pnpm build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.DS_Store | ||
node_modules | ||
.env | ||
src/generated | ||
generated | ||
.idea | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.6.2/schema.json", | ||
"formatter": { | ||
"lineWidth": 120, | ||
"indentStyle": "space" | ||
}, | ||
"javascript": { | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
}, | ||
"formatter": { | ||
"semicolons": "asNeeded", | ||
"quoteStyle": "single", | ||
"trailingComma": "es5", | ||
"lineWidth": 120, | ||
"indentStyle": "space" | ||
} | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true | ||
} | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
"$schema": "https://biomejs.dev/schemas/1.6.2/schema.json", | ||
"formatter": { | ||
"lineWidth": 120, | ||
"indentStyle": "space" | ||
}, | ||
"files": { | ||
"ignore": ["generated"] | ||
}, | ||
"javascript": { | ||
"parser": { | ||
"unsafeParameterDecoratorsEnabled": true | ||
}, | ||
"linter": { | ||
"enabled": true | ||
}, | ||
"vcs": { | ||
"useIgnoreFile": true, | ||
"clientKind": "git", | ||
"enabled": true | ||
"formatter": { | ||
"semicolons": "asNeeded", | ||
"quoteStyle": "single", | ||
"trailingComma": "es5", | ||
"lineWidth": 120, | ||
"indentStyle": "space" | ||
} | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true | ||
} | ||
} | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true | ||
}, | ||
"vcs": { | ||
"useIgnoreFile": true, | ||
"clientKind": "git", | ||
"enabled": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
import "dotenv/config"; | ||
import { defineConfig } from "@hey-api/openapi-ts"; | ||
import * as process from "node:process"; | ||
import type { UserConfig } from '@hey-api/openapi-ts' | ||
|
||
export default defineConfig({ | ||
input: `${process.env.SERVER}/openapi-docs.json`, | ||
output: "src/generated", | ||
}); | ||
// Issues with the configuring through the defineConfig helper function | ||
// Error(TS4082) | | ||
// Default export of the module has or is using private name ClientConfig . | ||
// export default defineConfig({ | ||
// input: 'https://api.paradym.id/openapi.json', | ||
// output: 'src/generated', | ||
// services: { | ||
// asClass: true, | ||
// }, | ||
// }) | ||
|
||
const config: UserConfig = { | ||
input: process.env.SERVER ?? 'https://api.paradym.id/openapi.json', | ||
output: 'generated', | ||
services: { | ||
asClass: true, | ||
}, | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"name": "paradym-sdk-ts", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"generate": "openapi-ts", | ||
"build": "tsc", | ||
"style": "biome check .", | ||
"style:fix": "biome check . --apply-unsafe" | ||
}, | ||
"dependencies": { | ||
"@noble/hashes": "^1.4.0", | ||
"dotenv": "^16.4.5" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.7.3", | ||
"@hey-api/openapi-ts": "^0.46.3", | ||
"@types/node": "^20.12.6", | ||
"tsx": "^4.7.2", | ||
"typescript": "~5.4.5" | ||
} | ||
"name": "paradym-sdk-ts", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"generate": "openapi-ts", | ||
"build": "pnpm generate && tsc", | ||
"style": "biome check .", | ||
"style:fix": "biome check . --apply-unsafe" | ||
}, | ||
"dependencies": { | ||
"@noble/hashes": "^1.4.0" | ||
}, | ||
"devDependencies": { | ||
"dotenv": "^16.4.5", | ||
"@biomejs/biome": "1.7.3", | ||
"@hey-api/openapi-ts": "^0.46.3", | ||
"@types/node": "^20.12.6", | ||
"tsx": "^4.7.2", | ||
"typescript": "~5.4.5" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { | ||
CredentialTemplatesService, | ||
OpenAPI, | ||
OpenId4VcIssuanceService, | ||
OpenId4VcVerificationService, | ||
PresentationTemplatesService, | ||
ProjectProfileService, | ||
ProjectsService, | ||
WebhooksService, | ||
} from '../generated' | ||
|
||
export class Client { | ||
projects: typeof ProjectsService | ||
projectProfile: typeof ProjectProfileService | ||
webhooks: typeof WebhooksService | ||
templates: { | ||
credentials: typeof CredentialTemplatesService | ||
presentations: typeof PresentationTemplatesService | ||
} | ||
openId4Vc: { | ||
issuance: typeof OpenId4VcIssuanceService | ||
verification: typeof OpenId4VcVerificationService | ||
} | ||
|
||
constructor({ apiKey, baseUrl = 'https://api.paradym.id' }: { apiKey: string; baseUrl?: string }) { | ||
OpenAPI.HEADERS = { | ||
'x-access-token': apiKey, | ||
} | ||
|
||
OpenAPI.BASE = baseUrl | ||
|
||
this.projects = ProjectsService | ||
this.projectProfile = ProjectProfileService | ||
this.webhooks = WebhooksService | ||
|
||
this.templates = { | ||
credentials: CredentialTemplatesService, | ||
presentations: PresentationTemplatesService, | ||
} | ||
this.openId4Vc = { | ||
issuance: OpenId4VcIssuanceService, | ||
verification: OpenId4VcVerificationService, | ||
} | ||
} | ||
} |
Oops, something went wrong.