Skip to content

Latest commit

 

History

History
714 lines (442 loc) · 8.18 KB

reference.md

File metadata and controls

714 lines (442 loc) · 8.18 KB

Snippets

fern.snippets.get({ ...params }) -> Fern.Snippet[]

📝 Description

Get snippet by endpoint method and path

🔌 Usage

await fern.snippets.get({
    endpoint: {
        method: Fern.HttpMethod.Get,
        path: "/v1/search",
    },
});

⚙️ Parameters

request: Fern.GetSnippetRequest

requestOptions: Snippets.RequestOptions

fern.snippets.load({ ...params }) -> Fern.SnippetsPage

🔌 Usage

await fern.snippets.load({
    page: 1,
    orgId: "vellum",
    apiId: "vellum-ai",
    sdks: [
        {
            type: "python",
            package: "vellum-ai",
        },
    ],
});

⚙️ Parameters

request: Fern.ListSnippetsRequest

requestOptions: Snippets.RequestOptions

Templates

fern.templates.register({ ...params }) -> void

📝 Description

Store endpoint snippet for a particular SDK.

🔌 Usage

await fern.templates.register({
    orgId: "string",
    apiId: "string",
    apiDefinitionId: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
    snippet: {
        sdk: {
            type: "typescript",
            package: "string",
            version: "string",
        },
        endpointId: {
            path: "string",
            method: Fern.HttpMethod.Get,
            identifierOverride: "string",
        },
        snippetTemplate: {
            type: "v1",
            clientInstantiation: "string",
            functionInvocation: {
                type: "generic",
                imports: ["string"],
                isOptional: true,
                templateString: "string",
                templateInputs: [
                    {
                        type: "template",
                        value: {
                            key: "value",
                        },
                    },
                ],
                inputDelimiter: "string",
            },
        },
        additionalTemplates: {
            string: {
                type: "v1",
                clientInstantiation: "string",
                functionInvocation: {
                    type: "generic",
                    imports: ["string"],
                    isOptional: true,
                    templateString: "string",
                    templateInputs: [
                        {
                            type: "template",
                            value: {
                                key: "value",
                            },
                        },
                    ],
                    inputDelimiter: "string",
                },
            },
        },
    },
});

⚙️ Parameters

request: Fern.RegisterSnippetTemplateRequest

requestOptions: Templates.RequestOptions

fern.templates.registerBatch({ ...params }) -> void

📝 Description

Store endpoint snippets for a particular SDK.

🔌 Usage

await fern.templates.registerBatch({
    orgId: "string",
    apiId: "string",
    apiDefinitionId: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
    snippets: [
        {
            sdk: {
                type: "typescript",
                package: "string",
                version: "string",
            },
            endpointId: {
                path: "string",
                method: Fern.HttpMethod.Get,
                identifierOverride: "string",
            },
            snippetTemplate: {
                type: "v1",
                clientInstantiation: "string",
                functionInvocation: {
                    type: "generic",
                    imports: ["string"],
                    isOptional: true,
                    templateString: "string",
                    templateInputs: [
                        {
                            type: "template",
                            value: {
                                key: "value",
                            },
                        },
                    ],
                    inputDelimiter: "string",
                },
            },
            additionalTemplates: {
                string: {
                    type: "v1",
                    clientInstantiation: "string",
                    functionInvocation: {
                        type: "generic",
                        imports: ["string"],
                        isOptional: true,
                        templateString: "string",
                        templateInputs: [
                            {
                                type: "template",
                                value: {
                                    key: "value",
                                },
                            },
                        ],
                        inputDelimiter: "string",
                    },
                },
            },
        },
    ],
});

⚙️ Parameters

request: Fern.RegisterSnippetTemplateBatchRequest

requestOptions: Templates.RequestOptions

fern.templates.get({ ...params }) -> Fern.EndpointSnippetTemplate

📝 Description

Get the endpoint's snippet template for a particular SDK.

🔌 Usage

await fern.templates.get({
    orgId: "string",
    apiId: "string",
    sdk: {
        type: "typescript",
        package: "string",
        version: "string",
    },
    endpointId: {
        path: "string",
        method: Fern.HttpMethod.Get,
        identifierOverride: "string",
    },
});

⚙️ Parameters

request: Fern.GetSnippetTemplate

requestOptions: Templates.RequestOptions

Tokens

fern.tokens.generate({ ...params }) -> Fern.GenerateTokenResponse

📝 Description

Generate a token

🔌 Usage

await fern.tokens.generate({
    orgId: "string",
    scope: "string",
});

⚙️ Parameters

request: Fern.GenerateTokenRequest

requestOptions: Tokens.RequestOptions

fern.tokens.revoke({ ...params }) -> void

📝 Description

Revoke a token

🔌 Usage

await fern.tokens.revoke({
    orgId: "string",
    tokenId: "string",
});

⚙️ Parameters

request: Fern.RevokeTokenRequest

requestOptions: Tokens.RequestOptions