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

Stream client classes #25

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
23 changes: 21 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ on:
push:
branches: ["main"]
pull_request:

env:
C1_REGISTRY: "public.ecr.aws/r5b3e0r5/3box/ceramic-one"
C1_VERSION: "0.37.0"
CI: true

jobs:
test:
name: Run integration tests
Expand Down Expand Up @@ -32,8 +36,8 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
name: Setup pnpm cache
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand All @@ -42,5 +46,20 @@ jobs:
- name: Install dependencies and build
run: pnpm install --frozen-lockfile

- name: Restore C1 Docker image if it exists
id: cache-docker-c1
uses: actions/cache@v4
with:
path: ci/cache/docker/c1
key: cache-docker-c1-${{ env.C1_VERSION }}

- name: Update C1 Docker image if cache miss
if: steps.cache-docker-c1.outputs.cache-hit != 'true'
run: docker pull ${{ env.C1_REGISTRY }}:${{ env.C1_VERSION }} && mkdir -p ci/cache/docker/c1 && docker image save ${{ env.C1_REGISTRY }}:${{ env.C1_VERSION }} --output ./ci/cache/docker/c1/${{ env.C1_VERSION }}.tar

- name: Use C1 Docker image if cache hit
if: steps.cache-docker-c1.outputs.cache-hit == 'true'
run: docker image load --input ./ci/cache/docker/c1/${{ env.C1_VERSION }}.tar

- name: Test
run: cd tests/c1-integration && pnpm run test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ TypeScript client and utilities for [Ceramic One](https://github.com/ceramicnetw
| [model-client](./packages/model-client) | Model streams client | ![npm version](https://img.shields.io/npm/v/@ceramic-sdk/model-client.svg) |
| [model-instance-protocol](./packages/model-instance-protocol) | ModelInstanceDocument streams protocol | ![npm version](https://img.shields.io/npm/v/@ceramic-sdk/model-instance-protocol.svg) |
| [model-instance-client](./packages/model-instance-client) | ModelInstanceDocument streams client | ![npm version](https://img.shields.io/npm/v/@ceramic-sdk/model-instance-client.svg) |
| [stream-client](./packages/stream-client) | Generic streams client | ![npm version](https://img.shields.io/npm/v/@ceramic-sdk/stream-client.svg) |

Other packages present in the `packages` folder are for internal use and may not be published to the npm registry.

Expand Down
10 changes: 5 additions & 5 deletions apps/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@
"@mantine/hooks": "^7.12.2",
"@tabler/icons-react": "^3.17.0",
"@tanstack/react-query": "^5.56.2",
"@tanstack/react-router": "^1.58.3",
"@tanstack/react-router": "^1.58.9",
"codeco": "^1.4.3",
"jotai": "^2.9.2",
"jotai": "^2.10.0",
"multiformats": "^13.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@ceramic-sdk/model-client": "workspace:^",
"@ceramic-sdk/model-instance-client": "workspace:^",
"@tanstack/router-devtools": "^1.58.3",
"@tanstack/router-devtools": "^1.58.9",
"@tanstack/router-plugin": "^1.58.4",
"@types/react": "^18.3.7",
"@types/react": "^18.3.9",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"postcss": "^8.4.47",
"postcss-preset-mantine": "^1.17.0",
"postcss-simple-vars": "^7.0.1",
"ts-essentials": "^10.0.2",
"typescript": "^5.6.2",
"vite": "^5.4.6"
"vite": "^5.4.8"
}
}
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/assertSignedEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ Assert the provided `input` is a SignedEvent
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/assertTimeEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ Assert the provided `input` is a TimeEvent
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/carFromString.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ Decode a CAR from a string, using the given base (defaults to base64)
## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:30](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L30)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/carToString.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ Encode a CAR into a string, using the given base (defaults to base64)
## Returns

`string`

## Defined in

[packages/events/src/encoding.ts:25](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L25)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/createSignedInitEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ Create a signed init event using the provided DID, data and header
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/decodeSignedEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ Decode the provided `input` as a SignedEvent. Throws if decoding fails.
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/decodeTimeEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ Decode the provided `input` as a TimeEvent. Throws if decoding fails.
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/encodeEventToCAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ Encode an unsigned event into a CAR using the provided codec
## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:72](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L72)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/eventFromCAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ Decode an event from a string using the provided codec for unsigned events
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/eventFromString.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ Decode an event from a string using the provided codec for unsigned events and t
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/eventToCAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ Encode an event into a CAR using the provided codec for unsigned events
## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:82](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L82)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/eventToContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ Decode a Ceramic event into a container using the provided verifier DID and payl
## 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)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/eventToString.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ Encode an event into a string using the provided codec for unsigned events and t
## Returns

`string`

## Defined in

[packages/events/src/encoding.ts:89](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L89)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/getSignedEventPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ Decode the payload of a signed event using the provided decoder
## Returns

`Promise`\<`Payload`\>

## Defined in

[packages/events/src/signing.ts:53](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/signing.ts#L53)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/signEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ Sign an event payload using the provided DID
## Returns

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

## Defined in

[packages/events/src/signing.ts:15](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/signing.ts#L15)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/signedEventToCAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ Encode a signed event into a CAR
## Returns

`CAR`

## Defined in

[packages/events/src/encoding.ts:39](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/encoding.ts#L39)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/functions/signedEventToContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,3 @@ Decode a signed Ceramic event into a container using the provided verifier DID a
## Returns

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

## Defined in

[packages/events/src/container.ts:37](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/container.ts#L37)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ Decode an unsigned Ceramic event into a container using the provided payload dec
## Returns

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

## Defined in

[packages/events/src/container.ts:29](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/container.ts#L29)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/type-aliases/EventContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ Container for a Ceramic event, providing additional metadata about the event
## Type Parameters

• **Payload**

## Defined in

[packages/events/src/container.ts:24](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/container.ts#L24)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/type-aliases/InitEventHeader.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@
# Type Alias: InitEventHeader

> **InitEventHeader**: `TypeOf`\<*typeof* [`InitEventHeader`](../variables/InitEventHeader.md)\>

## Defined in

[packages/events/src/codecs.ts:27](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L27)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/type-aliases/InitEventPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@
### header

> **header**: [`InitEventHeader`](InitEventHeader.md)

## Defined in

[packages/events/src/codecs.ts:41](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L41)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@
### controllers?

> `optional` **controllers**: [`DIDString`]

## Defined in

[packages/events/src/signing.ts:28](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/signing.ts#L28)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/type-aliases/SignedEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@
# Type Alias: SignedEvent

> **SignedEvent**: `TypeOf`\<*typeof* [`SignedEvent`](../variables/SignedEvent.md)\>

## Defined in

[packages/events/src/codecs.ts:54](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L54)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/type-aliases/SignedEventContainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,3 @@ Container for a signed Ceramic event
### verified

> **verified**: `VerifyJWSResult`

## Defined in

[packages/events/src/container.ts:9](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/container.ts#L9)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/type-aliases/TimeEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@
# Type Alias: TimeEvent

> **TimeEvent**: `TypeOf`\<*typeof* [`TimeEvent`](../variables/TimeEvent.md)\>

## Defined in

[packages/events/src/codecs.ts:77](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L77)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,3 @@ Container for an unsigned Ceramic event
### signed

> **signed**: `false`

## Defined in

[packages/events/src/container.ts:18](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/container.ts#L18)
8 changes: 2 additions & 6 deletions docs/@ceramic-sdk/events/variables/InitEventHeader.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Header structure of Init events

### context

> **context**: `OptionalCodec`\<`Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, `Uint8Array`\>\>
> **context**: `OptionalCodec`\<`Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, [`StreamID`](../../identifiers/classes/StreamID.md) \| `Uint8Array`\>\>

### controllers

> **controllers**: `TupleCodec`\<[`RefinementCodec`\<`TrivialCodec`\<`string`\>, `string` & `WithOpaque`\<`"DIDString"`\>\>]\>

### model

> **model**: `Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, `Uint8Array`\> = `streamIDAsBytes`
> **model**: `Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, [`StreamID`](../../identifiers/classes/StreamID.md) \| `Uint8Array`\> = `streamIDAsBytes`

### sep

Expand All @@ -35,7 +35,3 @@ Header structure of Init events
### unique

> **unique**: `OptionalCodec`\<`TrivialCodec`\<`Uint8Array`\>\>

## Defined in

[packages/events/src/codecs.ts:27](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L27)
8 changes: 2 additions & 6 deletions docs/@ceramic-sdk/events/variables/InitEventPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Payload structure of Init events

##### context

> **context**: `OptionalCodec`\<`Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, `Uint8Array`\>\>
> **context**: `OptionalCodec`\<`Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, [`StreamID`](../../identifiers/classes/StreamID.md) \| `Uint8Array`\>\>

##### controllers

> **controllers**: `TupleCodec`\<[`RefinementCodec`\<`TrivialCodec`\<`string`\>, `string` & `WithOpaque`\<`"DIDString"`\>\>]\>

##### model

> **model**: `Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, `Uint8Array`\> = `streamIDAsBytes`
> **model**: `Type`\<[`StreamID`](../../identifiers/classes/StreamID.md), `Uint8Array`, [`StreamID`](../../identifiers/classes/StreamID.md) \| `Uint8Array`\> = `streamIDAsBytes`

##### sep

Expand All @@ -45,7 +45,3 @@ Payload structure of Init events
##### unique

> **unique**: `OptionalCodec`\<`TrivialCodec`\<`Uint8Array`\>\>

## Defined in

[packages/events/src/codecs.ts:41](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L41)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/variables/SignedEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ Signed event structure - equivalent to DagJWSResult in `dids` package
### linkedBlock

> **linkedBlock**: `TrivialCodec`\<`Uint8Array`\> = `uint8array`

## Defined in

[packages/events/src/codecs.ts:54](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L54)
4 changes: 0 additions & 4 deletions docs/@ceramic-sdk/events/variables/TimeEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@
> `const` **TimeEvent**: `ExactCodec`\<`TypeCodec`\<`object`\>\>

Time event structure

## Defined in

[packages/events/src/codecs.ts:77](https://github.com/ceramicstudio/ceramic-sdk/blob/a220cbca7950f690af7f3d03a0023681bb9f5426/packages/events/src/codecs.ts#L77)
Loading