registry API client
This commit is contained in:
parent
9d7510578b
commit
a3f835be0a
3 changed files with 14 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@continuedev/config-yaml",
|
||||
"version": "1.0.52",
|
||||
"version": "1.0.57",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ export * from "./load/getBlockType.js";
|
|||
export * from "./load/merge.js";
|
||||
export * from "./load/proxySecretResolution.js";
|
||||
export * from "./load/unroll.js";
|
||||
export * from "./registryClient.js";
|
||||
export * from "./schemas/data/index.js";
|
||||
export * from "./schemas/index.js";
|
||||
export * from "./schemas/models.js";
|
||||
|
|
|
|||
12
packages/config-yaml/src/registryClient.ts
Normal file
12
packages/config-yaml/src/registryClient.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { Registry } from "./interfaces/index.js";
|
||||
import { FullSlug } from "./interfaces/slugs.js";
|
||||
|
||||
export class RegistryClient implements Registry {
|
||||
async getContent(fullSlug: FullSlug): Promise<string> {
|
||||
const response = await fetch(
|
||||
`https://api.continue.dev/registry/v1/${fullSlug.ownerSlug}/${fullSlug.packageSlug}/${fullSlug.versionSlug}`,
|
||||
);
|
||||
const data = await response.json();
|
||||
return data.content;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue