Skip to content

Commit

Permalink
feat(did): getters and setters to DID publicKey, delegate, claims
Browse files Browse the repository at this point in the history
getters for claims, publicKey and delegate
setters for publicKey and delegate
fix to nats build script
  • Loading branch information
Passerino committed Mar 1, 2022
1 parent c321a68 commit 262f330
Show file tree
Hide file tree
Showing 6 changed files with 3,627 additions and 2,407 deletions.
124 changes: 116 additions & 8 deletions docs/api/classes/DidRegistry.md
Expand Up @@ -16,11 +16,16 @@
- [createDocument](DidRegistry.md#createdocument)
- [createPublicClaim](DidRegistry.md#createpublicclaim)
- [decodeJWTToken](DidRegistry.md#decodejwttoken)
- [getDidDelegates](DidRegistry.md#getdiddelegates)
- [getDidDocument](DidRegistry.md#getdiddocument)
- [getDidPublicKeys](DidRegistry.md#getdidpublickeys)
- [init](DidRegistry.md#init)
- [issuePublicClaim](DidRegistry.md#issuepublicclaim)
- [readServices](DidRegistry.md#readservices)
- [revokeDidDocument](DidRegistry.md#revokediddocument)
- [updateDocument](DidRegistry.md#updatedocument)
- [updateSignedDidDelegate](DidRegistry.md#updatesigneddiddelegate)
- [updateSignedDidPublicKey](DidRegistry.md#updatesigneddidpublickey)
- [verifyPublicClaim](DidRegistry.md#verifypublicclaim)
- [connect](DidRegistry.md#connect)

Expand Down Expand Up @@ -79,8 +84,6 @@ ___

**createPublicClaim**(`__namedParameters`): `Promise`<`string`\>

createPublicClaim

**`description`** create a public claim based on data provided

#### Parameters
Expand Down Expand Up @@ -116,6 +119,26 @@ ___

___

### getDidDelegates

**getDidDelegates**(`__namedParameters`): `Promise`<`undefined` \| `string`[]\>

**`description`** get public keys from DID's document

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `Object` |

#### Returns

`Promise`<`undefined` \| `string`[]\>

list of DID's delegates

___

### getDidDocument

**getDidDocument**(`__namedParameters?`): `Promise`<{ `service`: `IServiceEndpoint` & [`ClaimData`](../interfaces/ClaimData.md)[] }\>
Expand All @@ -132,6 +155,26 @@ ___

___

### getDidPublicKeys

**getDidPublicKeys**(`__namedParameters`): `Promise`<`IPublicKey`[]\>

**`description`** get public keys from User's DID document

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `Object` |

#### Returns

`Promise`<`IPublicKey`[]\>

list of public keys

___

### init

**init**(): `Promise`<`void`\>
Expand All @@ -146,8 +189,6 @@ ___

**issuePublicClaim**(`__namedParameters`): `Promise`<`string`\>

issuePublicClaim

**`description`** issue a public claim

#### Parameters
Expand All @@ -166,12 +207,30 @@ return issued token

___

### readServices

**readServices**(`__namedParameters?`): `Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/ClaimData.md)[]\>

**`description`** gets list of services endpoints from User's DID document

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `undefined` \| { `did?`: `string` } |

#### Returns

`Promise`<`IServiceEndpoint` & [`ClaimData`](../interfaces/ClaimData.md)[]\>

list of claims

___

### revokeDidDocument

**revokeDidDocument**(): `Promise`<`boolean`\>

revokeDidDocument

**`description`** revokes did document

#### Returns
Expand Down Expand Up @@ -206,12 +265,61 @@ true if document is updated successfuly

___

### updateSignedDidDelegate

**updateSignedDidDelegate**(`__namedParameters`): `Promise`<`boolean`\>

**`description`** updates delegate of the document of controlled `did`

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `Object` |
| `__namedParameters.algo` | `KeyType` |
| `__namedParameters.delegatePublicKey` | `string` |
| `__namedParameters.did` | `string` |
| `__namedParameters.type` | `PubKeyType` |
| `__namedParameters.validity?` | `number` |

#### Returns

`Promise`<`boolean`\>

true if document is updated successfuly

___

### updateSignedDidPublicKey

**updateSignedDidPublicKey**(`__namedParameters`): `Promise`<`boolean`\>

**`description`** Adds public key to the document of controlled `did`

#### Parameters

| Name | Type |
| :------ | :------ |
| `__namedParameters` | `Object` |
| `__namedParameters.algo` | `KeyType` |
| `__namedParameters.did` | `string` |
| `__namedParameters.publicKey` | `string` |
| `__namedParameters.tag` | `string` |
| `__namedParameters.type` | `PubKeyType` |
| `__namedParameters.validity?` | `number` |

#### Returns

`Promise`<`boolean`\>

true if document is updated successfuly

___

### verifyPublicClaim

**verifyPublicClaim**(`token`, `iss`): `Promise`<``null`` \| `string`\>

verifyPublicClaim

**`description`** verifies issued token of claim

#### Parameters
Expand Down
6 changes: 3 additions & 3 deletions docs/api/classes/DomainsService.md
Expand Up @@ -214,7 +214,7 @@ createRole
| Name | Type |
| :------ | :------ |
| `__namedParameters` | `Object` |
| `__namedParameters.data` | `IRoleDefinition` |
| `__namedParameters.data` | `IRoleDefinition` \| `IRoleDefinitionV2` |
| `__namedParameters.namespace` | `string` |
| `__namedParameters.returnSteps?` | `boolean` |
| `__namedParameters.roleName` | `string` |
Expand Down Expand Up @@ -613,7 +613,7 @@ setRoleDefinition
| Name | Type |
| :------ | :------ |
| `__namedParameters` | `Object` |
| `__namedParameters.data` | `IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition` |
| `__namedParameters.data` | `IOrganizationDefinition` \| `IAppDefinition` \| `IRoleDefinitionV2` |
| `__namedParameters.domain` | `string` |

#### Returns
Expand All @@ -635,7 +635,7 @@ This function sets the resolver in the ENS to the new contract for definitions t
| Name | Type | Description |
| :------ | :------ | :------ |
| `domain` | `string` | domain to potentially update |
| `data` | `IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition` | definition to apply to domain |
| `data` | `IRoleDefinition` \| `IOrganizationDefinition` \| `IAppDefinition` \| `IRoleDefinitionV2` | definition to apply to domain |

#### Returns

Expand Down
17 changes: 17 additions & 0 deletions docs/api/modules.md
Expand Up @@ -93,6 +93,7 @@

- [addSupportedDID](modules.md#addsupporteddid)
- [cacheConfigs](modules.md#cacheconfigs)
- [castToV2](modules.md#casttov2)
- [chainConfigs](modules.md#chainconfigs)
- [compareDID](modules.md#comparedid)
- [createWalletConnectProvider](modules.md#createwalletconnectprovider)
Expand Down Expand Up @@ -367,6 +368,22 @@ ___

___

### castToV2

**castToV2**(`roleDef`): `IRoleDefinitionV2`

#### Parameters

| Name | Type |
| :------ | :------ |
| `roleDef` | `IRoleDefinition` \| `IRoleDefinitionV2` |

#### Returns

`IRoleDefinitionV2`

___

### chainConfigs

`Const` **chainConfigs**(): `Object`
Expand Down

0 comments on commit 262f330

Please sign in to comment.