Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/ws-8.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoGlastra authored Jun 21, 2024
2 parents 3dc2e8c + eef0660 commit 57c7df5
Show file tree
Hide file tree
Showing 36 changed files with 130 additions and 86 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-bulldogs-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@credo-ts/core': patch
---

pex query fix
35 changes: 35 additions & 0 deletions .changeset/wet-tools-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
'@credo-ts/action-menu': patch
'@credo-ts/anoncreds': patch
'@credo-ts/askar': patch
'@credo-ts/bbs-signatures': patch
'@credo-ts/cheqd': patch
'@credo-ts/core': patch
'@credo-ts/drpc': patch
'@credo-ts/indy-sdk-to-askar-migration': patch
'@credo-ts/indy-vdr': patch
'@credo-ts/node': patch
'@credo-ts/openid4vc': patch
'@credo-ts/question-answer': patch
'@credo-ts/react-native': patch
'@credo-ts/tenants': patch
---

- feat: allow serving dids from did record (#1856)
- fix: set created at for anoncreds records (#1862)
- feat: add goal to public api for credential and proof (#1867)
- fix(oob): only reuse connection if enabled (#1868)
- fix: issuer id query anoncreds w3c (#1870)
- feat: sd-jwt issuance without holder binding (#1871)
- chore: update oid4vci deps (#1873)
- fix: query for qualified/unqualified forms in revocation notification (#1866)
- fix: wrong schema id is stored for credentials (#1884)
- fix: process credential or proof problem report message related to connectionless or out of band exchange (#1859)
- fix: unqualified indy revRegDefId in migration (#1887)
- feat: verify SD-JWT Token status list and SD-JWT VC fixes (#1872)
- fix(anoncreds): combine creds into one proof (#1893)
- fix: AnonCreds proof requests with unqualified dids (#1891)
- fix: WebSocket priority in Message Pick Up V2 (#1888)
- fix: anoncreds predicate only proof with unqualified dids (#1907)
- feat: add pagination params to storage service (#1883)
- feat: add message handler middleware and fallback (#1894)
45 changes: 40 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -34,23 +35,57 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish to npm
if: github.ref == 'refs/heads/main'
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm build && pnpm changeset publish
commit: 'chore(release): '
title: 'chore(release): '
publish: pnpm release
commit: 'chore(release): new version'
title: 'chore(release): new version'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}

release-unstable:
name: Release Unstable
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
with:
version: 9.1.0

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Creating .npmrc
run: |
cat << EOF > ".npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}

- name: Create unstable release
if: github.ref != 'refs/heads/main' || steps.changesets.outputs.published == 'false'
run: |
pnpm changeset version --snapshot alpha
pnpm build
pnpm changeset publish --tag alpha
CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag v$CURRENT_PACKAGE_VERSION
git push origin v$CURRENT_PACKAGE_VERSION --no-verify
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
build
.idea
coverage
pnpm-lock.yaml
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"check-types": "pnpm check-types:build && pnpm check-types:tests",
"check-types:tests": "tsc -p tsconfig.test.json --noEmit",
"check-types:build": "pnpm -r --parallel exec tsc --noEmit",
"prettier": "prettier --ignore-path .gitignore '**/*.+(js|json|ts|md|yml|yaml)'",
"prettier": "prettier --ignore-path .prettierignore '**/*.+(js|json|ts|md|yml|yaml)'",
"format": "pnpm prettier --write",
"check-format": "pnpm prettier --list-different",
"clean": "pnpm -r --parallel run clean",
Expand All @@ -26,7 +26,8 @@
"test": "jest",
"lint": "eslint --ignore-path .gitignore .",
"validate": "pnpm lint && pnpm check-types && pnpm check-format",
"run-mediator": "ts-node ./samples/mediator.ts"
"run-mediator": "ts-node ./samples/mediator.ts",
"release": "pnpm build && pnpm changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.27.5",
Expand Down
5 changes: 1 addition & 4 deletions packages/action-menu/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/action-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/action-menu",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/anoncreds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/anoncreds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/anoncreds",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/askar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/askar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/askar",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/bbs-signatures/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/bbs-signatures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/bbs-signatures",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/cheqd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/cheqd",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/core",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,21 +584,23 @@ export class DifPresentationExchangeService {

// FIXME: in the query we should take into account the supported proof types of the verifier
// this could help enormously in the amount of credentials we have to retrieve from storage.
// NOTE: for now we don't support SD-JWT for v1, as I don't know what the schema.uri should be?
if (presentationDefinitionVersion.version === PEVersion.v1) {
const pd = presentationDefinition as DifPresentationExchangeDefinitionV1

// The schema.uri can contain either an expanded type, or a context uri
for (const inputDescriptor of pd.input_descriptors) {
for (const schema of inputDescriptor.schema) {
sdJwtVcQuery.push({
vct: schema.uri,
})
w3cQuery.push({
$or: [{ expandedType: [schema.uri] }, { contexts: [schema.uri] }, { type: [schema.uri] }],
$or: [{ expandedTypes: [schema.uri] }, { contexts: [schema.uri] }, { types: [schema.uri] }],
})
}
}
} else if (presentationDefinitionVersion.version === PEVersion.v2) {
// FIXME: As PE version 2 does not have the `schema` anymore, we can't query by schema anymore.
// For now we retrieve ALL credentials, as we did the same for V1 with JWT credentials. We probably need
// We probably need
// to find some way to do initial filtering, hopefully if there's a filter on the `type` field or something.
} else {
throw new DifPresentationExchangeError(
Expand Down
10 changes: 8 additions & 2 deletions packages/core/src/storage/StorageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ import type { AgentContext } from '../agent'
import type { Constructor } from '../utils/mixins'

// https://stackoverflow.com/questions/51954558/how-can-i-remove-a-wider-type-from-a-union-type-without-removing-its-subtypes-in/51955852#51955852
export type SimpleQuery<T extends BaseRecord<any, any, any>> = Partial<ReturnType<T['getTags']>> & TagsBase
export type SimpleQuery<T extends BaseRecord<any, any, any>> = T extends BaseRecord<infer DefaultTags, infer CustomTags>
? DefaultTags extends TagsBase
? Partial<ReturnType<T['getTags']>> & TagsBase
: CustomTags extends TagsBase
? Partial<ReturnType<T['getTags']>> & TagsBase
: Partial<DefaultTags & CustomTags> & TagsBase
: Partial<ReturnType<T['getTags']>> & TagsBase

interface AdvancedQuery<T extends BaseRecord> {
interface AdvancedQuery<T extends BaseRecord<any, any, any>> {
$and?: Query<T>[]
$or?: Query<T>[]
$not?: Query<T>
Expand Down
5 changes: 1 addition & 4 deletions packages/drpc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/drpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/drpc",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/indy-sdk-to-askar-migration/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/indy-sdk-to-askar-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/indy-sdk-to-askar-migration",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/indy-vdr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/indy-vdr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/indy-vdr",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/node",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/openid4vc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
2 changes: 1 addition & 1 deletion packages/openid4vc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@credo-ts/openid4vc",
"main": "build/index",
"types": "build/index",
"version": "0.5.3",
"version": "0.5.4",
"files": [
"build"
],
Expand Down
5 changes: 1 addition & 4 deletions packages/question-answer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# Changelog

## [0.5.3](https://github.com/openwallet-foundation/credo-ts/compare/v0.5.2...v0.5.3) (2024-05-01)

Expand Down
Loading

0 comments on commit 57c7df5

Please sign in to comment.