CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-fluidframework--runtime-utils

Collection of utility functions for Fluid Runtime operations including handle management, summary operations, and request parsing.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

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.

docs

compatibility-management.md

datastore-operations.md

garbage-collection.md

handle-management.md

index.md

runtime-factories.md

storage-utilities.md

summary-management.md

telemetry-utilities.md

tile.json