Skip to content
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
54 changes: 52 additions & 2 deletions .llms-snapshots/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11325,7 +11325,7 @@ API reference for writing serverless functions in Rust or TypeScript.

[## 🗃️ TypeScript

5 items](/docs/reference/functions/typescript.md)
6 items](/docs/reference/functions/typescript.md)

# Plugins

Expand Down Expand Up @@ -11729,7 +11729,7 @@ API reference for writing serverless functions in Rust or TypeScript.

[## 🗃️ TypeScript

5 items](/docs/reference/functions/typescript.md)
6 items](/docs/reference/functions/typescript.md)

# Rust

Expand All @@ -11755,6 +11755,10 @@ This page lists the crate versions for each Juno release, to help you upgrade yo

API reference for writing serverless functions with TypeScript.

[## 📄️ Schema Types

Juno provides a type system built on top of Zod, extended with a few additional types you'll need when working with serverless functions.](/docs/reference/functions/typescript/schema.md)

[## 📄️ SDK

The SDK is provided by the @junobuild/functions library.](/docs/reference/functions/typescript/sdk.md)
Expand Down Expand Up @@ -12237,6 +12241,10 @@ pub fn encode_doc_data_to_string<T: Serialize>( data: &T,) -> Result<String,

API reference for writing serverless functions with TypeScript.

[## 📄️ Schema Types

Juno provides a type system built on top of Zod, extended with a few additional types you'll need when working with serverless functions.](/docs/reference/functions/typescript/schema.md)

[## 📄️ SDK

The SDK is provided by the @junobuild/functions library.](/docs/reference/functions/typescript/sdk.md)
Expand Down Expand Up @@ -12698,6 +12706,48 @@ Logging is fully supported. Objects are stringified and logs are routed to the I
console.log("Hello from the Satellite");console.info("Hello", { type: "info", msg: "Something happened" });
```

# Schema Types

Juno provides a type system built on top of [Zod](https://zod.dev/), extended with a few additional types you'll need when working with serverless functions.

All types are available through `j`.

```
import { j } from "@junobuild/schema";
```

---

## Juno Types

The following are specific types provided by Juno:

### j.principal()

Validates and represents an Internet Computer Principal.

```
j.principal();
```

### j.uint8array()

Validates and represents a `Uint8Array`.

```
j.uint8array();
```

---

## Zod Types

All Zod types are available through `j`. Refer to the [Zod documentation](https://zod.dev/) for the full API reference.

**Note:**

`union` is not supported. Use `discriminatedUnion` instead.

# SDK

The following functions are provided to help you work with document and asset data inside your Satellite. They are part of the tools available when writing serverless functions in TypeScript and support common tasks such as interacting with the datastore, storage, and custom hook logic.
Expand Down
1 change: 1 addition & 0 deletions .llms-snapshots/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Juno is your self-contained serverless platform for building full-stack web apps
- [Canisters](https://juno.build/docs/reference/functions/typescript/canisters.md): The following functions can be used to interact with well-known Internet Computer canisters from your serverless functions.
- [IC-CDK](https://juno.build/docs/reference/functions/typescript/ic-cdk.md): Juno exposes a growing set of these features for TypeScript, allowing you to build serverless functions that interact with the IC using a familiar developer experience.
- [Node.js](https://juno.build/docs/reference/functions/typescript/node.md): The TypeScript runtime used in Juno does not provide full Node.js support. Polyfills are added iteratively to keep the environment stable and predictable.
- [Schema Types](https://juno.build/docs/reference/functions/typescript/schema.md): Juno provides a type system built on top of Zod, extended with a few additional types you'll need when working with serverless functions.
- [SDK](https://juno.build/docs/reference/functions/typescript/sdk.md): The SDK is provided by the @junobuild/functions library.
- [Utils](https://juno.build/docs/reference/functions/typescript/utils.md): All utilities on this page are provided by the @junobuild/functions library.

Expand Down
43 changes: 43 additions & 0 deletions docs/reference/functions/typescript/schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Schema Types

Juno provides a type system built on top of [Zod](https://zod.dev/), extended with a few additional types you'll need when working with serverless functions.

All types are available through `j`.

```typescript
import { j } from "@junobuild/schema";
```

---

## Juno Types

The following are specific types provided by Juno:

### j.principal()

Validates and represents an Internet Computer Principal.

```typescript
j.principal();
```

### j.uint8array()

Validates and represents a `Uint8Array`.

```typescript
j.uint8array();
```

---

## Zod Types

All Zod types are available through `j`. Refer to the [Zod documentation](https://zod.dev/) for the full API reference.

:::note

`union` is not supported. Use `discriminatedUnion` instead.

:::
1 change: 1 addition & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ const sidebars: SidebarsConfig = {
"API reference for writing serverless functions with TypeScript."
},
items: [
"reference/functions/typescript/schema",
"reference/functions/typescript/sdk",
"reference/functions/typescript/utils",
"reference/functions/typescript/ic-cdk",
Expand Down