Skip to main content

StrapiAdapter

Upgather SDK


Upgather SDK / StrapiAdapter

Class: StrapiAdapter

Defined in: lib/adapters/StrapiAdapter.ts:18

Adapts Strapi-specific APIs to the generic ApiClient.

Remarks

This adapter does not dynamically fetch content types since a prebuild script already generates the static TS interfaces for Strapi. It simply creates an ApiClient configured for Strapi.

Implements

Constructors

new StrapiAdapter()

new StrapiAdapter(apiUrl, token?, logLevel?): StrapiAdapter

Defined in: lib/adapters/StrapiAdapter.ts:30

Creates an instance of StrapiAdapter.

Parameters

apiUrl

string

The base URL for the Strapi API.

token?

string

Optional authentication token.

logLevel?

Optional logging level (default: 'none')

"none" | "basic" | "detailed"

Returns

StrapiAdapter

Methods

createClient()

createClient(schema, logger?): ApiClient

Defined in: lib/adapters/StrapiAdapter.ts:61

Creates a configured ApiClient for Strapi.

Parameters

schema

Schema

The schema (not used in this static implementation).

logger?

LoggerInterface

Optional logger instance to inject into the client.

Returns

ApiClient

The configured ApiClient.

Implementation of

BackendAdapter.createClient


getSchema()

getSchema(): Schema

Defined in: lib/adapters/StrapiAdapter.ts:50

Retrieves a static schema.

Returns

Schema

A Schema instance.

Remarks

Since the static type definitions are generated at build time, this implementation returns a new Schema instance. The actual type safety comes from the generated TypeScript definitions.

Implementation of

BackendAdapter.getSchema