Skip to content

[Fleet Execution] Export REST pagination response interfaces with nextPageToken #278

@davideast

Description

@davideast

Goal Reference

This issue was generated from .fleet/goals/api-sync.md. The worker agent should read this file for full context including verification commands, constraints, and structural guidance.

Objective

Update the SDK type definitions to accurately reflect the API Discovery Document's pagination schema. The SDK currently misses the nextPageToken string property from ListSessionsResponse, ListSourcesResponse, and ListActivitiesResponse.

Code-Level Diagnosis

Code path: packages/core/src/types.ts
Mechanism: The SDK does not currently expose the explicit raw response interfaces for listing collections (ListSessionsResponse, ListSourcesResponse, ListActivitiesResponse) representing the API's pagination responses.
Root cause: Missing explicit interface definitions for paginated REST API responses.

Current Implementation

// These types do not currently exist in packages/core/src/types.ts
// The SDK uses internal or inline types in some places, missing the standardized interfaces.

Proposed Implementation

Files to modify:

  1. packages/core/src/types.ts: Add ListSessionsResponse, ListSourcesResponse, and ListActivitiesResponse interfaces including nextPageToken?: string.

Integration (Before -> After)

--- packages/core/src/types.ts
+++ packages/core/src/types.ts
@@ -1016,6 +1016,21 @@
   };
 }
 
+export interface ListSessionsResponse {
+  sessions: SessionResource[];
+  nextPageToken?: string;
+}
+
+export interface ListSourcesResponse {
+  sources: Source[];
+  nextPageToken?: string;
+}
+
+export interface ListActivitiesResponse {
+  activities: Activity[];
+  nextPageToken?: string;
+}
+
 // -----------------------------------------------------------------------------
 // SessionClient (Interactive Paradigm)

Test Scenarios

  1. TypeScript Verification: Ensure that adding these interfaces does not break existing code and satisfies the TypeScript compiler against API responses.

Target Files

  • packages/core/src/types.ts

Boundary Rules

Restrict your modifications exclusively to the files listed in the Target Files section. Ensure your source changes are entirely backward-compatible if unowned tests outside your boundary fail. Retain all existing file names and locations outside your explicitly declared target list.


Fleet Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions