From c19b7658d7abe877b312e27023b891ec4506844f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Mon, 11 Jul 2022 11:18:34 +0200 Subject: [PATCH] Fix doc links (#925) --- .github/workflows/test-docs-build.yml | 4 +- bindings/wasm/docs/api-reference.md | 69 +++++++++---------- .../account/wasm_account/account_builder.rs | 2 - bindings/wasm/src/crypto/wasm_ed25519.rs | 4 +- bindings/wasm/src/did/wasm_document.rs | 2 +- 5 files changed, 39 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test-docs-build.yml b/.github/workflows/test-docs-build.yml index 4c8078fbcb..57f917f16c 100644 --- a/.github/workflows/test-docs-build.yml +++ b/.github/workflows/test-docs-build.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Test Build - # TODO Add 'yarn build' as last line once broken links are fixed + working-directory: documentation run: | - cd documentation yarn install --immutable + yarn build diff --git a/bindings/wasm/docs/api-reference.md b/bindings/wasm/docs/api-reference.md index cd49b97317..02103b8c15 100644 --- a/bindings/wasm/docs/api-reference.md +++ b/bindings/wasm/docs/api-reference.md @@ -197,10 +197,10 @@ This variant is the default used if no other variant is specified when construct
FirstError

Return after the first error occurs.

-
KeyType
-
MethodRelationship
+
KeyType
+
## Functions @@ -222,9 +222,9 @@ publishing to the Tangle. **Kind**: global class * [Account](#Account) - * [.createService(options)](#Account+createService) ⇒ Promise.<void> - * [.createMethod(options)](#Account+createMethod) ⇒ Promise.<void> * [.attachMethodRelationships(options)](#Account+attachMethodRelationships) ⇒ Promise.<void> + * [.createMethod(options)](#Account+createMethod) ⇒ Promise.<void> + * [.detachMethodRelationships(options)](#Account+detachMethodRelationships) ⇒ Promise.<void> * [.did()](#Account+did) ⇒ [DID](#DID) * [.autopublish()](#Account+autopublish) ⇒ boolean * [.autosave()](#Account+autosave) ⇒ [AutoSave](#AutoSave) @@ -242,22 +242,25 @@ publishing to the Tangle. * [.unrevokeCredentials(fragment, credentialIndices)](#Account+unrevokeCredentials) ⇒ Promise.<void> * [.encryptData(plaintext, associated_data, encryption_algorithm, cek_algorithm, public_key)](#Account+encryptData) ⇒ [Promise.<EncryptedData>](#EncryptedData) * [.decryptData(data, encryption_algorithm, cek_algorithm, fragment)](#Account+decryptData) ⇒ Promise.<Uint8Array> - * [.detachMethodRelationships(options)](#Account+detachMethodRelationships) ⇒ Promise.<void> * [.deleteService(options)](#Account+deleteService) ⇒ Promise.<void> * [.setAlsoKnownAs(options)](#Account+setAlsoKnownAs) ⇒ Promise.<void> * [.setController(options)](#Account+setController) ⇒ Promise.<void> * [.deleteMethod(options)](#Account+deleteMethod) ⇒ Promise.<void> + * [.createService(options)](#Account+createService) ⇒ Promise.<void> - + -### account.createService(options) ⇒ Promise.<void> -Adds a new Service to the DID Document. +### account.attachMethodRelationships(options) ⇒ Promise.<void> +Attach one or more verification relationships to a method. + +Note: the method must exist and be in the set of verification methods; +it cannot be an embedded method. **Kind**: instance method of [Account](#Account) | Param | Type | | --- | --- | -| options | CreateServiceOptions | +| options | AttachMethodRelationshipOptions | @@ -270,19 +273,16 @@ Adds a new verification method to the DID document. | --- | --- | | options | CreateMethodOptions | - - -### account.attachMethodRelationships(options) ⇒ Promise.<void> -Attach one or more verification relationships to a method. + -Note: the method must exist and be in the set of verification methods; -it cannot be an embedded method. +### account.detachMethodRelationships(options) ⇒ Promise.<void> +Detaches the given relationship from the given method, if the method exists. **Kind**: instance method of [Account](#Account) | Param | Type | | --- | --- | -| options | AttachMethodRelationshipOptions | +| options | DetachMethodRelationshipOptions | @@ -475,17 +475,6 @@ Returns the decrypted text. | cek_algorithm | [CekAlgorithm](#CekAlgorithm) | | fragment | string | - - -### account.detachMethodRelationships(options) ⇒ Promise.<void> -Detaches the given relationship from the given method, if the method exists. - -**Kind**: instance method of [Account](#Account) - -| Param | Type | -| --- | --- | -| options | DetachMethodRelationshipOptions | - ### account.deleteService(options) ⇒ Promise.<void> @@ -530,6 +519,17 @@ Deletes a verification method if the method exists. | --- | --- | | options | DeleteMethodOptions | + + +### account.createService(options) ⇒ Promise.<void> +Adds a new Service to the DID Document. + +**Kind**: instance method of [Account](#Account) + +| Param | Type | +| --- | --- | +| options | CreateServiceOptions | + ## AccountBuilder @@ -581,7 +581,6 @@ The identity is stored locally in the `Storage`. The DID network is automaticall by the [Client](#Client) used to publish it. **Kind**: instance method of [AccountBuilder](#AccountBuilder) -**See**: [IdentitySetup](IdentitySetup) to customize the identity creation. | Param | Type | | --- | --- | @@ -2065,7 +2064,7 @@ on the same document. This is intended for signing updates to a document where a capability invocation method is rotated or replaced entirely. NOTE: does not validate whether the private key of the given `key_pair` corresponds to the -verification method. See [Document.verifyDocument](Document.verifyDocument). +verification method. See [Document.verifyDocument](#Document+verifyDocument). **Kind**: instance method of [Document](#Document) @@ -2622,7 +2621,7 @@ Length in bytes of an Ed25519 signature. ### Ed25519.sign(message, privateKey) ⇒ Uint8Array Computes an EdDSA signature using an Ed25519 private key. -NOTE: this differs from [Document.signData](Document.signData) which uses JCS +NOTE: this differs from [Document.signData](#Document+signData) which uses JCS to canonicalize JSON messages. The private key must be a 32-byte seed in compliance with [RFC 8032](https://datatracker.ietf.org/doc/html/rfc8032#section-3.2). @@ -2640,7 +2639,7 @@ Other implementations often use another format. See [this blog post](https://blo ### Ed25519.verify(message, signature, publicKey) Verifies an EdDSA signature against an Ed25519 public key. -NOTE: this differs from [Document.verifyData](Document.verifyData) which uses JCS +NOTE: this differs from [Document.verifyData](#Document+verifyData) which uses JCS to canonicalize JSON messages. **Kind**: static method of [Ed25519](#Ed25519) @@ -4984,15 +4983,15 @@ Return all errors that occur during validation. ## FirstError Return after the first error occurs. -**Kind**: global variable - - -## KeyType **Kind**: global variable ## MethodRelationship **Kind**: global variable + + +## KeyType +**Kind**: global variable ## start() diff --git a/bindings/wasm/src/account/wasm_account/account_builder.rs b/bindings/wasm/src/account/wasm_account/account_builder.rs index 010ea7694a..3132593985 100644 --- a/bindings/wasm/src/account/wasm_account/account_builder.rs +++ b/bindings/wasm/src/account/wasm_account/account_builder.rs @@ -90,8 +90,6 @@ impl WasmAccountBuilder { /// /// The identity is stored locally in the `Storage`. The DID network is automatically determined /// by the {@link Client} used to publish it. - /// - /// @See {@link IdentitySetup} to customize the identity creation. #[wasm_bindgen(js_name = createIdentity)] pub fn create_identity(&mut self, identity_setup: Option) -> Result { let setup: IdentitySetup = identity_setup.map(IdentitySetup::from).unwrap_or_default(); diff --git a/bindings/wasm/src/crypto/wasm_ed25519.rs b/bindings/wasm/src/crypto/wasm_ed25519.rs index 175a153e1f..0021add624 100644 --- a/bindings/wasm/src/crypto/wasm_ed25519.rs +++ b/bindings/wasm/src/crypto/wasm_ed25519.rs @@ -36,7 +36,7 @@ impl WasmEd25519 { /// Computes an EdDSA signature using an Ed25519 private key. /// - /// NOTE: this differs from {@link Document.signData} which uses JCS + /// NOTE: this differs from [Document.signData](#Document+signData) which uses JCS /// to canonicalize JSON messages. /// /// The private key must be a 32-byte seed in compliance with [RFC 8032](https://datatracker.ietf.org/doc/html/rfc8032#section-3.2). @@ -52,7 +52,7 @@ impl WasmEd25519 { /// Verifies an EdDSA signature against an Ed25519 public key. /// - /// NOTE: this differs from {@link Document.verifyData} which uses JCS + /// NOTE: this differs from [Document.verifyData](#Document+verifyData) which uses JCS /// to canonicalize JSON messages. #[allow(non_snake_case)] #[wasm_bindgen] diff --git a/bindings/wasm/src/did/wasm_document.rs b/bindings/wasm/src/did/wasm_document.rs index 5f95d3e10e..1231781cd6 100644 --- a/bindings/wasm/src/did/wasm_document.rs +++ b/bindings/wasm/src/did/wasm_document.rs @@ -366,7 +366,7 @@ impl WasmDocument { /// capability invocation method is rotated or replaced entirely. /// /// NOTE: does not validate whether the private key of the given `key_pair` corresponds to the - /// verification method. See {@link Document.verifyDocument}. + /// verification method. See [Document.verifyDocument](#Document+verifyDocument). #[wasm_bindgen(js_name = signDocument)] pub fn sign_document( &self,