import { expect } from "@playwright/test";
import { apiRequest } from "./api.js";
async function createApiKeyFixture(request, token, name) {
  const response = await apiRequest(request, "POST", "/api/api_keys/keys", {
    token,
    data: { name }
  });
  expect(response.ok(), `Failed to create API key fixture: ${response.status()}`).toBeTruthy();
  const body = await response.json();
  expect(typeof body.id === "string" && body.id.length > 0).toBeTruthy();
  return { id: body.id, secret: body.secret ?? "" };
}
export {
  createApiKeyFixture
};
//# sourceMappingURL=apiKeysFixtures.js.map
