StrapiAdapter
Upgather SDK / StrapiAdapter
Class: StrapiAdapter
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
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
Methods
createClient()
createClient(
schema,logger?):ApiClient
Creates a configured ApiClient for Strapi.
Parameters
schema
The schema (not used in this static implementation).
logger?
Optional logger instance to inject into the client.
Returns
The configured ApiClient.
Implementation of
getSchema()
getSchema():
Schema
Retrieves a static schema.
Returns
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.