Skip to main content
The slideshowLoad procedure reads slideshow data from the filesystem and returns an array of validated Slideshow objects along with provenance metadata describing where each slideshow came from.

Request

POST /rpc/slideshowLoad

Input

datasetId
string
The dataset to load. When omitted, the server loads the default dataset. When provided, it loads the named dataset from the filesystem.A dataset corresponds to a directory or file grouping on disk. Pass "default" to load the default dataset, or any other string identifier for a named dataset.

Response

slideshows
Slideshow[]
required
An array of fully validated slideshow objects. See the Slideshow type reference for the complete shape.
provenance
object
required
A map of slideshow index (as a string key) to provenance metadata. Each entry describes where the corresponding slideshow was loaded from.

Examples

import { createORPCClient } from "@orpc/client";
import { RPCLink } from "@orpc/client/fetch";
import type { AppRouter } from "@slides/api/routers/index";

const client = createORPCClient<AppRouter>(
  new RPCLink({ url: "http://localhost:3000/rpc" })
);

// Load the default dataset
const defaultResult = await client.slideshowLoad({});
console.log(defaultResult.slideshows.length); // number of slideshows

// Load a named dataset
const namedResult = await client.slideshowLoad({
  datasetId: "q4-roadmap",
});

// Inspect provenance for the first slideshow
const firstProvenance = namedResult.provenance["0"];
console.log(firstProvenance.sourceId);  // e.g. "q4-roadmap" (dataset ID)
console.log(firstProvenance.writable);  // true if saveable

Example response

{
  "slideshows": [
    {
      "id": "sw_01",
      "title": "Q4 Roadmap",
      "concepts": {
        "infra": { "label": "Infrastructure", "color": "blue" },
        "product": { "label": "Product", "color": "purple" }
      },
      "slides": [
        {
          "id": "sl_01",
          "order": 1,
          "concept": "infra",
          "blocks": [
            {
              "explainer": {
                "content": "We are migrating to a multi-region deployment in Q4."
              }
            }
          ]
        }
      ]
    }
  ],
  "provenance": {
    "0": {
      "sourceType": "fs",
      "sourceId": "q4-roadmap",
      "writable": true,
      "targetId": "q4-roadmap"
    }
  }
}
Provenance is computed at load time and is never stored in the JSON files on disk. It is only present in the API response.

Build docs developers (and LLMs) love