UNPKG

api

Version:

Magical SDK generation from an OpenAPI definition 🪄

31 lines • 1.38 kB
import type Oas from 'oas'; import type { Operation } from 'oas/operation'; /** * Return a list of suggested and "good first issue" types of endpoints that we can build a post-SDK * code generation code snippet around to demo the power of `api`. * * The criteria for a suggested endpoint are the following: * - GET request * - Has no required query or body parameters * - Endpoint has not been deprecated * * @param oas */ export declare function getSuggestedOperation(oas: Oas): false | Operation; /** * Generate an example code snippet for a given (suggested) operation. We'll show this to users * post-codegeneration so they can see how to use the SDK we created for them. * * We're intentionally using `httpsnippet-client-api` and not `@readme/oas-to-snippet` here, * which would handle HAR and snippet generation, because don't need the entire `oas-to-snippet` * and `@readme/httpsnippet` libraries for what we're doing here. * * All we want to do is generate a very simple code example for `api` snippets and as we're * controlling which kinds of endpoints we're generating these for the HAR dataset we're working * with is a mostly fully known object. * */ export declare function buildCodeSnippetForOperation(oas: Oas, operation: Operation, opts: { identifier: string; }): Promise<string | false>; //# sourceMappingURL=suggestedOperations.d.ts.map