StorageAndHookAPIClient

Class A client for interacting with the Carmen Cloud Storage & Hook API.

Properties

NameTypeDescription
apiUrlstring-
optionsStorageAndHookAPIOptionsAn object containing configuration options for the client.

Members

constructor

(options: StorageAndHookAPIOptions) => StorageAndHookAPIClient

Instantiates the client with a fixed set of options.

Parameters

NameTypeDescription
optionsStorageAndHookAPIOptionsAn object containing configuration options for the client.

createHook

(hook: CreateHookRequest) => Promise

Registers a new webhook

Parameters

NameTypeDescription
hookCreateHookRequestThe attributes of the hook to create: its URL and the APIs to
subscribe to.

createRequestHeaders

() => Headers

deleteHook

(hookUrl: string) => Promise

Deletes a webhook.

Parameters

NameTypeDescription
hookUrlstringThe URL of the webhook to delete.

getEvents

(api: "vehicle" | "transport") => Promise

Lists stored events for the API specified. Only events created in the last 24 hours are retained.

Parameters

NameTypeDescription
api"vehicle" | "transport"The API the events of which to query. Valid values are vehicle
and transport.

getHook

(hookUrl: string) => Promise

Get the attributes of a webhook.

Parameters

NameTypeDescription
hookUrlstringThe URL of the webhook.

getHooks

() => Promise

List currently registered webhooks.

getParametrizedApiUrl

() => any

getStorageStatus

() => Promise

Gets the current storage status and topic ARN (if it exists).

selectApiBaseUrl

() => string

updateHook

(hookUrl: string, apis: UpdateHookRequest) => Promise

Updates which APIs a webhook is subscribed to.

Parameters

NameTypeDescription
hookUrlstringThe URL of the webhook.
apisUpdateHookRequestAn object with optional boolean properties vehicle and
transport. If the property value is true, the hook will receive events
from the API specified. If it is false, it will not. If unspecified, the
current setting will be kept.

updateStorageStatus

(apis: StorageStatusRequest) => Promise

Enables or disables storage based on the settings specified.

Parameters

NameTypeDescription
apisStorageStatusRequestAn object with optional boolean properties vehicle and
transport. If the property value is true, storage will be enabled for
the API specified. If it is false, it will be disabled. If unspecified,
it will be left as it is.

Source: storage-and-hook/index.ts:18