Skip to content

Commit

Permalink
Merge pull request #658 from uport-project/next
Browse files Browse the repository at this point in the history
chore: new release
  • Loading branch information
mirceanis authored Aug 11, 2021
2 parents d6b2db1 + 232de66 commit d7cd14b
Show file tree
Hide file tree
Showing 35 changed files with 362 additions and 366 deletions.
1 change: 1 addition & 0 deletions __tests__/localAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ let dbConnection: Promise<Connection>

const setup = async (options?: IAgentOptions): Promise<boolean> => {
dbConnection = createConnection({
name: 'test',
type: 'sqlite',
database: databaseFile,
synchronize: true,
Expand Down
1 change: 1 addition & 0 deletions __tests__/localMemoryStoreAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ let dbConnection: Promise<Connection>

const setup = async (options?: IAgentOptions): Promise<boolean> => {
dbConnection = createConnection({
name: 'test',
type: 'sqlite',
database: databaseFile,
synchronize: true,
Expand Down
1 change: 1 addition & 0 deletions __tests__/restAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const getAgent = (options?: IAgentOptions) =>

const setup = async (options?: IAgentOptions): Promise<boolean> => {
dbConnection = createConnection({
name: 'test',
type: 'sqlite',
database: databaseFile,
synchronize: true,
Expand Down
2 changes: 1 addition & 1 deletion __tests__/shared/didDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default (testContext: {

// THIS HAS TO BE THE LAST TEST IN THIS FILE!
it('should return errors', async () => {
const connection = getConnection()
const connection = getConnection('test')
await connection.query('PRAGMA foreign_keys = OFF;')
await connection.query('DROP TABLE claim;')

Expand Down
13 changes: 13 additions & 0 deletions __tests__/shared/saveClaims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,18 @@ export default (testContext: {
})
expect(credentials).toHaveLength(2)
})

it('should be able to delete credential', async () => {
const credentials = await agent.dataStoreORMGetVerifiableCredentials()
expect(credentials).toHaveLength(3)

const result = await agent.dataStoreDeleteVerifiableCredential({hash: credentials[0].hash})
expect(result).toEqual(true)

const credentials2 = await agent.dataStoreORMGetVerifiableCredentials()
expect(credentials2).toHaveLength(2)

})

})
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build-clean": "rimraf ./packages/*/build ./packages/*/api ./packages/*/node_modules ./packages/*/tsconfig.tsbuildinfo && jest --clearCache",
"publish:latest": "lerna publish --conventional-commits --include-merged-tags --create-release github --yes --dist-tag latest --registry https://registry.npmjs.org/:_authToken=${NPM_TOKEN}",
"publish:next": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes --registry https://registry.npmjs.org/:_authToken=${NPM_TOKEN}",
"publish:unstable": "lerna publish --repo-version 0.0.42 --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org/:_authToken=${NPM_TOKEN}"
"publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org/:_authToken=${NPM_TOKEN}"
},
"workspaces": [
"packages/*"
Expand All @@ -30,28 +30,28 @@
}
},
"devDependencies": {
"@commitlint/cli": "12.1.4",
"@commitlint/config-conventional": "12.1.4",
"@microsoft/api-documenter": "7.13.31",
"@microsoft/api-extractor": "7.18.2",
"@commitlint/cli": "13.1.0",
"@commitlint/config-conventional": "13.1.0",
"@microsoft/api-documenter": "7.13.34",
"@microsoft/api-extractor": "7.18.4",
"@microsoft/api-extractor-model": "7.13.4",
"@types/jest": "26.0.24",
"codecov": "3.8.2",
"codecov": "3.8.3",
"cross-fetch": "3.1.4",
"husky": "7.0.1",
"jest": "27.0.6",
"jest-fetch-mock": "3.0.3",
"json-schema": "0.3.0",
"lerna": "4.0.0",
"lerna-changelog": "1.0.1",
"lerna-changelog": "2.1.0",
"oas-resolver": "2.5.6",
"openapi-types": "9.1.0",
"prettier": "2.3.2",
"pretty-quick": "3.1.1",
"rimraf": "3.0.2",
"semantic-release": "17.4.4",
"ts-jest": "27.0.3",
"ts-json-schema-generator": "0.94.1",
"ts-jest": "27.0.4",
"ts-json-schema-generator": "0.95.0",
"ts-node": "10.1.0",
"typescript": "4.3.5"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"update-veramo-latest": "yarn add @veramo/core@latest @veramo/discovery@latest @veramo/remote-client@latest @veramo/remote-server@latest @veramo/did-provider-key@latest @veramo/did-resolver@latest @veramo/did-jwt@latest @veramo/credential-w3c@latest @veramo/did-provider-ethr@latest @veramo/did-provider-web@latest @veramo/did-comm@latest @veramo/kms-local@latest @veramo/selective-disclosure@latest @veramo/data-store@latest @veramo/key-manager@latest @veramo/message-handler@latest @veramo/did-manager@latest @veramo/url-handler@latest"
},
"dependencies": {
"@microsoft/api-extractor": "7.18.2",
"@microsoft/api-extractor": "7.18.4",
"@microsoft/api-extractor-model": "7.13.4",
"@types/blessed": "^0.1.17",
"@types/swagger-ui-express": "^4.1.2",
Expand Down Expand Up @@ -62,19 +62,19 @@
"qrcode-terminal": "^0.12.0",
"sqlite3": "^5.0.0",
"swagger-ui-express": "^4.1.5",
"ts-json-schema-generator": "^0.94.0",
"ts-json-schema-generator": "^0.95.0",
"typeorm": "0.2.34",
"url-parse": "^1.5.1",
"web-did-resolver": "2.0.4",
"ws": "^7.4.1",
"ws": "^8.0.0",
"yaml": "^1.10.0"
},
"devDependencies": {
"@types/debug": "4.1.6",
"@types/debug": "4.1.7",
"@types/inquirer": "7.3.3",
"@types/node-fetch": "2.5.11",
"@types/node-fetch": "2.5.12",
"@types/passport-http-bearer": "1.0.37",
"@types/ws": "7.4.6",
"@types/ws": "7.4.7",
"typescript": "4.3.5"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
},
"dependencies": {
"debug": "^4.1.1",
"did-jwt-vc": "2.1.3",
"did-jwt-vc": "2.1.6",
"events": "^3.2.0",
"z-schema": "^5.0.0"
},
"devDependencies": {
"@types/debug": "4.1.6",
"@types/debug": "4.1.7",
"did-resolver": "3.1.0",
"typescript": "4.3.5"
},
Expand Down
24 changes: 22 additions & 2 deletions packages/core/plugin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,19 @@
"IDataStore": {
"components": {
"schemas": {
"IDataStoreDeleteVerifiableCredentialArgs": {
"type": "object",
"properties": {
"hash": {
"type": "string",
"description": "Required. VerifiableCredential hash"
}
},
"required": [
"hash"
],
"description": "Input arguments for {@link IDataStore.IDataStoreDeleteVerifiableCredentialArgs| IDataStoreDeleteVerifiableCredentialArgs }"
},
"IDataStoreGetMessageArgs": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1560,7 +1573,6 @@
"@context",
"type",
"verifier",
"verifiableCredential",
"proof"
],
"description": "Verifiable Presentation {@link https://github.com/decentralized-identifier/did-jwt-vc }"
Expand Down Expand Up @@ -1632,6 +1644,15 @@
}
},
"methods": {
"dataStoreDeleteVerifiableCredential": {
"description": "Deletes verifiable credential from the data store",
"arguments": {
"$ref": "#/components/schemas/IDataStoreDeleteVerifiableCredentialArgs"
},
"returnType": {
"type": "boolean"
}
},
"dataStoreGetMessage": {
"description": "Gets message from the data store",
"arguments": {
Expand Down Expand Up @@ -1955,7 +1976,6 @@
"@context",
"type",
"verifier",
"verifiableCredential",
"proof"
],
"description": "Verifiable Presentation {@link https://github.com/decentralized-identifier/did-jwt-vc }"
Expand Down
19 changes: 19 additions & 0 deletions packages/core/src/types/IDataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ export interface IDataStoreGetVerifiableCredentialArgs {
hash: string
}

/**
* Input arguments for {@link IDataStore.IDataStoreDeleteVerifiableCredentialArgs | IDataStoreDeleteVerifiableCredentialArgs}
* @public
*/
export interface IDataStoreDeleteVerifiableCredentialArgs {
/**
* Required. VerifiableCredential hash
*/
hash: string
}

/**
* Input arguments for {@link IDataStore.dataStoreSaveVerifiablePresentation | dataStoreSaveVerifiablePresentation}
* @public
Expand Down Expand Up @@ -93,6 +104,14 @@ export interface IDataStore extends IPluginMethodMap {
*/
dataStoreSaveVerifiableCredential(args: IDataStoreSaveVerifiableCredentialArgs): Promise<string>


/**
* Deletes verifiable credential from the data store
* @param args - verifiable credential
* @returns a promise that resolves to a boolean
*/
dataStoreDeleteVerifiableCredential(args: IDataStoreDeleteVerifiableCredentialArgs): Promise<boolean>

/**
* Gets verifiable credential from the data store
* @param args - arguments for getting verifiable credential
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/types/IMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface VerifiablePresentation {
'@context': string[]
type: string[]
verifier: string[]
verifiableCredential: VerifiableCredential[]
verifiableCredential?: VerifiableCredential[]
proof: {
type?: string
[x: string]: any
Expand Down Expand Up @@ -78,7 +78,7 @@ export interface W3CPresentation {
'@context': string[]
type: string[]
verifier: string[]
verifiableCredential: VerifiableCredential[]
verifiableCredential?: VerifiableCredential[]
[x: string]: any
}

Expand Down
4 changes: 2 additions & 2 deletions packages/credential-w3c/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"@veramo/message-handler": "^2.0.0",
"blakejs": "^1.1.0",
"debug": "^4.1.1",
"did-jwt-vc": "2.1.3",
"did-jwt-vc": "2.1.6",
"did-resolver": "3.1.0"
},
"devDependencies": {
"@types/debug": "4.1.6",
"@types/debug": "4.1.7",
"typescript": "4.3.5"
},
"files": [
Expand Down
1 change: 0 additions & 1 deletion packages/credential-w3c/plugin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
"@context",
"type",
"verifier",
"verifiableCredential",
"proof"
],
"description": "Verifiable Presentation {@link https://github.com/decentralized-identifier/did-jwt-vc }"
Expand Down
Loading

0 comments on commit d7cd14b

Please sign in to comment.