Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/vault/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,18 @@ export class Vault {
options?: PaginationOptions | undefined,
): Promise<List<ObjectDigest>> {
const url = new URL('/vault/v1/kv', this.workos.baseURL);
if (options?.before) {
url.searchParams.set('before', options.before);
}
if (options?.after) {
url.searchParams.set('after', options.after);
}
if (options?.limit) {
url.searchParams.set('limit', options.limit.toString());
}
if (options?.order) {
url.searchParams.set('order', options.order);
}
Comment on lines +88 to +99
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test coverage for new parameters

The existing listObjects test suite only covers the no-options case. The newly forwarded before and order parameters have no corresponding test cases to verify they are correctly appended as query parameters. Consider adding tests similar to:

it('forwards before and order query parameters', async () => {
  fetchOnce({ data: [], list_metadata: { after: null, before: null } });
  await workos.vault.listObjects({ before: 'cursor123', order: 'asc' });
  expect(fetchURL()).toContain('before=cursor123');
  expect(fetchURL()).toContain('order=asc');
});


const { data } = await this.workos.get<ListResponse<ObjectDigestResponse>>(
url.toString(),
Expand Down
Loading