Skip to content

Commit

Permalink
chore: update biome and apply fixes (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Mar 22, 2024
1 parent a7f12ce commit 9473062
Show file tree
Hide file tree
Showing 211 changed files with 2,423 additions and 1,751 deletions.
10 changes: 5 additions & 5 deletions libs/did-provider-ebsi/src/ebsiDidOnboarding.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { randomBytes } from 'crypto';
import { randomBytes } from 'node:crypto';
import { Agent } from '@cef-ebsi/siop-auth';
import {
EbsiIssuer,
EbsiVerifiablePresentation,
type EbsiIssuer,
type EbsiVerifiablePresentation,
createVerifiablePresentationJwt,
} from '@cef-ebsi/verifiable-presentation';
import { IIdentifier } from '@veramo/core';
import type { IIdentifier } from '@veramo/core';
import { Wallet, ethers } from 'ethers';
import * as jose from 'jose';
import { v4 as uuidv4 } from 'uuid';

import { EbsiConfig, EbsiEndpoints } from './constants.js';
import { algoMap, privateKeyJwkToHex } from './ebsiDidUtils.js';
import {
import type {
IEbsiDidSupportedKeyTypes,
IKeyJwks,
IRPCResult,
Expand Down
4 changes: 2 additions & 2 deletions libs/did-provider-ebsi/src/ebsiDidProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
IAgentContext,
IIdentifier,
IKey,
Expand All @@ -17,7 +17,7 @@ import {
generateRandomEbsiSubjectIdentifier,
privateKeyJwkToHex,
} from './ebsiDidUtils.js';
import {
import type {
IContext,
IEbsiCreateIdentifierOptions,
IEbsiDidSupportedEcdsaAlgo,
Expand Down
10 changes: 5 additions & 5 deletions libs/did-provider-ebsi/src/ebsiDidResolver.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getResolver } from '@cef-ebsi/ebsi-did-resolver';
import {
DIDResolutionOptions,
DIDResolutionResult,
DIDResolver,
ParsedDID,
Resolvable,
type DIDResolutionOptions,
type DIDResolutionResult,
type DIDResolver,
type ParsedDID,
type Resolvable,
Resolver,
} from 'did-resolver';

Expand Down
6 changes: 3 additions & 3 deletions libs/did-provider-ebsi/src/ebsiDidUtils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { randomBytes } from 'crypto';
import * as jose from 'jose';
import { randomBytes } from 'node:crypto';
import type * as jose from 'jose';
import { base58btc } from 'multiformats/bases/base58';

import {
import type {
IEbsiDidSupportedEcdsaAlgo,
IEbsiDidSupportedKeyTypes,
} from './types/ebsiProviderTypes.js';
Expand Down
6 changes: 3 additions & 3 deletions libs/did-provider-ebsi/src/types/ebsiProviderTypes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { EbsiVerifiablePresentation } from '@cef-ebsi/verifiable-presentation';
import {
import type { EbsiVerifiablePresentation } from '@cef-ebsi/verifiable-presentation';
import type {
IAgentContext,
ICredentialIssuer,
IKeyManager,
IResolver,
} from '@veramo/core';
import { JWK } from 'jose';
import type { JWK } from 'jose';

export type IContext = IAgentContext<
IKeyManager & ICredentialIssuer & IResolver
Expand Down
2 changes: 1 addition & 1 deletion libs/did-provider-ebsi/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Options, defineConfig } from 'tsup';
import { type Options, defineConfig } from 'tsup';

export default defineConfig((options: Options) => ({
target: 'es2020',
Expand Down
7 changes: 1 addition & 6 deletions libs/did-provider-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
"module": "./dist/index.js",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"files": [
"dist/**",
"README.md",
"package.json",
"CHANGELOG.md"
],
"files": ["dist/**", "README.md", "package.json", "CHANGELOG.md"],
"scripts": {
"build": "pnpm clean && pnpm compile",
"clean": "rimraf dist",
Expand Down
6 changes: 3 additions & 3 deletions libs/did-provider-key/src/keyDidUtils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { MULTICODEC_CODE_TO_NAME } from '@blockchain-lab-um/utils';

import {
DidComponents,
KeyType,
type DidComponents,
type KeyType,
MULTICODEC_NAME_TO_KEY_TYPE,
} from './types/keyDidTypes.js';

Expand All @@ -22,7 +22,7 @@ export const checkDidComponents = (did: string): DidComponents => {
throw new Error('invalidDid: invalid scheme or method');
}

const parsedVersion = parseInt(version, 10);
const parsedVersion = Number.parseInt(version, 10);
if (Number.isNaN(parsedVersion) || parsedVersion <= 0) {
throw new Error('invalidDid: invalid version');
}
Expand Down
4 changes: 2 additions & 2 deletions libs/did-provider-key/src/types/keyDidTypes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CodecName, isIn } from '@blockchain-lab-um/utils';
import { DIDDocument } from 'did-resolver';
import { type CodecName, isIn } from '@blockchain-lab-um/utils';
import type { DIDDocument } from 'did-resolver';

export interface ICreateKeyDidOptions {
keyType?: KeyType;
Expand Down
2 changes: 1 addition & 1 deletion libs/did-provider-key/tests/agent.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as fs from 'fs';
import * as fs from 'node:fs';
import {
type IAgentOptions,
type ICredentialPlugin,
Expand Down
2 changes: 1 addition & 1 deletion libs/did-provider-key/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Options, defineConfig } from 'tsup';
import { type Options, defineConfig } from 'tsup';

export default defineConfig((options: Options) => ({
target: 'es2020',
Expand Down
7 changes: 1 addition & 6 deletions libs/extended-verification/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
"module": "./dist/index.js",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"files": [
"dist/**",
"README.md",
"package.json",
"CHANGELOG.md"
],
"files": ["dist/**", "README.md", "package.json", "CHANGELOG.md"],
"scripts": {
"build": "pnpm clean && pnpm compile",
"clean": "rimraf dist",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IIdentifier } from '@veramo/core';
import { writeFile } from 'fs/promises';
import type { IIdentifier } from '@veramo/core';
import { writeFile } from 'node:fs/promises';

import { Agent, CREDENTIAL_DATA, createJWTCredential } from './utils';
import { type Agent, CREDENTIAL_DATA, createJWTCredential } from './utils';

export const generateInvalidCredentials = async (
agent: Agent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IIdentifier, VerifiableCredential } from '@veramo/core';
import { writeFile } from 'fs/promises';
import type { IIdentifier, VerifiableCredential } from '@veramo/core';
import { writeFile } from 'node:fs/promises';

import { Agent } from './utils';
import type { Agent } from './utils';
import { createJWTPresentation } from './utils/createJWTPresentation';

interface GenerateInvalidPresentationsOptions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IIdentifier } from '@veramo/core';
import { writeFile } from 'fs/promises';
import type { IIdentifier } from '@veramo/core';
import { writeFile } from 'node:fs/promises';

import { Agent, CREDENTIAL_DATA, createJWTCredential } from './utils';
import { type Agent, CREDENTIAL_DATA, createJWTCredential } from './utils';

export const generateValidCredentials = async (
agent: Agent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IIdentifier, VerifiableCredential } from '@veramo/core';
import { writeFile } from 'fs/promises';
import type { IIdentifier, VerifiableCredential } from '@veramo/core';
import { writeFile } from 'node:fs/promises';

import { Agent } from './utils';
import type { Agent } from './utils';
import { createJWTPresentation } from './utils/createJWTPresentation';

export const generateValidPresentations = async (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { writeFile } from 'fs/promises';
import { writeFile } from 'node:fs/promises';

export const createEntrypoint = async (files: string[]) => {
let entrypoint = `import { VerifiableCredential, VerifiablePresentation } from '@veramo/core';\n
Expand Down
10 changes: 5 additions & 5 deletions libs/extended-verification/scripts/utils/createJWTCredential.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { IIdentifier } from '@veramo/core';
import { Signer } from 'did-jwt';
import type { IIdentifier } from '@veramo/core';
import type { Signer } from 'did-jwt';
import {
Issuer,
JwtCredentialPayload,
type Issuer,
type JwtCredentialPayload,
createVerifiableCredentialJwt,
normalizeCredential,
} from 'did-jwt-vc';

import { CREDENTIAL_DATA } from './constants';
import { Agent } from './createVeramoAgent';
import type { Agent } from './createVeramoAgent';

export const createJWTCredential = async (
agent: Agent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { IIdentifier } from '@veramo/core';
import { Signer } from 'did-jwt';
import type { IIdentifier } from '@veramo/core';
import type { Signer } from 'did-jwt';
import {
Issuer,
JwtPresentationPayload,
type Issuer,
type JwtPresentationPayload,
createVerifiablePresentationJwt,
normalizePresentation,
} from 'did-jwt-vc';

import { Agent } from './createVeramoAgent';
import type { Agent } from './createVeramoAgent';

export const createJWTPresentation = async (
agent: Agent,
Expand Down
16 changes: 8 additions & 8 deletions libs/extended-verification/scripts/utils/createVeramoAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import {
getDidKeyResolver as keyDidResolver,
} from '@blockchain-lab-um/did-provider-key';
import {
ICredentialIssuer,
ICredentialVerifier,
IDIDManager,
IKeyManager,
IResolver,
TAgent,
type ICredentialIssuer,
type ICredentialVerifier,
type IDIDManager,
type IKeyManager,
type IResolver,
type TAgent,
createAgent,
} from '@veramo/core';
import {
CredentialIssuerEIP712,
ICredentialIssuerEIP712,
type ICredentialIssuerEIP712,
} from '@veramo/credential-eip712';
import { CredentialPlugin } from '@veramo/credential-w3c';
import {
AbstractIdentifierProvider,
type AbstractIdentifierProvider,
DIDManager,
MemoryDIDStore,
} from '@veramo/did-manager';
Expand Down
6 changes: 3 additions & 3 deletions libs/extended-verification/src/Verification.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Result, ResultObject } from '@blockchain-lab-um/utils';
import {
import { type Result, ResultObject } from '@blockchain-lab-um/utils';
import type {
VerifiableCredential,
VerifiablePresentation,
W3CVerifiableCredential,
W3CVerifiablePresentation,
} from '@veramo/core';
import { normalizeCredential, normalizePresentation } from 'did-jwt-vc';
import { Provider } from 'ethers';
import type { Provider } from 'ethers';

import { type Agent, createVeramoAgent } from './createVeramoAgent';

Expand Down
8 changes: 4 additions & 4 deletions libs/extended-verification/src/createVeramoAgent.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getDidKeyResolver as keyDidResolver } from '@blockchain-lab-um/did-provider-key';
import {
ICredentialVerifier,
IResolver,
TAgent,
type ICredentialVerifier,
type IResolver,
type TAgent,
createAgent,
} from '@veramo/core';
import { CredentialIssuerEIP712 } from '@veramo/credential-eip712';
Expand All @@ -12,7 +12,7 @@ import { getDidPkhResolver as pkhDidResolver } from '@veramo/did-provider-pkh';
import { DIDResolverPlugin } from '@veramo/did-resolver';
import { Resolver } from 'did-resolver';
import { getResolver as ensDidResolver } from 'ens-did-resolver';
import { JsonRpcProvider, Provider } from 'ethers';
import { JsonRpcProvider, type Provider } from 'ethers';
import { getResolver as ethrDidResolver } from 'ethr-did-resolver';

export interface CreateVeramoAgentProps {
Expand Down
5 changes: 4 additions & 1 deletion libs/extended-verification/tests/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { VerifiableCredential, VerifiablePresentation } from '@veramo/core';
import type {
VerifiableCredential,
VerifiablePresentation,
} from '@veramo/core';

import { readJSON } from '../utils/readJSON';

Expand Down
2 changes: 1 addition & 1 deletion libs/extended-verification/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Options, defineConfig } from 'tsup';
import { type Options, defineConfig } from 'tsup';

export default defineConfig((options: Options) => ({
target: 'es2020',
Expand Down
7 changes: 1 addition & 6 deletions libs/oidc/client-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"module": "./dist/index.js",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"files": [
"dist/",
"README.md",
"CHANGELOG.md",
"package.json"
],
"files": ["dist/", "README.md", "CHANGELOG.md", "package.json"],
"scripts": {
"build": "pnpm clean && pnpm compile",
"clean": "rimraf dist",
Expand Down
22 changes: 11 additions & 11 deletions libs/oidc/client-plugin/src/agent/client-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
type AuthorizationRequest,
type CredentialOffer,
type CredentialResponse,
type IssuerServerMetadata,
type OAuth2AuthorizationServerMetadata,
type PresentationDefinition,
type PresentationSubmission,
type Proof,
type SupportedCredential,
type TokenResponse,
import type {
AuthorizationRequest,
CredentialOffer,
CredentialResponse,
IssuerServerMetadata,
OAuth2AuthorizationServerMetadata,
PresentationDefinition,
PresentationSubmission,
Proof,
SupportedCredential,
TokenResponse,
} from '@blockchain-lab-um/oidc-types';
import {
type Result,
Expand Down
2 changes: 1 addition & 1 deletion libs/oidc/client-plugin/tests/localAgent.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Shared tests
import { describe } from 'vitest';

import myPluginLogic, { ConfiguredAgent } from './shared/integration.js';
import myPluginLogic, { type ConfiguredAgent } from './shared/integration.js';

// let dbConnection: any;
let agent: ConfiguredAgent;
Expand Down
4 changes: 2 additions & 2 deletions libs/oidc/client-plugin/tests/shared/integration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TAgent } from '@veramo/core';
import type { TAgent } from '@veramo/core';
import { afterAll, beforeAll, describe, it } from 'vitest';

import { IOIDCClientPlugin } from '../../src/types/IOIDCClientPlugin.js';
import type { IOIDCClientPlugin } from '../../src/types/IOIDCClientPlugin.js';

export type ConfiguredAgent = TAgent<IOIDCClientPlugin>;

Expand Down
2 changes: 1 addition & 1 deletion libs/oidc/client-plugin/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Options, defineConfig } from 'tsup';
import { type Options, defineConfig } from 'tsup';

export default defineConfig((options: Options) => ({
target: 'es2020',
Expand Down
Loading

0 comments on commit 9473062

Please sign in to comment.