-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update `Resolver` to support `MultiApi` modules * Tweaks for tests and docs * Example tweak * Corrections * Tutorial tweak * Temporary disable autogenerated resolver tests * Misc tweaks * Tweaks * Small tweak * Fix docs * Update scripts * Tweaks * More fixes * Tweaks + update scripts * Tweaks * Lints
- Loading branch information
Showing
61 changed files
with
781 additions
and
594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 33 additions & 6 deletions
39
packages/credential-sdk/src/resolver/blob/blob-resolver.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,36 @@ | ||
import { MultiResolver } from '../generic'; | ||
import { ensureInstanceOf } from '../../utils'; | ||
import { AbstractBlobModule } from '../../modules/abstract/blob'; | ||
import { Resolver } from '../generic'; | ||
|
||
class DockBlobResolver extends Resolver { | ||
prefix = 'blob'; | ||
|
||
get method() { | ||
return this.blobModule.methods(); | ||
} | ||
|
||
/** | ||
* @param {AbstractBlobModule} | ||
* @constructor | ||
*/ | ||
constructor(blobModule) { | ||
super(); | ||
|
||
/** | ||
* @type {AbstractBlobModule} | ||
*/ | ||
this.blobModule = ensureInstanceOf(blobModule, AbstractBlobModule); | ||
} | ||
|
||
async resolve(blobUri) { | ||
const [author, blob] = await this.blobModule.get(blobUri); | ||
|
||
return [String(author), blob.toObjectOrBytes()]; | ||
} | ||
} | ||
|
||
/** | ||
* Resolves `Blob` with the identifier `blob:*`. | ||
* @abstract | ||
* Resolves `Blob`s with identifier `blob:dock:*`. | ||
* @type {DockBlobResolver} | ||
*/ | ||
export default class BlobResolver extends MultiResolver { | ||
static PREFIX = 'blob'; | ||
} | ||
export default DockBlobResolver; |
32 changes: 0 additions & 32 deletions
32
packages/credential-sdk/src/resolver/blob/dock-blob-resolver.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export { default as BlobResolver } from './blob-resolver'; | ||
export { default as DockBlobResolver } from './dock-blob-resolver'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { DIDResolver } from './did'; | ||
import { StatusList2021Resolver } from './status-list2021'; | ||
import { ResolverRouter } from './generic'; | ||
import { BlobResolver } from './blob'; | ||
import { ensureInstanceOf } from '../utils'; | ||
import { AbstractCoreModules } from '../modules'; | ||
|
||
/** | ||
* Resolves dock-hosted entities such us `did:dock:*` and `status-list2021:dock:*`, `rev-reg:dock:*`, `blob:dock:*`. | ||
*/ | ||
export default class CoreResolver extends ResolverRouter { | ||
constructor(modules) { | ||
ensureInstanceOf(modules, AbstractCoreModules); | ||
|
||
super([ | ||
new DIDResolver(modules.did), | ||
new StatusList2021Resolver(modules.statusListCredential), | ||
new BlobResolver(modules.blob), | ||
]); | ||
} | ||
} |
Oops, something went wrong.