Skip to main content

v0.0.72

Summary

This release focuses on the Satellite and Sputnik.

Satellite

Two new admin endpoints handle asset certification for projects serving large numbers of assets (e.g. 25k+). Due to execution limits, certification can't happen in a single call at that scale — these endpoints make it possible to run it in chunks.

The storage now also accepts uploading assets of 0kb. This fixes an issue surfaced in the Console after upgrading to the latest JS dependencies, notably Vite v8.

The access key structs have also been renamed for consistency (existing "controller" endpoints remain unchanged for backward compatibility), and the SDK now exposes the built-in guards so developers building serverless functions in Rust can reuse them directly in their custom endpoints.

use junobuild_satellite::caller_is_admin;

fn my_function_guard() -> Result<(), String> {
    caller_is_admin()
}

#[ic_cdk::query(guard = "my_function_guard")]
fn hello_world() -> String {
    "Hello, admin!".to_string()
}

include_satellite!();

Sputnik

A few breaking changes land in the custom functions pipeline, but these should be largely transparent — they affect the auto-generated Rust code rather than the functions you write.

More importantly, this release ships two new features.

Guards are now supported in serverless functions:

import { defineQuery } from "@junobuild/functions";
import { callerIsAdmin } from "@junobuild/functions/sdk";

export const ping = defineQuery({
  guard: () => {
    throw new Error("No pong today");
  },
  handler: () => {
    console.log("Hello");
  }
});

export const hello = defineQuery({
  guard: callerIsAdmin,
  handler: () => {
    console.log("Hello, admin!");
  }
});

And HTTPS outcalls are now available from the functions SDK:

import { defineQuery, defineUpdate } from '@junobuild/functions';
import {
	httpRequest,
	HttpRequestResultSchema,
	TransformArgsSchema,
	type HttpRequestArgs
} from '@junobuild/functions/ic-cdk';
import { j } from '@junobuild/schema';

const DogSchema = j.strictObject({
	message: j.url(),
	status: j.string()
});

export const fetchRandomDog = defineUpdate({
	result: DogSchema,
	handler: async () => {
		const args: HttpRequestArgs = {
			url: 'https://dog.ceo/api/breeds/image/random',
			method: 'GET',
			headers: [],
			isReplicated: false,
			transform: 'trimHeaders'
		};

		const result = await httpRequest(args);

		const decoder = new TextDecoder();
		const body = decoder.decode(result.body);

		return JSON.parse(body);
	}
});

export const trimHeaders = defineQuery({
	hidden: true,
	args: TransformArgsSchema,
	result: HttpRequestResultSchema,
	handler: ({ response: { status, body } }) => ({
		status,
		body,
		headers: []
	})
});

Overview

ModuleVersionBreaking changes
Consolev0.4.2️ ️
Satellitev0.2.1
Sputnikv0.4.0⚠️️ ️
CratesVersionBreaking changes
junobuild-auth0.4.0⚠️
junobuild-cdn0.7.0⚠️
junobuild-collections0.5.0⚠️
junobuild-macros0.4.0⚠️
junobuild-satellite0.6.0⚠️
junobuild-shared0.8.0⚠️
junobuild-storage0.7.0⚠️️
junobuild-utils0.4.0⚠️️️️
LibraryVersionBreaking changes
@junobuild/adminv4.3.2
@junobuild/analyticsv0.2.14
@junobuild/authv4.1.1
@junobuild/cdnv2.4.2
@junobuild/cli-toolsv0.13.3
@junobuild/configv2.15.1
@junobuild/config-loaderv0.4.10
@junobuild/corev5.3.1
@junobuild/core-standalonev5.3.1
@junobuild/errorsv0.2.6
@junobuild/functionsv0.8.2
@junobuild/functions-toolsv0.6.2
@junobuild/ic-clientv8.1.2
@junobuild/schemav1.2.1
@junobuild/storagev2.4.1
@junobuild/utilsv1.0.2
CLIVersionBreaking changes
@junobuild/cliv0.14.4
PluginsVersionBreaking changes
@junobuild/vite-pluginv4.7.1
@junobuild/nextjs-pluginv4.7.1
DockerVersionBreaking changes
@junobuild/skylabv0.6.4
@junobuild/satellitev0.6.4
@junobuild/consolev0.6.4
GitHub ActionVersionBreaking changes
junobuild/juno-actionv0.6.10

Serverless Functions

You can upgrade your Rust Serverless Functions using the following crates:

[dependencies]
candid = "0.10.20"
ic-cdk = "0.19.0"
ic-cdk-macros = "0.19.0"
serde = "1.0.225"
serde_cbor = "0.11.2"
junobuild-satellite = "0.6.0"
junobuild-macros = "0.4.0"
junobuild-utils = "0.4.0"

What's Changed

Full Changelog: https://github.com/junobuild/juno/compare/v0.0.71...v0.0.72