StorageAndHookAPIClient
Class A client for interacting with the Carmen Cloud Storage & Hook API.
Properties
| Name | Type | Description |
|---|---|---|
apiUrl | string | - |
options | StorageAndHookAPIOptions | An object containing configuration options for the client. |
Members
constructor
(options: StorageAndHookAPIOptions) => StorageAndHookAPIClient
Instantiates the client with a fixed set of options.
Parameters
| Name | Type | Description |
|---|---|---|
options | StorageAndHookAPIOptions | An object containing configuration options for the client. |
createHook
(hook: CreateHookRequest) => Promise
Registers a new webhook
Parameters
| Name | Type | Description |
|---|---|---|
hook | CreateHookRequest | The attributes of the hook to create: its URL and the APIs to subscribe to. |
createRequestHeaders
() => Headers
deleteHook
(hookUrl: string) => Promise
Deletes a webhook.
Parameters
| Name | Type | Description |
|---|---|---|
hookUrl | string | The 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
| Name | Type | Description |
|---|---|---|
api | "vehicle" | "transport" | The API the events of which to query. Valid values are vehicleand transport. |
getHook
(hookUrl: string) => Promise
Get the attributes of a webhook.
Parameters
| Name | Type | Description |
|---|---|---|
hookUrl | string | The 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
| Name | Type | Description |
|---|---|---|
hookUrl | string | The URL of the webhook. |
apis | UpdateHookRequest | An object with optional boolean properties vehicle andtransport. If the property value is true, the hook will receive eventsfrom the API specified. If it is false, it will not. If unspecified, thecurrent setting will be kept. |
updateStorageStatus
(apis: StorageStatusRequest) => Promise
Enables or disables storage based on the settings specified.
Parameters
| Name | Type | Description |
|---|---|---|
apis | StorageStatusRequest | An object with optional boolean properties vehicle andtransport. If the property value is true, storage will be enabled forthe 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