Skip to content

refactor(schemas): consolidate inline pagination objects into PaginationSchema #12

@shwetank-dev

Description

@shwetank-dev

PaginationSchema exists in packages/schemas/src/api-responses.ts as a reusable shape, but several response schemas inline the same object instead of referencing it.

Duplications

PaginationSchema is defined at api-responses.ts:28:

export const PaginationSchema = z.object({
  limit: z.number(),
  offset: z.number(),
  has_more: z.boolean(),
});

It is used correctly at api-responses.ts:403 (MyPackagesResponseSchema) and api-responses.ts:422 (UnclaimedPackagesResponseSchema), but inlined in:

  • api-responses.ts:223BundleSearchResponseSchema inlines pagination: z.object({ limit, offset, has_more })
  • skill.ts:152SkillSearchResponseSchema inlines pagination: z.object({ limit, offset, has_more })

Suggested fix

Replace the two inline objects with PaginationSchema. For skill.ts, import it from api-responses.js.

Notes

Pure refactor — no behaviour change, no breaking change to inferred TypeScript types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions