or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

compatibility-management.mddatastore-operations.mdgarbage-collection.mdhandle-management.mdindex.mdruntime-factories.mdstorage-utilities.mdsummary-management.mdtelemetry-utilities.md
tile.json

datastore-operations.mddocs/

Data Store Operations ⚠️ Legacy API

Request parsing, response creation, and error handling utilities for data store interactions.

⚠️ Important: These APIs are only available through the legacy import path (@fluidframework/runtime-utils/legacy) and are marked as legacy/beta. They may change or be removed in future versions.

Legacy/Beta API

Request Parsing (Legacy)

The RequestParser class is available only through the legacy API import.

/**
 * Takes an IRequest and provides parsing and sub request creation capabilities
 * Available via: @fluidframework/runtime-utils/legacy
 */
class RequestParser implements IRequest {
  readonly url: string;
  readonly headers?: IRequestHeader;
  readonly query: string;
  readonly pathParts: readonly string[];
  
  static create(request: Readonly<IRequest>): RequestParser;
  static getPathParts(url: string): readonly string[];
  isLeaf(elements: number): boolean;
  createSubRequest(startingPathIndex: number): IRequest;
  
  protected constructor(request: Readonly<IRequest>);
}

Response Creation (Legacy)

Only the create404Response function is available in the legacy API.

/**
 * Creates a 404 "not found" response for the given request
 * Available via: @fluidframework/runtime-utils/legacy
 */
const create404Response: (request: IRequest) => IResponse;

Internal APIs ❌

Note: The following APIs are mentioned in the source code but are not exported and not available for external use:

  • createResponseError - Internal error response creation
  • exceptionToResponse - Internal error conversion
  • responseToException - Internal response to error conversion
  • generateHandleContextPath - Internal path generation utility

These APIs are for internal framework use only and should not be relied upon by external applications.

Legacy API Usage Example:

import { 
  RequestParser, 
  create404Response
} from "@fluidframework/runtime-utils/legacy";

// Request parsing (Legacy API)
const parser = RequestParser.create({ 
  url: "/datastore/component/action?param=value" 
});

console.log(parser.pathParts); // ["datastore", "component", "action"]
console.log(parser.query); // "param=value"

if (parser.isLeaf(3)) {
  // This is a terminal request
  processLeafRequest(parser);
} else {
  // Create sub-request for nested component
  const subRequest = parser.createSubRequest(1);
  forwardToComponent(subRequest);
}

// Response creation (Legacy API)
const notFoundResponse = create404Response(parser);

Migration Guide

If you're using data store operation utilities:

  1. For request parsing: Use RequestParser from the legacy import, but be aware it may change
  2. For response creation: Only create404Response is available, other response utilities are internal
  3. For error handling: These utilities are not exported - consider using standard error handling patterns
  4. For context path generation: This utility is not exported - use higher-level Fluid Framework APIs

The limited API surface suggests that most data store operations should be handled through other Fluid Framework packages rather than directly using runtime-utils.

⚠️ Deprecation Warning: These legacy APIs may be removed in future versions. Consider migrating to alternative Fluid Framework APIs when possible.