or run

tessl search
Log in

Version

Files

tile.json

task.mdevals/scenario-1/

Space-Aware Task Queries

Build a helper that retrieves task summaries from a database while honoring workspace scoping and simple filters.

Capabilities

Space-scoped queries

  • When a space ID is provided, query only that workspace by sending the x-notion-space-id header; results from other spaces must not appear. @test
  • When no space ID is provided, query the default accessible space without sending the workspace header. @test

Filtering and search

  • Accepts an optional status filter and free-text search; returned tasks must satisfy both when present. @test

Limits and ordering

  • Supports limit to cap the number of returned tasks, ordered by most recently updated first. @test

Task summary mapping

  • Maps each result to { id, title, status, spaceId, lastEdited }. @test

Implementation

@generates

API

export interface TaskQueryOptions {
  spaceId?: string;
  status?: string;
  search?: string;
  limit?: number;
}

export interface TaskSummary {
  id: string;
  title: string;
  status: string;
  spaceId: string;
  lastEdited: string;
}

export async function querySpaceTasks(
  collectionId: string,
  viewId: string,
  options?: TaskQueryOptions
): Promise<TaskSummary[]>;

Dependencies { .dependencies }

notion-client { .dependency }

Provides collection querying with optional space-aware headers.