Skip to content

Commit

Permalink
Merge pull request #118 from Sphereon-Opensource/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
nklomp authored Jul 31, 2023
2 parents bf86b36 + 33f5f9f commit fc17cb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 3 additions & 5 deletions packages/uni-resolver-registrar-api/src/api-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DidStateValue,
ICreateDidEndpointOpts,
IGlobalDidWebEndpointOpts,
IRequiredContext,
IRequiredContext, IResolveEndpointOpts,
} from './types'

export function createDidEndpoint(router: Router, context: IRequiredContext, opts?: ICreateDidEndpointOpts) {
Expand All @@ -39,7 +39,7 @@ export function createDidEndpoint(router: Router, context: IRequiredContext, opt
return sendErrorResponse(response, 400, 'DID method not supported')
}
const provider = `did:${didMethod}`
const jobId = createRequest.jobId ?? `urn:uuid:${v4()}`
const jobId = createRequest.jobId ?? v4()
let alias: string | undefined = undefined
if (didMethod === 'web') {
if (!did) {
Expand Down Expand Up @@ -137,9 +137,7 @@ async function agentDidToResolutionResult(context: IRequiredContext, did: string
export function resolveDidEndpoint(
router: Router,
context: IRequiredContext,
opts?: ISingleEndpointOpts & {
mode?: 'local' | 'hybrid' | 'global'
}
opts?: IResolveEndpointOpts
) {
if (opts?.enabled === false) {
console.log(`Resolve DID endpoint is disabled`)
Expand Down
6 changes: 5 additions & 1 deletion packages/uni-resolver-registrar-api/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface IDidAPIEndpointOpts {
basePath?: string
globalAuth?: GenericAuthArgs
createDid?: ICreateDidEndpointOpts
resolveDid?: ISingleEndpointOpts
resolveDid?: IResolveEndpointOpts
deactivateDid?: ISingleEndpointOpts
getDidMethods?: ISingleEndpointOpts
globalDidWebResolution?: IGlobalDidWebEndpointOpts
Expand All @@ -111,5 +111,9 @@ export interface ICreateDidEndpointOpts extends ISingleEndpointOpts {
defaultMethod?: string
}

export interface IResolveEndpointOpts extends ISingleEndpointOpts {
mode?: 'local' | 'hybrid' | 'global'
}

export type DidWebServiceFeatures = 'did-web-global-resolution'
export type DidApiFeatures = 'did-resolve' | 'did-persist'

0 comments on commit fc17cb5

Please sign in to comment.