From b1a6e53e55fb9fd1ab634709bcd29d500efc3784 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 16 Mar 2026 08:18:49 +0100 Subject: [PATCH 1/2] docs: schema types Signed-off-by: David Dal Busco --- docs/reference/functions/typescript/schema.md | 43 +++++++++++++++++++ sidebars.ts | 1 + 2 files changed, 44 insertions(+) create mode 100644 docs/reference/functions/typescript/schema.md diff --git a/docs/reference/functions/typescript/schema.md b/docs/reference/functions/typescript/schema.md new file mode 100644 index 00000000..b3f65b89 --- /dev/null +++ b/docs/reference/functions/typescript/schema.md @@ -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. + +::: diff --git a/sidebars.ts b/sidebars.ts index f497cb77..6dfb4336 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -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", From a2078d715f535e76543e2f3ddc8c197707e9f7e5 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 07:20:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 54 +++++++++++++++++++++++++++++++++-- .llms-snapshots/llms.txt | 1 + 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index e8901fff..739f2dfe 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -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 @@ -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 @@ -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) @@ -12237,6 +12241,10 @@ pub fn encode_doc_data_to_string( data: &T,) -> Result