From c05ad98c4959a1a2fa1f18039e5b85c969053966 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Mon, 7 Jul 2025 17:22:09 +0200 Subject: [PATCH 1/2] docs: describe full path Signed-off-by: David Dal Busco --- docs/build/storage/development.mdx | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/build/storage/development.mdx b/docs/build/storage/development.mdx index 0efdd6dc..c4b7442d 100644 --- a/docs/build/storage/development.mdx +++ b/docs/build/storage/development.mdx @@ -30,14 +30,12 @@ The `data` parameter is the file you want to upload. This is a `Blob`, typically The `uploadFile` function provides various options, including: - `filename`: By default, Juno uses the file's filename. You can overwrite this and provide a custom filename. Example: `myimage.jpg`. -- `fullPath`: Juno will automatically compute the `fullPath`, which is the **unique** path that is used to make the asset available on the internet. The `fullPath` is the filename prefixed with `/` plus the related collection key. Example: `/images/myimage.jpg`. +- `fullPath`: The unique path where the asset will be stored and accessed. 👉 See [What is a `fullPath`?](#what-is-a-fullpath) for details and examples. - `headers`: The headers can affect how the browser handles the asset. If no headers are provided Juno will infer the `Content-Type` from the file type. - `encoding`: The type of encoding for the file. For example, `identity` (raw) or `gzip`. :::note -- Uploading a file with the same name as an existing file will overwrite the previous file (assuming the uploader has write access to the previous file). - - URL encoding is currently not supported on the Internet Computer. Therefore, it's important to keep in mind that your `filename` should not be encoded. That is why the library decodes the `filename` automatically. ::: @@ -50,6 +48,32 @@ The function returns the uploaded asset key as an object with the following fiel - `name`: The name of the asset (typically the filename). Example: `myimage.jpg`. - `downloadUrl`: The URL to access the asset on the web or to download it. This URL can be used in a browser or embedded directly in HTML elements like `` or ``. +#### What is a `fullPath`? + +The `fullPath` is the **unique path** of an asset within your Satellite's storage. It determines the asset’s public-facing URL and is used throughout the SDK to identify, retrieve, list, or delete the asset. + +It always starts with a **slash**, and follows the structure: + +``` +/collection/filename +``` + +For example, uploading a file to the `"images"` collection with the filename `"logo.png"` results in: + +``` +/images/logo.png +``` + +#### Key points + +- If the asset is **not part of the frontend**, the `fullPath` always includes the **collection** name. +- By default, the `fullPath` is automatically derived from the uploaded file's name (e.g. `/images/photo.jpg`). +- You can override the path using a custom filename. These are both valid: +- `/collection/hello.jpg` +- `/collection/my/sub/path/hello.jpg` +- The `fullPath` is effectively the **asset key** used in Juno Storage. +- ⚠️ Uploading a file to an existing `fullPath` will **overwrite** the existing file. + --- ## Upload blob From e354646e521740fd8e00ac71770f6949bf2a9f29 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:36:30 +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 | 41 +++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index ba7dd15f..872f26c6 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -1918,16 +1918,13 @@ The `data` parameter is the file you want to upload. This is a `Blob`, typically The `uploadFile` function provides various options, including: * `filename`: By default, Juno uses the file's filename. You can overwrite this and provide a custom filename. Example: `myimage.jpg`. -* `fullPath`: Juno will automatically compute the `fullPath`, which is the **unique** path that is used to make the asset available on the internet. The `fullPath` is the filename prefixed with `/` plus the related collection key. Example: `/images/myimage.jpg`. +* `fullPath`: The unique path where the asset will be stored and accessed. 👉 See ([What is a `fullPath`?](#what-is-a-fullpath)) for details and examples. * `headers`: The headers can affect how the browser handles the asset. If no headers are provided Juno will infer the `Content-Type` from the file type. * `encoding`: The type of encoding for the file. For example, `identity` (raw) or `gzip`. **Note:** -* Uploading a file with the same name as an existing file will overwrite the previous file (assuming the uploader has write access to the previous file). - * URL encoding is currently not supported on the Internet Computer. Therefore, it's important to keep in mind that your `filename` should not be encoded. That is why the library decodes the `filename` automatically. - #### Returns @@ -1937,6 +1934,32 @@ The function returns the uploaded asset key as an object with the following fiel * `name`: The name of the asset (typically the filename). Example: `myimage.jpg`. * `downloadUrl`: The URL to access the asset on the web or to download it. This URL can be used in a browser or embedded directly in HTML elements like `` or ``. +#### What is a `fullPath`? + +The `fullPath` is the **unique path** of an asset within your Satellite's storage. It determines the asset’s public-facing URL and is used throughout the SDK to identify, retrieve, list, or delete the asset. + +It always starts with a **slash**, and follows the structure: + +``` +/collection/filename +``` + +For example, uploading a file to the `"images"` collection with the filename `"logo.png"` results in: + +``` +/images/logo.png +``` + +#### Key points + +* If the asset is **not part of the frontend**, the `fullPath` always includes the **collection** name. +* By default, the `fullPath` is automatically derived from the uploaded file's name (e.g. `/images/photo.jpg`). +* You can override the path using a custom filename. These are both valid: +* `/collection/hello.jpg` +* `/collection/my/sub/path/hello.jpg` +* The `fullPath` is effectively the **asset key** used in Juno Storage. +* ⚠️ Uploading a file to an existing `fullPath` will **overwrite** the existing file. + --- ## Upload blob @@ -3241,6 +3264,16 @@ It’s a great reference for more advanced setups and multi-collection coordinat * [Configuration Reference](/docs/reference/configuration.md) * [Datastore Collections](/docs/build/datastore/collections.md) +--- + +## Crate Docs + +These crates are used to build and extend serverless functions in Rust with Juno: + +* [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration. +* [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions (e.g., `#[assert_set_doc]`, `#[on_delete_doc]`). +* [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling. + # Using Juno with AI If you're using AI to build with Juno, you can use our `llms.txt` files to help AI tools better understand the platform.