Workflows ReferenceType Definitions
IngestBucketWorkflowUtils
type IngestBucketWorkflowUtils = {
delete: Promise<void>;
get: Promise<T | null>;
put: Promise<void>;
};Methods
delete()
delete(bucketSlug, key): Promise<void>;Delete a value from a named bucket by key. Deleting a non-existent key will return successfully.
Parameters
| Parameter | Type | Description |
|---|---|---|
bucketSlug | string | The name of the bucket to delete the value from. |
key | string | The key to delete. Must be a non-empty string of up to 128 characters. |
Returns
Promise<void>
Example
ts await utils.buckets.delete('user-preferences', 'theme')
get()
get<T>(bucketSlug, key): Promise<T | null>;Retrieve a value from a named bucket by key. Buckets are scoped to this app.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The expected type of the stored value. |
Parameters
| Parameter | Type | Description |
|---|---|---|
bucketSlug | string | The name of the bucket to retrieve the value from. |
key | string | The key to retrieve. Must be a non-empty string of up to 128 characters. |
Returns
Promise<T | null>
The stored value, or null if not found.
Example
ts const theme = await utils.buckets.get('bot-config', 'all-sites')
put()
put(
bucketSlug,
key,
value): Promise<void>;Store a value in a named bucket under a specific key. Buckets are scoped to this app.
Parameters
| Parameter | Type | Description |
|---|---|---|
bucketSlug | string | The name of the bucket to store the value in. |
key | string | The key under which to store the value. Must be a non-empty string of up to 128 characters. |
value | unknown | The value to store. Maximum size is 20MB. |
Returns
Promise<void>
Example
ts await utils.buckets.put('bot-config', 'all-sites', { theme: 'dark' })