Skip to content

Commit b625d80

Browse files
authored
feat: exposing types for creating API keys to plugins (#1225)
## 🧰 Changes Exposes a new `APIKeyRepresentation` type for use in plugins.
1 parent 7dd6cea commit b625d80

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/lib/types/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ type guidesRequestBodySchema =
1616
type projectSchema =
1717
(typeof readmeAPIv2Oas)['paths']['/projects/me']['get']['responses']['200']['content']['application/json']['schema'];
1818

19+
type apiKeySchema =
20+
(typeof readmeAPIv2Oas)['paths']['/projects/{subdomain}/apikeys/{api_key_id}']['get']['responses']['200']['content']['application/json']['schema'];
21+
1922
/**
2023
* Derived from our API documentation, this is the schema for the `guides` object
2124
* as we send it to the ReadMe API.
@@ -29,3 +32,5 @@ export type GuidesRequestRepresentation = FromSchema<
2932
>;
3033

3134
export type ProjectRepresentation = FromSchema<projectSchema, { keepDefaultedPropertiesOptional: true }>;
35+
36+
export type APIKeyRepresentation = FromSchema<apiKeySchema, { keepDefaultedPropertiesOptional: true }>;

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type { GuidesRequestRepresentation, ProjectRepresentation } from './lib/types/index.js';
1+
export type { APIKeyRepresentation, GuidesRequestRepresentation, ProjectRepresentation } from './lib/types/index.js';
22
export type { PageMetadata } from './lib/readPage.js';
33
export type { PluginHooks } from './lib/hooks/exported.js';
44
export type { ResponseBody } from './lib/readmeAPIFetch.js';

0 commit comments

Comments
 (0)