Skip to content

Commit

Permalink
fix: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
yanlow committed Sep 10, 2024
1 parent f25e3d5 commit 03d3e81
Show file tree
Hide file tree
Showing 10 changed files with 4,019 additions and 6,503 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
lts/iron
10,422 changes: 3,972 additions & 6,450 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"dependencies": {
"@govtechsg/dnsprove": "^2.8.0",
"@govtechsg/open-attestation": "^6.9.0",
"axios": "^1.6.2",
"debug": "^4.3.1",
"axios": "^1.7.7",
"debug": "^4.3.7",
"did-resolver": "^4.1.0",
"ethers": "^5.7.2",
"ethr-did-resolver": "^8.1.2",
Expand All @@ -41,31 +41,31 @@
"web-did-resolver": "^2.0.27"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@commitlint/prompt": "^18.4.3",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@commitlint/prompt": "^19.4.1",
"@govtechsg/document-store-ethers-v5": "^4.1.0",
"@snyk/protect": "^1.1257.0",
"@snyk/protect": "^1.1293.0",
"@types/debug": "^4.1.5",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"@types/jest": "^27.4.1",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.5.0",
"ajv-formats": "^2.1.1",
"commitizen": "^4.3.0",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-prettier": "^3.4.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-prettier": "^5.2.1",
"git-cz": "^4.9.0",
"husky": "^8.0.3",
"jest": "^26.6.3",
"jest-watch-typeahead": "^0.6.3",
"husky": "^9.1.5",
"jest": "^27.5.1",
"jest-watch-typeahead": "^2.2.2",
"microbundle": "^0.15.1",
"msw": "^0.28.2",
"prettier": "^2.2.1",
"semantic-release": "^22.0.8",
"ts-jest": "^26.5.5",
"prettier": "^3.3.3",
"semantic-release": "^24.1.0",
"ts-jest": "^27.1.5",
"typescript": "^4.9.5"
},
"publishConfig": {
Expand All @@ -84,7 +84,8 @@
}
},
"prettier": {
"printWidth": 120
"printWidth": 120,
"trailingComma": "es5"
},
"snyk": true
}
35 changes: 14 additions & 21 deletions scripts/generate.v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ const generateDnsDid = async () => {
},
},
};
const wrappedInvalidDnsDidDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
validSignatureWithoutDnsTxt
);
const wrappedInvalidDnsDidDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(validSignatureWithoutDnsTxt);
const signatureForInvalidDocument = await signMerkleRoot(`0x${wrappedInvalidDnsDidDocument.proof.merkleRoot}`);
const signedInvalidDnsDidDocument: v3.SignedWrappedDocument = {
...wrappedInvalidDnsDidDocument,
Expand Down Expand Up @@ -176,9 +175,8 @@ const generateDid = async () => {
},
},
};
const wrappedInvalidDnsDidDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
validSignatureWithoutDnsTxt
);
const wrappedInvalidDnsDidDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(validSignatureWithoutDnsTxt);
const signatureForInvalidDocument = await signMerkleRoot(`0x${wrappedInvalidDnsDidDocument.proof.merkleRoot}`);
const signedInvalidDnsDidDocument: v3.SignedWrappedDocument = {
...wrappedInvalidDnsDidDocument,
Expand All @@ -194,23 +192,20 @@ const generateDid = async () => {
const generateDocumentStore = async () => {
info("Generating Document Store files");
writeFileSync("./test/fixtures/v3/documentStore.json", JSON.stringify(baseDocumentStoreDocument, null, 2));
const wrappedBaseDocumentStoreDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
baseDocumentStoreDocument
);
const wrappedBaseDocumentStoreDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(baseDocumentStoreDocument);
writeFileSync(
"./test/fixtures/v3/documentStore-wrapped.json",
JSON.stringify(wrappedBaseDocumentStoreDocument, null, 2)
);
const issuedBaseDocumentStoreDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
baseDocumentStoreDocument
);
const issuedBaseDocumentStoreDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(baseDocumentStoreDocument);
writeFileSync(
"./test/fixtures/v3/documentStore-issued.json",
JSON.stringify(issuedBaseDocumentStoreDocument, null, 2)
);
const revokedBaseDocumentStoreDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
baseDocumentStoreDocument
);
const revokedBaseDocumentStoreDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(baseDocumentStoreDocument);
writeFileSync(
"./test/fixtures/v3/documentStore-revoked.json",
JSON.stringify(revokedBaseDocumentStoreDocument, null, 2)
Expand Down Expand Up @@ -246,16 +241,14 @@ const generateDocumentStore = async () => {
const generateTokenRegistry = async () => {
info("Generating Token Registry files");
writeFileSync("./test/fixtures/v3/tokenRegistry.json", JSON.stringify(baseTokenRegistryDocument, null, 2));
const wrappedBaseTokenRegistryDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
baseTokenRegistryDocument
);
const wrappedBaseTokenRegistryDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(baseTokenRegistryDocument);
writeFileSync(
"./test/fixtures/v3/tokenRegistry-wrapped.json",
JSON.stringify(wrappedBaseTokenRegistryDocument, null, 2)
);
const issuedBaseTokenRegistryDocument = await __unsafe__use__it__at__your__own__risks__wrapDocument(
baseTokenRegistryDocument
);
const issuedBaseTokenRegistryDocument =
await __unsafe__use__it__at__your__own__risks__wrapDocument(baseTokenRegistryDocument);
writeFileSync(
"./test/fixtures/v3/tokenRegistry-issued.json",
JSON.stringify(issuedBaseTokenRegistryDocument, null, 2)
Expand Down
4 changes: 2 additions & 2 deletions src/common/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,14 @@ describe("generateProvider", () => {
const options = { apiKey: "abc123" } as ProviderDetails;
expect(() => {
generateProvider(options);
}).toThrowError(
}).toThrow(
"We could not link the apiKey provided to a provider, please state the provider to use in the parameter."
);
});

it("should throw an error when if process.env is using the wrong value for PROVIDER", () => {
process.env.PROVIDER_ENDPOINT_TYPE = "ABC";
expect(() => generateProvider()).toThrowError(
expect(() => generateProvider()).toThrow(
"The provider provided is not on the list of providers. Please use one of the following: infura, alchemy or jsonrpc."
);
});
Expand Down
4 changes: 2 additions & 2 deletions src/getIdentifier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const malformedVerificationFragment2: ValidVerificationFragment<undefined> = {

describe("getIdentifier", () => {
it("should throw an error when no fragments are provided", () => {
expect(() => getIdentifier([])).toThrowError("Please provide at least one verification fragment");
expect(() => getIdentifier([])).toThrow("Please provide at least one verification fragment");
});
it("should return an unknown identity proof, when fragment.name is out of specification", () => {
expect(getIdentifier([verificationFragment1, malformedVerificationFragment1])).toStrictEqual({
Expand All @@ -97,7 +97,7 @@ describe("getIdentifier", () => {
});
});
it("should throw an error when fragment.data cannot be handled", () => {
expect(() => getIdentifier([verificationFragment1, malformedVerificationFragment2])).toThrowError(
expect(() => getIdentifier([verificationFragment1, malformedVerificationFragment2])).toThrow(
"No data property found in fragment, malformed fragment"
);
});
Expand Down
4 changes: 2 additions & 2 deletions src/validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { VerificationFragment } from "./types/core";

describe("isValid", () => {
it("should throw an error when no fragments are provided", () => {
expect(() => isValid([])).toThrowError("Please provide at least one verification fragment to check");
expect(() => isValid([])).toThrow("Please provide at least one verification fragment to check");
});
it("should throw an error when empty types are provided", () => {
const verificationFragment: VerificationFragment = {
status: "VALID",
name: "any",
type: "DOCUMENT_STATUS",
};
expect(() => isValid([verificationFragment], [])).toThrowError("Please provide at least one type to check");
expect(() => isValid([verificationFragment], [])).toThrow("Please provide at least one type to check");
});

describe("with one provided type", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ const verifyV3 = async (
const reason = InvalidDidSignedIssuanceStatus.guard(verificationResult)
? verificationResult.reason
: InvalidRevocationStatus.guard(revocationStatus)
? revocationStatus.reason
: undefined;
? revocationStatus.reason
: undefined;
if (!reason) {
throw new CodedError(
"Unable to retrieve the reason of the failure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const isMissingTokenRegistry = (error: any) => {
);
};
const decodeError = (error: any) => {
const reason = error.reason && Array.isArray(error.reason) ? error.reason[0] : error.reason ?? "";
const reason = error.reason && Array.isArray(error.reason) ? error.reason[0] : (error.reason ?? "");
switch (true) {
case isNonExistentToken(error):
return `Document has not been issued under token registry`;
Expand Down
2 changes: 1 addition & 1 deletion src/verifiers/documentStatus/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getIntermediateHashes = (targetHash: Hash, proofs: Hash[] = []) =>
* In case where we cannot tell, we throw an error
* */
export const decodeError = (error: any) => {
const reason = error.reason && Array.isArray(error.reason) ? error.reason[0] : error.reason ?? "";
const reason = error.reason && Array.isArray(error.reason) ? error.reason[0] : (error.reason ?? "");
switch (true) {
case !error.reason &&
(error.method?.toLowerCase() === "isRevoked(bytes32)".toLowerCase() ||
Expand Down

0 comments on commit 03d3e81

Please sign in to comment.