ProtectedconstructorCreate an Adapter.
The blueprint to create the adapter.
Protected ReadonlyblueprintProtected ReadonlyhooksProtected ReadonlymiddlewareProtected ReadonlyresolvedProtectedbuildBuild the raw response.
The event context.
OptionaleventHandler: AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>
The event handler to be run.
The raw response wrapper.
ProtectedeventProcesses an incoming Tencent SCF HTTP event.
Converts a raw Tencent SCF HTTP event into an IncomingHttpEvent, processes it through
the Stone.js pipeline, and generates a RawHttpResponse to send back.
The raw HTTP event received from Tencent SCF.
The Tencent SCF execution context associated with the event.
A promise resolving to the processed RawHttpResponse.
ProtectedexecuteExecute the event handler lifecycle hooks.
The hook to execute.
The event handler to be run.
ProtectedexecuteExecute adapter lifecycle hooks.
The hook's name.
Optionalcontext: TencentScfHttpAdapterContext
The event context.
Optionalerror: any
The error to handle.
ProtectedhandleHandle error.
The error to handle.
The event context.
The raw response.
ProtectedhandleHandle the event.
The event context.
The event handler to be run.
The raw response wrapper.
ProtectedmakeCreate pipeline options for the Adapter.
The pipeline options for transforming the event.
ProtectedonInitializes the adapter and validates its execution context.
Ensures that the adapter is running in an Tencent SCF environment. Throws an error if it detects that the adapter is being used in an unsupported environment (e.g., a browser).
ProtectedresolveGet the error handler for the given error.
The error to get the handler for.
The error handler.
ProtectedresolveExecutes the adapter and provides an Tencent SCF-compatible HTTP handler function.
This method initializes the adapter and returns a handler function that can
process HTTP events in Tencent SCF. It transforms raw events into IncomingHttpEvent
instances and produces RawHttpResponse objects as output.
The type representing the Tencent SCF event handler function.
A promise resolving to the Tencent SCF HTTP handler function.
ProtectedsendSend the raw event through the destination.
The event context.
The event handler to be run.
Platform-specific response.
ProtectedvalidateValidate the context and event handler.
The context to validate.
The event handler to validate.
StaticcreateCreates an instance of the TencentScfHttpAdapter.
The application blueprint.
A new instance of TencentScfHttpAdapter.
Tencent SCF HTTP Adapter for Stone.js.
The
TencentScfHttpAdapterextends the functionality of the Stone.jsAdapterto provide seamless integration with Tencent SCF for HTTP-based events. This adapter transforms incoming HTTP events from Tencent SCF intoIncomingHttpEventinstances and produces aRawHttpResponseas output.This adapter simplifies the process of handling HTTP events within Tencent SCF while adhering to the Stone.js framework's event-driven architecture.
Template: TencentScfHttpEvent
The type of the raw HTTP event from Tencent SCF.
Template: RawHttpResponse
The type of the raw HTTP response to send back.
Template: TencentScfContext
The Tencent SCF execution context type.
Template: IncomingHttpEvent
The type of the processed incoming HTTP event.
Template: IncomingHttpEventOptions
Options used to create an incoming HTTP event.
Template: OutgoingHttpResponse
The type of the outgoing HTTP response after processing.
Template: TencentScfHttpAdapterContext
Context type specific to the HTTP adapter.
Example
See