Skip to content

Latest commit

 

History

History
190 lines (110 loc) · 3.92 KB

File metadata and controls

190 lines (110 loc) · 3.92 KB

@envoy/envoy-integrations-sdk / EnvoyPluginJob

Class: EnvoyPluginJob

A "job" is an event, like entry_sign_in. When your plugin handles the event, you can use this job concept to update the status (e.g. complete, failed, ignored) as well as attach extra data to the event's subject (e.g. showing a generated card number in the dashboard for a visitor on entry_sign_in).

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EnvoyPluginJob(pluginAPI, jobId)

Parameters

Name Type
pluginAPI EnvoyPluginAPI
jobId string

Defined in

sdk/EnvoyPluginJob.ts:17

Properties

api

Readonly api: EnvoyPluginAPI

Defined in

sdk/EnvoyPluginJob.ts:15


id

Readonly id: string

Defined in

sdk/EnvoyPluginJob.ts:17

Methods

attach

attach(...attachments): Promise<void>

Add attachments to this job.

Parameters

Name Type
...attachments EnvoyPluginJobAttachment[]

Returns

Promise<void>

Defined in

sdk/EnvoyPluginJob.ts:48


complete

complete(message, ...attachments): Promise<void>

Reports that the job is complete.

Instead of calling this directly, you can return a 200 response from the job's event handler, using {@link EnvoyRequest.send}.

Parameters

Name Type
message string
...attachments EnvoyPluginJobAttachment[]

Returns

Promise<void>

Defined in

sdk/EnvoyPluginJob.ts:58


fail

fail(message, reason): Promise<void>

Reports that the job is ignored.

Instead of calling this directly, you can return a 400 response from the job's event handler, using {@link EnvoyRequest.sendFailed}.

Parameters

Name Type
message string
reason string

Returns

Promise<void>

Defined in

sdk/EnvoyPluginJob.ts:78


ignore

ignore(message, reason): Promise<void>

Reports that the job is ignored.

Instead of calling this directly, you can return a 400 response from the job's event handler, using {@link EnvoyRequest.sendIgnored}.

Parameters

Name Type
message string
reason string

Returns

Promise<void>

Defined in

sdk/EnvoyPluginJob.ts:68


update

update(message, ...attachments): Promise<void>

Updates the job with a new message and attachments.

Can be used to periodically update long-running jobs.

Parameters

Name Type
message string
...attachments EnvoyPluginJobAttachment[]

Returns

Promise<void>

Defined in

sdk/EnvoyPluginJob.ts:87