Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6bfaa88
WIP: working towards full codecov
jeswr Jul 12, 2023
519ed71
chore: get full test coverage
jeswr Jul 13, 2023
0bca5fd
fix: improve blank node handling
jeswr Jul 13, 2023
cc7e958
chore: run lint:fix
jeswr Jul 13, 2023
2fe1dcc
chore: remove global linting exception
jeswr Aug 4, 2023
cdddf97
chore: fix lint errors
jeswr Aug 4, 2023
e3b3507
chore: rename parse to contentTypeParse
jeswr Aug 4, 2023
b7478e1
chore: globalThis.Response -> Respnse
jeswr Aug 4, 2023
f79793a
chore: run lint:fix
jeswr Aug 4, 2023
d1021b5
globalThis.Response -> Response in jsonld.ts
jeswr Aug 4, 2023
8f7a525
chore: use constants for IRIs rather than string templates
jeswr Aug 4, 2023
c3f44f1
chore: rename IJsonLdParser -> CachedJsonLdParser
jeswr Aug 4, 2023
162545c
chore: run lint:fix
jeswr Aug 4, 2023
826ac49
chore: make remaining IRI templates constants
jeswr Aug 4, 2023
e2326bd
Merge branch 'main' into wip/jsonld-parsing-2
jeswr Aug 4, 2023
f8906e7
chore: fix lint errors
jeswr Aug 4, 2023
46f1a55
Merge branch 'main' into wip/jsonld-parsing-2
jeswr Aug 21, 2023
6dfafd8
chore: fix lockfile
jeswr Aug 21, 2023
7a7fff7
chore: run lint:fix
jeswr Aug 21, 2023
5967c0b
chore: remove suggestion to check for ld media type
jeswr Aug 21, 2023
4472882
chore: fix lint error
jeswr Aug 21, 2023
c29e931
Merge branch 'main' into wip/jsonld-parsing-2
jeswr Aug 31, 2023
860faf3
chore: export getVerifiableCredentialFromResponse
jeswr Aug 31, 2023
f59d9cd
Merge branch 'main' into wip/jsonld-parsing-2
jeswr Sep 18, 2023
23aca8f
chore: fix export test
jeswr Sep 18, 2023
11f1674
fix: add parser dependencies
jeswr Sep 19, 2023
7d29d96
WIP: properly shorten URIs and only put them in id when necessary
jeswr Sep 25, 2023
4ceca8f
chore: remove custom hasContext code
jeswr Sep 25, 2023
baaef5f
feat: support custom contexts in the parser
jeswr Sep 26, 2023
09d83ea
Merge branch 'main' into wip/jsonld-parsing-2
jeswr Oct 18, 2023
df52507
chore: re-enable skipped test
jeswr Oct 18, 2023
eac7d5d
chore: fix code coverage errors
jeswr Oct 18, 2023
ed6d219
chore: fix lint errors
jeswr Oct 18, 2023
670d529
chore: remove commented out context
jeswr Oct 22, 2023
b62e8d0
chore: move getSingleObject to global scope
jeswr Oct 22, 2023
d7b42b2
chore: move getSingleObjectOfTermType to global scope
jeswr Oct 22, 2023
2023b8a
chore: refactor writers into global scope
jeswr Oct 22, 2023
c2ea626
chore: code cleanup
jeswr Oct 22, 2023
a96de18
chore: improve naming
jeswr Oct 22, 2023
b108867
chore: WIP re-serialize issuer calls
jeswr Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 98 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,18 @@
"@rdfjs/dataset": "2.0.1",
"@rdfjs/types": "^1.1.0",
"@rushstack/eslint-patch": "^1.1.4",
"@types/content-type": "^1.1.5",
"@types/dotenv-flow": "^3.1.1",
"@types/jest": "^29.2.2",
"@types/n3": "^1.16.0",
"@types/node": "^20.1.2",
"@types/rdfjs__dataset": "2.0.5",
"dotenv-flow": "^3.2.0",
"eslint": "^8.18.0",
"jest": "^29.3.0",
"jest-environment-jsdom": "^29.3.0",
"prettier": "^3.0.2",
"rdf-isomorphic": "^1.3.1",
"rollup": "^3.1.0",
"rollup-plugin-typescript2": "^0.35.0",
"ts-jest": "^29.0.3",
Expand All @@ -84,7 +87,13 @@
},
"dependencies": {
"@inrupt/solid-client": "^1.25.2",
"@inrupt/universal-fetch": "^1.0.1"
"@inrupt/universal-fetch": "^1.0.1",
"content-type": "^1.0.5",
"event-emitter-promisify": "^1.1.0",
"jsonld-context-parser": "^2.3.3",
"jsonld-streaming-parser": "^3.2.1",
"jsonld-streaming-serializer": "^2.1.0",
"n3": "^1.17.0"
},
"publishConfig": {
"access": "public"
Expand Down
50 changes: 42 additions & 8 deletions src/common/common.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ export type CredentialClaims = VerifiableClaims & {
};

export const defaultVerifiableClaims: VerifiableClaims = {
"@context": { ex: "https://example.org/ns/" },
id: "ex:someCredentialInstance",
type: [...defaultCredentialTypes, "ex:spaceDogCertificate"],
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://schema.inrupt.com/credentials/v1.jsonld",
],
id: "https://example.org/ns/someCredentialInstance",
type: [
...defaultCredentialTypes,
"https://example.org/ns/spaceDogCertificate",
],
proofType: "Ed25519Signature2018",
proofCreated: "2021-08-19T16:08:31Z",
proofVerificationMethod:
Expand All @@ -63,16 +69,19 @@ export const defaultCredentialClaims: CredentialClaims = {
issuanceDate: "1960-08-19T16:08:31Z",
subjectId: "https://some.webid.provider/strelka",
subjectClaims: {
"ex:status": "https://example.org/ns/GoodDog",
"ex:passengerOf": "https://example.org/ns/Korabl-Sputnik2",
"https://example.org/ns/status": "https://example.org/ns/GoodDog",
"https://example.org/ns/passengerOf":
"https://example.org/ns/Korabl-Sputnik2",
},
};

export const mockPartialCredential = (
claims?: Partial<CredentialClaims>,
id?: string,
): Record<string, unknown> => {
return {
id: claims?.id,
"@context": claims?.["@context"],
id: id ?? claims?.id,
type: claims?.type,
issuer: claims?.issuer,
issuanceDate: claims?.issuanceDate,
Expand All @@ -90,14 +99,39 @@ export const mockPartialCredential = (
};
};

export const mockPartialCredential2Proofs = (
claims?: Partial<CredentialClaims>,
id?: string,
): Record<string, unknown> => {
return {
...mockPartialCredential(claims, id),
proof: [
mockPartialCredential(claims, id).proof,
mockPartialCredential(claims, id).proof,
],
};
};

export const mockCredential = (
claims: CredentialClaims,
): VerifiableCredential => {
return mockPartialCredential(claims) as VerifiableCredential;
};

export const mockDefaultCredential = (): VerifiableCredential => {
return mockPartialCredential(defaultCredentialClaims) as VerifiableCredential;
export const mockDefaultCredential = (id?: string): VerifiableCredential => {
return mockPartialCredential(
defaultCredentialClaims,
id,
) as VerifiableCredential;
};

export const mockDefaultCredential2Proofs = (
id?: string,
): VerifiableCredential => {
return mockPartialCredential2Proofs(
defaultCredentialClaims,
id,
) as VerifiableCredential;
};

export const mockPartialPresentation = (
Expand Down
Loading