API Reference
Instantiates a Standard SDK with your APIs of choice.
Parameters
The build
method takes one argument which may have either or both of apiSpecs
and sklEngineOptions
.
ApiSpecOptions
ApiSpecOptions
are the configurations you pass when building a Standard SDK for the APIs you want to work with. Different types of APIs have their own specific options. Currently we only support OpenAPI specs.
Return Value
A StandardSDK
instance with a namespace for each key in apiSpecs
. It may also have an skl
property if sklEngineOptions
was supplied.
Example Usage
In Typescript:
A namespace of a StandardSDK
instance corresponding to a set of supplied Api Spec Options. A namespace has a property for each operation in the supplied API specification. Each namespace also includes methods setDefaultConfiguration
and setDefaultOptions
to update the default configuration and options to all operations if the API.
Example Usage
In Typescript:
Sets the default configuration for all operations of in an API namespace. When using an API described via an OpenAPI spec, the configuration
parameter should be a OpenApiClientConfiguration
object as defined in @comake/openapi-operation-executor.
Example Usage
In Typescript:
Sets the default options for all operations of in an API namespace. When using an API described via an OpenAPI spec, the options
parameter should be an AxiosRequestConfig
object as defined in the axios API documentation.
Example Usage
In Typescript:
Executes the API operation called <operation>
according to the API specification corresponding to the namespace <namespace>
.
Parameters
All parameters are optional, however, when using Typescript and executing an OpenAPI operation with required parameters or request body, the args
parameter will be required.
⚠️ StandardSDK uses the @comake/openapi-operation-executor package to execute OpenAPI operations. This library currently supports OpenAPI security types oauth2
, apiKey
, and http
with schemes basic
or bearer
. See the OpenAPI Spec for reference and the @comake/openapi-operation-executor API docs for more information.
Return Value
Operations return Promises
which resolve to different values depending on the type of API. OpenAPI operations will resolve to an AxiosResponse
object.
Example Usage
In Typescript:
A SKL JS Engine instance which is instantiated when the sklEngineOptions
parameter is supplied when Standard SDK is built.
Example Usage
In Typescript:
The Verb execution interface of the SKL JS Engine instance accessed through Standard SDK.
Example Usage
In Typescript:
Executes the verb called <verb>
according to its Schema and related Mappings in the Schemas provided to the SKL JS Engine instance via the sklEngineOptions
parameter when building Standard SDK.
Parameters
Return Value
Verbs executed using SKL JS Engine return Promises
which resolve to an AxiosResponse
object.
Example Usage
In Typescript:
Last updated