From e335886f8f3d528a6b3ef76c5adb5d254135d777 Mon Sep 17 00:00:00 2001 From: olegnn Date: Tue, 5 Nov 2024 22:34:06 +0100 Subject: [PATCH] Lints --- packages/credential-sdk/src/vc/credentials.js | 17 +++-- .../credential-sdk/src/vc/custom_crypto.js | 72 ------------------- packages/credential-sdk/src/vc/index.js | 38 +++++----- packages/credential-sdk/src/vc/revocation.js | 3 - 4 files changed, 26 insertions(+), 104 deletions(-) delete mode 100644 packages/credential-sdk/src/vc/custom_crypto.js diff --git a/packages/credential-sdk/src/vc/credentials.js b/packages/credential-sdk/src/vc/credentials.js index 8f78cf220..88d4f4d86 100644 --- a/packages/credential-sdk/src/vc/credentials.js +++ b/packages/credential-sdk/src/vc/credentials.js @@ -15,20 +15,12 @@ import defaultDocumentLoader from './document-loader'; import { getAndValidateSchemaIfPresent } from './schema'; import { checkRevocationRegistryStatus, - DockRevRegQualifier, getCredentialStatus, isAccumulatorRevocationStatus, isRegistryRevocationStatus, - RevRegType, } from './revocation'; - -import { - getSuiteFromKeyDoc, - expandJSONLD, - getKeyFromDIDDocument, - processIfKvac, -} from './helpers'; import { + DockRevRegQualifier, RevRegType, DEFAULT_CONTEXT_V1_URL, credentialContextField, PrivateStatusList2021EntryType, @@ -36,6 +28,13 @@ import { StatusList2021EntryType, PrivateStatusList2021Qualifier, } from './constants'; + +import { + getSuiteFromKeyDoc, + expandJSONLD, + getKeyFromDIDDocument, + processIfKvac, +} from './helpers'; import { ensureValidDatetime } from '../utils/type-helpers'; import { diff --git a/packages/credential-sdk/src/vc/custom_crypto.js b/packages/credential-sdk/src/vc/custom_crypto.js deleted file mode 100644 index d3b108894..000000000 --- a/packages/credential-sdk/src/vc/custom_crypto.js +++ /dev/null @@ -1,72 +0,0 @@ -import { - EcdsaSecp256k1VerKeyName, - EcdsaSecp256k1SigName, - Ed25519VerKeyName, - Ed25519SigName, - Ed255192020VerKeyName, - Ed255192020SigName, - Sr25519VerKeyName, - Sr25519SigName, - Bls12381BBSDockVerKeyName, - Bls12381BBSSigDockSigName, - Bls12381BBSSigProofDockSigName, - Bls12381BBS23DockVerKeyName, - Bls12381BBS23SigDockSigName, - Bls12381BBS23SigProofDockSigName, - Bls12381PSDockVerKeyName, - Bls12381PSSigDockSigName, - Bls12381PSSigProofDockSigName, - Bls12381BBDT16MacDockName, - Bls12381BBDT16MacProofDockName, -} from './crypto/constants'; - -import EcdsaSecp256k1VerificationKey2019 from './crypto/EcdsaSecp256k1VerificationKey2019'; -import EcdsaSecp256k1Signature2019 from './crypto/EcdsaSecp256k1Signature2019'; -import Ed25519VerificationKey2018 from './crypto/Ed25519VerificationKey2018'; -import Ed25519Signature2018 from './crypto/Ed25519Signature2018'; -import Ed25519Signature2020 from './crypto/Ed25519Signature2020'; -// import Sr25519VerificationKey2020 from './crypto/Sr25519VerificationKey2020'; -// import Sr25519Signature2020 from './crypto/Sr25519Signature2020'; -import Bls12381BBSSignatureDock2022 from './crypto/Bls12381BBSSignatureDock2022'; -import Bls12381BBSSignatureProofDock2022 from './crypto/Bls12381BBSSignatureProofDock2022'; -import Bls12381BBSSignatureDock2023 from './crypto/Bls12381BBSSignatureDock2023'; -import Bls12381BBSSignatureProofDock2023 from './crypto/Bls12381BBSSignatureProofDock2023'; -import Bls12381PSSignatureDock2023 from './crypto/Bls12381PSSignatureDock2023'; -import Bls12381PSSignatureProofDock2023 from './crypto/Bls12381PSSignatureProofDock2023'; -import JsonWebSignature2020 from './crypto/JsonWebSignature2020'; - -export { - EcdsaSecp256k1VerKeyName, - EcdsaSecp256k1SigName, - Ed25519VerKeyName, - Ed25519SigName, - Ed255192020VerKeyName, - Ed255192020SigName, - Sr25519VerKeyName, - Sr25519SigName, - EcdsaSecp256k1VerificationKey2019, - EcdsaSecp256k1Signature2019, - Ed25519VerificationKey2018, - Ed25519Signature2018, - Ed25519Signature2020, - // Sr25519VerificationKey2020, - // Sr25519Signature2020, - Bls12381BBSSignatureDock2022, - Bls12381BBSSignatureProofDock2022, - Bls12381BBSSignatureDock2023, - Bls12381BBSSignatureProofDock2023, - Bls12381PSSignatureDock2023, - Bls12381PSSignatureProofDock2023, - Bls12381BBSDockVerKeyName, - Bls12381BBSSigDockSigName, - Bls12381BBSSigProofDockSigName, - Bls12381BBS23DockVerKeyName, - Bls12381BBS23SigDockSigName, - Bls12381BBS23SigProofDockSigName, - Bls12381PSDockVerKeyName, - Bls12381PSSigDockSigName, - Bls12381PSSigProofDockSigName, - Bls12381BBDT16MacDockName, - Bls12381BBDT16MacProofDockName, - JsonWebSignature2020, -}; diff --git a/packages/credential-sdk/src/vc/index.js b/packages/credential-sdk/src/vc/index.js index 2f14a8d49..8ae23644a 100644 --- a/packages/credential-sdk/src/vc/index.js +++ b/packages/credential-sdk/src/vc/index.js @@ -1,7 +1,5 @@ -import { signPresentation, verifyPresentation } from "./presentations"; -import { issueCredential, verifyCredential } from "./credentials"; - -import { DEFAULT_TYPE, DEFAULT_CONTEXT } from "./constants"; +import { verifyPresentation } from './presentations'; +import { verifyCredential } from './credentials'; /** * Check that credential is verified, i.e. the credential has VCDM compliant structure and the `proof` @@ -28,19 +26,19 @@ export async function isVerifiedPresentation(presentation, params) { return result.verified; } -export { default as Presentation } from "./presentation"; -export { default as VerifiableCredential } from "./verifiable-credential"; -export { default as VerifiablePresentation } from "./verifiable-presentation"; -export { default as StatusList2021Credential } from "./status-list2021-credential"; -export { default as PrivateStatusList2021Credential } from "./private-status-list2021-credential"; -export * from "./credentials"; -export * from "./helpers"; -export * from "./schema"; -export * from "./constants"; -export * from "./custom_crypto"; -export * from "./document-loader"; -export * from "./jws"; -export * from "./presentation"; -export * from "./presentations"; -export * from "./revocation"; -export * from "./schema"; +export { default as Presentation } from './presentation'; +export { default as VerifiableCredential } from './verifiable-credential'; +export { default as VerifiablePresentation } from './verifiable-presentation'; +export { default as StatusList2021Credential } from './status-list2021-credential'; +export { default as PrivateStatusList2021Credential } from './private-status-list2021-credential'; +export * from './credentials'; +export * from './helpers'; +export * from './schema'; +export * from './constants'; +export * from './custom_crypto'; +export { default as CredentialIssuancePurpose } from './CredentialIssuancePurpose'; +export { default as documentLoader } from './document-loader'; +export * from './jws'; +export * from './presentations'; +export * from './revocation'; +export * from './crypto'; diff --git a/packages/credential-sdk/src/vc/revocation.js b/packages/credential-sdk/src/vc/revocation.js index eca03cf0b..69d318834 100644 --- a/packages/credential-sdk/src/vc/revocation.js +++ b/packages/credential-sdk/src/vc/revocation.js @@ -6,7 +6,6 @@ import { KB_UNI_ACCUMULATOR_24, } from '@docknetwork/crypto-wasm-ts'; import { randomAsHex, u8aToHex } from '../utils/bytes'; -import { OneOfPolicy } from '../types/policy'; import { RevRegType, @@ -142,5 +141,3 @@ export async function checkRevocationRegistryStatus( return { verified: true }; } - -export { OneOfPolicy, RevRegType, DockRevRegQualifier };