Service Provider
A Service Provider Business Object publishes an HTTP API of the app: each of its methods answers requests to one path, in one or more versions. Lowgile calls these methods when a request arrives. In code, a Service Provider is reached as This.<ProviderName>.
Availability: Server
How to reach it
Section titled “How to reach it”This.<ProviderName>Service Providers are not grouped under a $ namespace: they are reached directly as This.<ProviderName>. They exist only in server-side code; client-side and shared code cannot reference them.
Note
The typings and the runtime object do not match, so the declared methods below cannot be called as typed.
- Declared:
This.<ProviderName>is a class with one instance method per Service Provider method, without the request and response, and without versions. There is no way to get an instance of it. - Runtime:
This.<ProviderName>is an object with one entry per version,This.<ProviderName>.<version>. A version name that does not start with a lowercase letter or_gets av_prefix, so version1becomesv_1. Each version has a static async function per method available in that version, which takes the method’s parameters followed by$requestand$response(the ExpressRequestandResponse), and anopenapi()function that returns the version’s OpenAPI specification as a JSON string.
Code that uses the runtime shape does not pass type-checking.
Functions
Section titled “Functions”<method>()
Section titled “<method>()”<method>(<parameter>: <ParameterType>, ...): Promise<<ReturnType>>One instance method per method of the Service Provider, across all versions, with the method’s parameters in order.
| Parameter | Type | Description |
|---|---|---|
<parameter> | <ParameterType> | One per parameter of the method, with the type set on it. |
Returns: Promise<<ReturnType>>: the method’s return type, or void when the method responds manually through the Response object · Availability: Server
Related
Section titled “Related”- Service Provider
- Service Integration