Skip to content

Commit

Permalink
Merge branch 'master' into offchain-signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Nov 12, 2024
2 parents ed40865 + aca94bd commit 3059824
Show file tree
Hide file tree
Showing 79 changed files with 1,441 additions and 336 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"no-useless-constructor": "off",
"no-console": "off",
"no-else-return": "off",
"import/extensions": "off",
"no-restricted-syntax": [
"error",
{
Expand Down
31 changes: 31 additions & 0 deletions examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# @docknetwork/sdk-examples

## 0.4.2

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.7.0
- @docknetwork/dock-blockchain-api@0.4.2
- @docknetwork/dock-blockchain-modules@0.5.2

## 0.4.1

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.6.0
- @docknetwork/dock-blockchain-api@0.4.1
- @docknetwork/dock-blockchain-modules@0.5.1

## 0.4.0

### Minor Changes

- Fix exports

### Patch Changes

- Updated dependencies
- @docknetwork/dock-blockchain-modules@0.5.0
- @docknetwork/dock-blockchain-api@0.4.0
- @docknetwork/credential-sdk@0.5.0

## 0.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/bbs-dock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initializeWasm } from '@docknetwork/credential-sdk/crypto';
import { Resolver } from '@docknetwork/credential-sdk/resolver';
import Bls12381G2KeyPairDock2022 from '@docknetwork/credential-sdk/vc/crypto/Bls12381G2KeyPairDock2022';
import { Bls12381G2KeyPairDock2022 } from '@docknetwork/credential-sdk/vc/crypto';
import {
issueCredential,
verifyCredential,
Expand Down
26 changes: 0 additions & 26 deletions examples/loader.mjs

This file was deleted.

28 changes: 14 additions & 14 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"name": "@docknetwork/sdk-examples",
"private": true,
"type": "module",
"version": "0.3.0",
"version": "0.4.2",
"scripts": {
"bbs-dock-example": "babel-node --loader=./loader.mjs ./bbs-dock.js",
"claim-deduction-example": "babel-node --loader=./loader.mjs ./claim-deduction.js",
"open-badges-example": "babel-node --loader=./loader.mjs ./open-badges.js",
"schema-validation-example": "babel-node --loader=./loader.mjs ./schema-validation.js",
"standard-schemas-example": "babel-node --loader=./loader.mjs ./standard-schemas.js",
"dock-did-example": "babel-node --loader=./loader.mjs ./dock-did.js",
"did-resolver-example": "babel-node --loader=./loader.mjs ./resolver.js",
"schema-example": "babel-node --loader=./loader.mjs ./schema.js",
"blob-example": "babel-node --loader=./loader.mjs ./blob.js",
"anchor-example": "babel-node --loader=./loader.mjs ./anchor.js",
"bbs-dock-example": "babel-node ./bbs-dock.js",
"claim-deduction-example": "babel-node ./claim-deduction.js",
"open-badges-example": "babel-node ./open-badges.js",
"schema-validation-example": "babel-node ./schema-validation.js",
"standard-schemas-example": "babel-node ./standard-schemas.js",
"dock-did-example": "babel-node ./dock-did.js",
"did-resolver-example": "babel-node ./resolver.js",
"schema-example": "babel-node ./schema.js",
"blob-example": "babel-node ./blob.js",
"anchor-example": "babel-node ./anchor.js",
"examples": "yarn bbs-dock-example && yarn claim-deduction-example && yarn open-badges-example && yarn schema-validation-example && yarn standard-schemas-example && yarn dock-did-example && yarn did-resolver-example && yarn schema-example && yarn blob-example && yarn anchor-example",
"examples-with-node": "../scripts/with_dock_docker_test_node yarn examples",
"lint": "eslint \"*.js\""
},
"dependencies": {
"@docknetwork/credential-sdk": "0.4.0",
"@docknetwork/dock-blockchain-api": "0.3.0",
"@docknetwork/dock-blockchain-modules": "0.4.0"
"@docknetwork/credential-sdk": "0.7.0",
"@docknetwork/dock-blockchain-api": "0.4.2",
"@docknetwork/dock-blockchain-modules": "0.5.2"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/schema-validation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Schema } from '@docknetwork/credential-sdk/modules/abstract/schema';

// BOL Schema, its valid
import bolSchema from './schemas/bol';
import bolSchema from './schemas/bol.js';

// Invalid example schema
const invalidSchema = {
Expand Down
2 changes: 1 addition & 1 deletion examples/schemas/immunity_event_record.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import proofOfHealthCoreSchema from "./proof_of_health_core";
import proofOfHealthCoreSchema from "./proof_of_health_core.js";

const schema = {
$schema: "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion examples/schemas/infection_diagnosis.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import proofOfHealthCoreSchema from "./proof_of_health_core";
import proofOfHealthCoreSchema from "./proof_of_health_core.js";

const schema = {
$schema: "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion examples/schemas/non_infection_check.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import proofOfHealthCoreSchema from "./proof_of_health_core";
import proofOfHealthCoreSchema from "./proof_of_health_core.js";

const schema = {
$schema: "http://json-schema.org/draft-07/schema#",
Expand Down
8 changes: 4 additions & 4 deletions examples/standard-schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
validateCredentialSchema,
} from '@docknetwork/credential-sdk/vc';

import prCardSchema from './schemas/pr_card';
import infectionDiagnosisSchema from './schemas/infection_diagnosis';
import immunityEventRecordSchema from './schemas/immunity_event_record';
import noInfectionSchema from './schemas/non_infection_check';
import prCardSchema from './schemas/pr_card.js';
import infectionDiagnosisSchema from './schemas/infection_diagnosis.js';
import immunityEventRecordSchema from './schemas/immunity_event_record.js';
import noInfectionSchema from './schemas/non_infection_check.js';

// Schema from here https://github.com/w3c-ccg/vc-examples/blob/master/plugfest-2020/vendors/sicpa/credentials/PermanentResidentCard.json
const credPRCard = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "root",
"version": "0.4.0",
"version": "0.6.0",
"private": true,
"workspaces": [
"packages/*",
Expand Down
6 changes: 6 additions & 0 deletions packages/cheqd-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @docknetwork/cheqd-blockchain-api

## 0.4.0

### Minor Changes

- Fix exports

## 0.3.0

### Minor Changes
Expand Down
9 changes: 7 additions & 2 deletions packages/cheqd-blockchain-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/cheqd-blockchain-api",
"version": "0.3.0",
"version": "0.4.0",
"license": "MIT",
"main": "./dist/esm/index.js",
"type": "module",
Expand All @@ -11,10 +11,15 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"require": "./dist/cjs/index.cjs",
"default": "./dist/esm/index.js"
},
"./*": {
"import": "./dist/esm/*/index.js",
"require": "./dist/cjs/*/index.cjs",
"default": "./dist/esm/*/index.js"
},
"./src/*": {
"import": "./dist/esm/*",
"require": "./dist/cjs/*",
"default": "./dist/esm/*"
Expand Down
25 changes: 25 additions & 0 deletions packages/cheqd-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @docknetwork/cheqd-blockchain-modules

## 0.5.2

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.7.0

## 0.5.1

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.6.0

## 0.5.0

### Minor Changes

- Fix exports

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.5.0

## 0.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd-blockchain-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"@docknetwork/credential-sdk": "0.4.0"
"@docknetwork/credential-sdk": "0.7.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd-blockchain-modules/src/attest/module.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AbstractAttestModule from '@docknetwork/credential-sdk/modules/abstract/attest/module';
import { AbstractAttestModule } from '@docknetwork/credential-sdk/modules';
import { injectCheqd } from '../common';
import CheqdInternalAttestModule from './internal';

Expand Down
4 changes: 2 additions & 2 deletions packages/cheqd-blockchain-modules/src/blob/module.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AbstractBlobModule from '@docknetwork/credential-sdk/modules/abstract/blob/module';
import { NoBlobError } from '@docknetwork/credential-sdk/modules/abstract/blob/errors';
import { AbstractBlobModule } from '@docknetwork/credential-sdk/modules';
import { NoBlobError } from '@docknetwork/credential-sdk/modules/abstract/blob';
import { CheqdBlobId } from '@docknetwork/credential-sdk/types';
import { injectCheqd } from '../common';
import CheqdInternalBlobModule from './internal';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils/inheritance';
import { withExtendedStaticProperties } from '@docknetwork/credential-sdk/utils';
import CheqdAPIProvider from './cheqd-api-provider';

export default function injectCheqd(klass) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd-blockchain-modules/src/did/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
TypedUUID,
TypedStruct,
} from '@docknetwork/credential-sdk/types/generic';
import { DIDDocument } from '@docknetwork/credential-sdk/types/did/document';
import { DIDDocument } from '@docknetwork/credential-sdk/types/did';
import { createInternalCheqdModule } from '../common';

const parseDocument = (document) => DIDDocument.from(document).toCheqd();
Expand Down
18 changes: 18 additions & 0 deletions packages/credential-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @docknetwork/credential-sdk

## 0.7.0

### Minor Changes

- JWT fixes

## 0.6.0

### Minor Changes

- Fix remaining exports from the `vc` module

## 0.5.0

### Minor Changes

- Fix exports

## 0.4.0

### Minor Changes
Expand Down
12 changes: 9 additions & 3 deletions packages/credential-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/credential-sdk",
"version": "0.4.0",
"version": "0.7.0",
"license": "MIT",
"type": "module",
"files": [
Expand All @@ -9,10 +9,15 @@
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"require": "./dist/cjs/index.cjs",
"default": "./dist/esm/index.js"
},
"./*": {
"import": "./dist/esm/*/index.js",
"require": "./dist/cjs/*/index.cjs",
"default": "./dist/esm/*/index.js"
},
"./src/*": {
"import": "./dist/esm/*",
"require": "./dist/cjs/*",
"default": "./dist/esm/*"
Expand All @@ -30,7 +35,8 @@
"@digitalcredentials/vc-status-list": "^8.0.0",
"@docknetwork/crypto-wasm-ts": "^0.63.0",
"@juanelas/base64": "^1.1.5",
"@stablelib/ed25519": "^2.0.0",
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "^0.25.0",
"@stablelib/ed25519": "^1.0.0",
"@subsquid/ss58-codec": "latest",
"@transmute/json-web-signature": "^0.7.0-unstable.82",
"blakejs": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-sdk/src/crypto/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from '@docknetwork/crypto-wasm-ts';
export * from '@docknetwork/crypto-wasm-ts/lib/index.js';
1 change: 1 addition & 0 deletions packages/credential-sdk/src/modules/abstract/blob/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as AbstractBlobModule } from './module';
export * from './errors';
25 changes: 25 additions & 0 deletions packages/credential-sdk/src/resolver/did/did-jwk-resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { getDidJwkResolver } from '@sphereon/ssi-sdk-ext.did-resolver-jwk';
import { Resolver } from '../generic';

const jwkResolver = getDidJwkResolver();

/**
* Resolves `DID` keys with identifier `did:jwk:*`.
*/
export default class DIDJWKResolver extends Resolver {
prefix = 'did';

method = 'jwk';

constructor() {
super(void 0);
}

async resolve(did) {
const { didDocument } = await jwkResolver.jwk(did);
return {
'@context': 'https://www.w3.org/ns/did/v1',
...didDocument,
};
}
}
1 change: 1 addition & 0 deletions packages/credential-sdk/src/resolver/did/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as DIDKeyResolver } from './did-key-resolver';
export { default as DIDJWKResolver } from './did-jwk-resolver';
export { default as DIDResolver } from './did-resolver';
export { default as UniversalResolver } from './universal-resolver';
2 changes: 1 addition & 1 deletion packages/credential-sdk/src/types/did/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
Ed255192020VerKeyName,
Ed25519VerKeyName,
Sr25519VerKeyName,
} from '../../vc/custom_crypto';
} from '../../vc/crypto';
import {
PublicKeyEd25519,
PublicKeySecp256k1,
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-sdk/src/types/did/onchain/did-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
Bls12381BBS23DockVerKeyName,
Bls12381BBSDockVerKeyName,
Bls12381PSDockVerKeyName,
} from '../../../vc/custom_crypto';
} from '../../../vc/crypto';

/**
* Class representing either of possible DidKeys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Bls12381BBS23DockVerKeyName,
Bls12381BBSDockVerKeyName,
Bls12381PSDockVerKeyName,
} from '../../../vc/custom_crypto';
} from '../../../vc/crypto';
import {
BBSPublicKeyValue,
BBSPlusPublicKeyValue,
Expand Down
Loading

0 comments on commit 3059824

Please sign in to comment.