Skip to content

Commit

Permalink
Typedoc re-generation of package documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mzkrasner committed Dec 19, 2024
1 parent 1705e45 commit f0c51e6
Show file tree
Hide file tree
Showing 170 changed files with 1,475 additions and 219 deletions.
4 changes: 3 additions & 1 deletion docs/@ceramic-sdk/events/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**@ceramic-sdk/events v0.1.0****Docs**
**@ceramic-sdk/events v0.2.1****Docs**

***

Expand Down Expand Up @@ -31,6 +31,8 @@
- [carFromString](functions/carFromString.md)
- [carToString](functions/carToString.md)
- [createSignedInitEvent](functions/createSignedInitEvent.md)
- [decodeMultibaseToJSON](functions/decodeMultibaseToJSON.md)
- [decodeMultibaseToStreamID](functions/decodeMultibaseToStreamID.md)
- [decodeSignedEvent](functions/decodeSignedEvent.md)
- [decodeTimeEvent](functions/decodeTimeEvent.md)
- [encodeEventToCAR](functions/encodeEventToCAR.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/@ceramic-sdk/events/functions/assertSignedEvent.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand Down
2 changes: 1 addition & 1 deletion docs/@ceramic-sdk/events/functions/assertTimeEvent.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand Down
14 changes: 12 additions & 2 deletions docs/@ceramic-sdk/events/functions/carFromString.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,14 +8,24 @@

> **carFromString**(`value`, `base`): `CAR`
Decode a CAR from a string, using the given base (defaults to base64)
Decodes a CAR from a string using the specified base encoding.

## Parameters

**value**: `string`

The string-encoded CAR.

**base**: `"base64url"` \| `"base256emoji"` \| `"base64"` \| `"base64pad"` \| `"base64urlpad"` \| `"base58btc"` \| `"base58flickr"` \| `"base36"` \| `"base36upper"` \| `"base32"` \| `"base32upper"` \| `"base32pad"` \| `"base32padupper"` \| `"base32hex"` \| `"base32hexupper"` \| `"base32hexpad"` \| `"base32hexpadupper"` \| `"base32z"` \| `"base16"` \| `"base16upper"` \| `"base10"` \| `"base8"` \| `"base2"` \| `"identity"` = `DEFAULT_BASE`

The base encoding used to decode the CAR (defaults to Base64).

## Returns

`CAR`

The decoded CAR object.

## Throws

Will throw an error if the base encoding is not supported.
14 changes: 12 additions & 2 deletions docs/@ceramic-sdk/events/functions/carToString.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,14 +8,24 @@

> **carToString**(`car`, `base`): `string`
Encode a CAR into a string, using the given base (defaults to base64)
Encodes a CAR into a string using the specified base encoding.

## Parameters

**car**: `CAR`

The CAR to encode.

**base**: `"base64url"` \| `"base256emoji"` \| `"base64"` \| `"base64pad"` \| `"base64urlpad"` \| `"base58btc"` \| `"base58flickr"` \| `"base36"` \| `"base36upper"` \| `"base32"` \| `"base32upper"` \| `"base32pad"` \| `"base32padupper"` \| `"base32hex"` \| `"base32hexupper"` \| `"base32hexpad"` \| `"base32hexpadupper"` \| `"base32z"` \| `"base16"` \| `"base16upper"` \| `"base10"` \| `"base8"` \| `"base2"` \| `"identity"` = `DEFAULT_BASE`

The base encoding to use (defaults to Base64).

## Returns

`string`

The string-encoded CAR.

## Throws

Will throw an error if the base encoding is not supported.
24 changes: 22 additions & 2 deletions docs/@ceramic-sdk/events/functions/createSignedInitEvent.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,7 +8,7 @@

> **createSignedInitEvent**\<`T`\>(`did`, `data`, `header`, `options`?): `Promise`\<[`SignedEvent`](../type-aliases/SignedEvent.md)\>
Create a signed init event using the provided DID, data and header
Creates a signed initialization event using the provided DID, data, and header.

## Type Parameters

Expand All @@ -18,12 +18,32 @@ Create a signed init event using the provided DID, data and header

**did**: `DID`

The DID instance used to sign the initialization event.

**data**: `T`

The initialization data to be included in the event.

**header**: [`PartialInitEventHeader`](../type-aliases/PartialInitEventHeader.md)

The header for the initialization event, with optional controllers.

**options?**: `CreateJWSOptions`

(Optional) Additional options for creating the JWS.

## Returns

`Promise`\<[`SignedEvent`](../type-aliases/SignedEvent.md)\>

A promise that resolves to a `SignedEvent` representing the initialization event.

## Throws

Will throw an error if the DID is not authenticated.

## Remarks

- If `controllers` are not provided in the header, they will be automatically set
based on the DID's parent (if available) or the DID itself.
- The payload is encoded as an `InitEventPayload` before signing.
36 changes: 36 additions & 0 deletions docs/@ceramic-sdk/events/functions/decodeMultibaseToJSON.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

[Ceramic SDK](../../../README.md) / [@ceramic-sdk/events](../README.md) / decodeMultibaseToJSON

# Function: decodeMultibaseToJSON()

> **decodeMultibaseToJSON**\<`T`\>(`value`): `T`
Decodes a multibase-encoded string into a JSON object.

## Type Parameters

**T** = `Record`\<`string`, `unknown`\>

The expected shape of the returned JSON object (defaults to `Record<string, unknown>`).

## Parameters

**value**: `string`

The multibase-encoded string to decode.

## Returns

`T`

The decoded JSON object.

## Example

```typescript
const json = decodeMultibaseToJSON<{ key: string }>('z1a2b3c...');
console.log(json.key); // Output: "value"
```
30 changes: 30 additions & 0 deletions docs/@ceramic-sdk/events/functions/decodeMultibaseToStreamID.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

[Ceramic SDK](../../../README.md) / [@ceramic-sdk/events](../README.md) / decodeMultibaseToStreamID

# Function: decodeMultibaseToStreamID()

> **decodeMultibaseToStreamID**(`value`): [`StreamID`](../../identifiers/classes/StreamID.md)
Decodes a multibase-encoded string into a `StreamID`.

## Parameters

**value**: `string`

The multibase-encoded string to decode.

## Returns

[`StreamID`](../../identifiers/classes/StreamID.md)

A `StreamID` object representing the decoded value.

## Example

```typescript
const streamID = decodeMultibaseToStreamID('z1a2b3c...');
console.log(streamID.toString()); // Output: StreamID
```
2 changes: 1 addition & 1 deletion docs/@ceramic-sdk/events/functions/decodeSignedEvent.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand Down
2 changes: 1 addition & 1 deletion docs/@ceramic-sdk/events/functions/decodeTimeEvent.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand Down
14 changes: 12 additions & 2 deletions docs/@ceramic-sdk/events/functions/encodeEventToCAR.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,14 +8,24 @@

> **encodeEventToCAR**(`codec`, `event`): `CAR`
Encode an unsigned event into a CAR using the provided codec
Encodes an unsigned event into a CAR using the provided codec.

## Parameters

**codec**: `Codec`\<`unknown`, `unknown`, `unknown`\>

The codec used to encode the event.

**event**: `unknown`

The unsigned event to encode.

## Returns

`CAR`

A CAR object representing the unsigned event.

## Remarks

Encodes the event as the root of the CAR file using the specified codec.
16 changes: 14 additions & 2 deletions docs/@ceramic-sdk/events/functions/eventFromCAR.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,7 +8,7 @@

> **eventFromCAR**\<`Payload`\>(`decoder`, `car`, `eventCID`?): [`SignedEvent`](../type-aliases/SignedEvent.md) \| `Payload`
Decode an event from a string using the provided codec for unsigned events
Decodes an event from a CAR object using the specified decoder.

## Type Parameters

Expand All @@ -18,10 +18,22 @@ Decode an event from a string using the provided codec for unsigned events

**decoder**: `Decoder`\<`unknown`, `Payload`\>

The decoder to use for unsigned events.

**car**: `CAR`

The CAR object containing the event.

**eventCID?**: `CID`\<`unknown`, `number`, `number`, `Version`\>

(Optional) The CID of the event to decode.

## Returns

[`SignedEvent`](../type-aliases/SignedEvent.md) \| `Payload`

The decoded event, either a `SignedEvent` or a custom payload.

## Throws

Will throw an error if the linked block is missing or decoding fails.
12 changes: 10 additions & 2 deletions docs/@ceramic-sdk/events/functions/eventFromString.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,7 +8,7 @@

> **eventFromString**\<`Payload`\>(`decoder`, `value`, `base`?): [`SignedEvent`](../type-aliases/SignedEvent.md) \| `Payload`
Decode an event from a string using the provided codec for unsigned events and the given base (defaults to base64)
Decodes an event from a string using the specified decoder and base encoding.

## Type Parameters

Expand All @@ -18,10 +18,18 @@ Decode an event from a string using the provided codec for unsigned events and t

**decoder**: `Decoder`\<`unknown`, `Payload`\>

The decoder to use for unsigned events.

**value**: `string`

The string-encoded CAR containing the event.

**base?**: `"base64url"` \| `"base256emoji"` \| `"base64"` \| `"base64pad"` \| `"base64urlpad"` \| `"base58btc"` \| `"base58flickr"` \| `"base36"` \| `"base36upper"` \| `"base32"` \| `"base32upper"` \| `"base32pad"` \| `"base32padupper"` \| `"base32hex"` \| `"base32hexupper"` \| `"base32hexpad"` \| `"base32hexpadupper"` \| `"base32z"` \| `"base16"` \| `"base16upper"` \| `"base10"` \| `"base8"` \| `"base2"` \| `"identity"`

The base encoding used (defaults to Base64).

## Returns

[`SignedEvent`](../type-aliases/SignedEvent.md) \| `Payload`

The decoded event, either a `SignedEvent` or a custom payload.
14 changes: 12 additions & 2 deletions docs/@ceramic-sdk/events/functions/eventToCAR.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,14 +8,24 @@

> **eventToCAR**(`codec`, `event`): `CAR`
Encode an event into a CAR using the provided codec for unsigned events
Encodes an event into a CAR. Supports both signed and unsigned events.

## Parameters

**codec**: `Codec`\<`unknown`, `unknown`, `unknown`\>

The codec used for unsigned events.

**event**: `unknown`

The event to encode (signed or unsigned).

## Returns

`CAR`

A CAR object representing the event.

## Remarks

Uses `signedEventToCAR` for signed events and `encodeEventToCAR` for unsigned events.
18 changes: 16 additions & 2 deletions docs/@ceramic-sdk/events/functions/eventToContainer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@ceramic-sdk/events v0.1.0**](../README.md)**Docs**
[**@ceramic-sdk/events v0.2.1**](../README.md)**Docs**

***

Expand All @@ -8,7 +8,7 @@

> **eventToContainer**\<`Payload`\>(`did`, `codec`, `event`): `Promise`\<[`EventContainer`](../type-aliases/EventContainer.md)\<`Payload`\>\>
Decode a Ceramic event into a container using the provided verifier DID and payload decoder
Decodes a Ceramic event (signed or unsigned) into a container.

## Type Parameters

Expand All @@ -18,10 +18,24 @@ Decode a Ceramic event into a container using the provided verifier DID and payl

**did**: `DID`

The DID used to verify the event's JWS if it is signed.

**codec**: `Decoder`\<`unknown`, `Payload`\>

The codec used to decode the event's payload.

**event**: `unknown`

The Ceramic event to decode (can be signed or unsigned).

## Returns

`Promise`\<[`EventContainer`](../type-aliases/EventContainer.md)\<`Payload`\>\>

A promise that resolves to an `EventContainer` containing the decoded payload and metadata.

## Remarks

- This function determines the type of the event (signed or unsigned) and processes it accordingly.
- For signed events, it verifies the JWS and decodes the payload.
- For unsigned events, it simply decodes the payload.
Loading

0 comments on commit f0c51e6

Please sign in to comment.