or run

tessl search
Log in

Version

Files

tile.json

task.mdevals/scenario-2/

Controlled Collection Loader

Build a utility that eagerly loads a database view while respecting caller-specified concurrency and reducer limits, returning a concise summary of the grouped results.

Capabilities

Eager load with concurrency cap

  • Given valid page, collection, and view identifiers plus a concurrency value, it hydrates the page and associated collection data without exceeding that concurrency cap for outbound requests. @test

Trim grouped reducers

  • When a grouped/board-style view contains more reducer groups than the provided limit, the loader truncates the groups to that limit while preserving their source order. @test

Return summarized counts

  • Returns group summaries containing each group key and item count along with the total hydrated block count after loading. @test

Implementation

@generates

API

export interface LoadOptions {
  pageId: string;
  collectionId: string;
  viewId: string;
  concurrency: number;
  reducerLimit: number;
}

export interface GroupSummary {
  key: string;
  total: number;
}

export interface LoadResult {
  blockCount: number;
  groups: GroupSummary[];
}

export async function loadCollectionSummary(options: LoadOptions): Promise<LoadResult>;

Dependencies { .dependencies }

notion-client { .dependency }

Client for retrieving page data and querying collection views with configurable concurrency and reducer constraints.