Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API docs setup #24

Merged
merged 5 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@mantine/hooks": "^7.12.2",
"@tabler/icons-react": "^3.17.0",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-router": "^1.57.17",
"@tanstack/react-router": "^1.58.3",
"codeco": "^1.4.3",
"jotai": "^2.9.2",
"multiformats": "^13.3.0",
Expand All @@ -32,8 +32,8 @@
"devDependencies": {
"@ceramic-sdk/model-client": "workspace:^",
"@ceramic-sdk/model-instance-client": "workspace:^",
"@tanstack/router-devtools": "^1.57.17",
"@tanstack/router-plugin": "^1.57.15",
"@tanstack/router-devtools": "^1.58.3",
"@tanstack/router-plugin": "^1.58.4",
"@types/react": "^18.3.7",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.5.0",
Expand Down
46 changes: 46 additions & 0 deletions docs/@ceramic-sdk/events/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
**@ceramic-sdk/events v0.1.0** • **Docs**

***

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

# @ceramic-sdk/events

## Type Aliases

- [EventContainer](type-aliases/EventContainer.md)
- [InitEventHeader](type-aliases/InitEventHeader.md)
- [InitEventPayload](type-aliases/InitEventPayload.md)
- [PartialInitEventHeader](type-aliases/PartialInitEventHeader.md)
- [SignedEvent](type-aliases/SignedEvent.md)
- [SignedEventContainer](type-aliases/SignedEventContainer.md)
- [TimeEvent](type-aliases/TimeEvent.md)
- [UnsignedEventContainer](type-aliases/UnsignedEventContainer.md)

## Variables

- [InitEventHeader](variables/InitEventHeader.md)
- [InitEventPayload](variables/InitEventPayload.md)
- [SignedEvent](variables/SignedEvent.md)
- [TimeEvent](variables/TimeEvent.md)

## Functions

- [assertSignedEvent](functions/assertSignedEvent.md)
- [assertTimeEvent](functions/assertTimeEvent.md)
- [carFromString](functions/carFromString.md)
- [carToString](functions/carToString.md)
- [createSignedInitEvent](functions/createSignedInitEvent.md)
- [decodeSignedEvent](functions/decodeSignedEvent.md)
- [decodeTimeEvent](functions/decodeTimeEvent.md)
- [encodeEventToCAR](functions/encodeEventToCAR.md)
- [eventFromCAR](functions/eventFromCAR.md)
- [eventFromString](functions/eventFromString.md)
- [eventToCAR](functions/eventToCAR.md)
- [eventToContainer](functions/eventToContainer.md)
- [eventToString](functions/eventToString.md)
- [getSignedEventPayload](functions/getSignedEventPayload.md)
- [signedEventToCAR](functions/signedEventToCAR.md)
- [signedEventToContainer](functions/signedEventToContainer.md)
- [signEvent](functions/signEvent.md)
- [unsignedEventToContainer](functions/unsignedEventToContainer.md)
23 changes: 23 additions & 0 deletions docs/@ceramic-sdk/events/functions/assertSignedEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: assertSignedEvent()

> **assertSignedEvent**(`input`): `asserts input is MapIn<RequiredProps<Object>, $TypeOf> & MapIn<OptionalProps<Object>, $TypeOf>`

Assert the provided `input` is a SignedEvent

## Parameters

• **input**: `unknown`

## Returns

`asserts input is MapIn<RequiredProps<Object>, $TypeOf> & MapIn<OptionalProps<Object>, $TypeOf>`

## Defined in

[packages/events/src/codecs.ts:70](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L70)
23 changes: 23 additions & 0 deletions docs/@ceramic-sdk/events/functions/assertTimeEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: assertTimeEvent()

> **assertTimeEvent**(`input`): `asserts input is MapIn<Object, $TypeOf>`

Assert the provided `input` is a TimeEvent

## Parameters

• **input**: `unknown`

## Returns

`asserts input is MapIn<Object, $TypeOf>`

## Defined in

[packages/events/src/codecs.ts:94](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L94)
25 changes: 25 additions & 0 deletions docs/@ceramic-sdk/events/functions/carFromString.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: carFromString()

> **carFromString**(`value`, `base`): `CAR`

Decode a CAR from a string, using the given base (defaults to base64)

## Parameters

• **value**: `string`

• **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`

## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:30](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L30)
25 changes: 25 additions & 0 deletions docs/@ceramic-sdk/events/functions/carToString.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: carToString()

> **carToString**(`car`, `base`): `string`

Encode a CAR into a string, using the given base (defaults to base64)

## Parameters

• **car**: `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`

## Returns

`string`

## Defined in

[packages/events/src/encoding.ts:25](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L25)
33 changes: 33 additions & 0 deletions docs/@ceramic-sdk/events/functions/createSignedInitEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: createSignedInitEvent()

> **createSignedInitEvent**\<`T`\>(`did`, `data`, `header`, `options`?): `Promise`\<[`SignedEvent`](../type-aliases/SignedEvent.md)\>

Create a signed init event using the provided DID, data and header

## Type Parameters

• **T**

## Parameters

• **did**: `DID`

• **data**: `T`

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

• **options?**: `CreateJWSOptions`

## Returns

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

## Defined in

[packages/events/src/signing.ts:33](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/signing.ts#L33)
23 changes: 23 additions & 0 deletions docs/@ceramic-sdk/events/functions/decodeSignedEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: decodeSignedEvent()

> **decodeSignedEvent**(`input`): [`SignedEvent`](../type-aliases/SignedEvent.md)

Decode the provided `input` as a SignedEvent. Throws if decoding fails.

## Parameters

• **input**: `unknown`

## Returns

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

## Defined in

[packages/events/src/codecs.ts:65](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L65)
23 changes: 23 additions & 0 deletions docs/@ceramic-sdk/events/functions/decodeTimeEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: decodeTimeEvent()

> **decodeTimeEvent**(`input`): [`TimeEvent`](../type-aliases/TimeEvent.md)

Decode the provided `input` as a TimeEvent. Throws if decoding fails.

## Parameters

• **input**: `unknown`

## Returns

[`TimeEvent`](../type-aliases/TimeEvent.md)

## Defined in

[packages/events/src/codecs.ts:89](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L89)
25 changes: 25 additions & 0 deletions docs/@ceramic-sdk/events/functions/encodeEventToCAR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: encodeEventToCAR()

> **encodeEventToCAR**(`codec`, `event`): `CAR`

Encode an unsigned event into a CAR using the provided codec

## Parameters

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

• **event**: `unknown`

## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:72](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L72)
31 changes: 31 additions & 0 deletions docs/@ceramic-sdk/events/functions/eventFromCAR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: eventFromCAR()

> **eventFromCAR**\<`Payload`\>(`decoder`, `car`, `eventCID`?): [`SignedEvent`](../type-aliases/SignedEvent.md) \| `Payload`

Decode an event from a string using the provided codec for unsigned events

## Type Parameters

• **Payload** = `unknown`

## Parameters

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

• **car**: `CAR`

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

## Returns

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

## Defined in

[packages/events/src/encoding.ts:98](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L98)
31 changes: 31 additions & 0 deletions docs/@ceramic-sdk/events/functions/eventFromString.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: eventFromString()

> **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)

## Type Parameters

• **Payload** = `unknown`

## Parameters

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

• **value**: `string`

• **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"`

## Returns

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

## Defined in

[packages/events/src/encoding.ts:128](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L128)
25 changes: 25 additions & 0 deletions docs/@ceramic-sdk/events/functions/eventToCAR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: eventToCAR()

> **eventToCAR**(`codec`, `event`): `CAR`

Encode an event into a CAR using the provided codec for unsigned events

## Parameters

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

• **event**: `unknown`

## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:82](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L82)
31 changes: 31 additions & 0 deletions docs/@ceramic-sdk/events/functions/eventToContainer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[**@ceramic-sdk/events v0.1.0**](../README.md) • **Docs**

***

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

# Function: eventToContainer()

> **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

## Type Parameters

• **Payload**

## Parameters

• **did**: `DID`

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

• **event**: `unknown`

## Returns

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

## Defined in

[packages/events/src/container.ts:54](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/container.ts#L54)
Loading