cloudflare
Version:
The official TypeScript library for the Cloudflare API
72 lines • 2.96 kB
TypeScript
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as ValuesAPI from 'cloudflare/resources/kv/namespaces/values';
export declare class Values extends APIResource {
/**
* Write a value identified by a key. Use URL-encoding to use special characters
* (for example, `:`, `!`, `%`) in the key name. Body should be the value to be
* stored along with JSON metadata to be associated with the key/value pair.
* Existing values, expirations, and metadata will be overwritten. If neither
* `expiration` nor `expiration_ttl` is specified, the key-value pair will never
* expire. If both are set, `expiration_ttl` is used and `expiration` is ignored.
*/
update(namespaceId: string, keyName: string, params: ValueUpdateParams, options?: Core.RequestOptions): Core.APIPromise<ValueUpdateResponse>;
/**
* Remove a KV pair from the namespace. Use URL-encoding to use special characters
* (for example, `:`, `!`, `%`) in the key name.
*/
delete(namespaceId: string, keyName: string, params: ValueDeleteParams, options?: Core.RequestOptions): Core.APIPromise<ValueDeleteResponse>;
/**
* Returns the value associated with the given key in the given namespace. Use
* URL-encoding to use special characters (for example, `:`, `!`, `%`) in the key
* name. If the KV-pair is set to expire at some point, the expiration time as
* measured in seconds since the UNIX epoch will be returned in the `expiration`
* response header.
*/
get(namespaceId: string, keyName: string, params: ValueGetParams, options?: Core.RequestOptions): Core.APIPromise<string>;
}
export type ValueUpdateResponse = unknown | string;
export type ValueDeleteResponse = unknown | string;
/**
* A byte sequence to be stored, up to 25 MiB in length.
*/
export type ValueGetResponse = string;
export interface ValueUpdateParams {
/**
* Path param: Identifier
*/
account_id: string;
/**
* Body param: Arbitrary JSON to be associated with a key/value pair.
*/
metadata: string;
/**
* Body param: A byte sequence to be stored, up to 25 MiB in length.
*/
value: string;
}
export interface ValueDeleteParams {
/**
* Path param: Identifier
*/
account_id: string;
/**
* Body param:
*/
body: unknown;
}
export interface ValueGetParams {
/**
* Identifier
*/
account_id: string;
}
export declare namespace Values {
export import ValueUpdateResponse = ValuesAPI.ValueUpdateResponse;
export import ValueDeleteResponse = ValuesAPI.ValueDeleteResponse;
export import ValueGetResponse = ValuesAPI.ValueGetResponse;
export import ValueUpdateParams = ValuesAPI.ValueUpdateParams;
export import ValueDeleteParams = ValuesAPI.ValueDeleteParams;
export import ValueGetParams = ValuesAPI.ValueGetParams;
}
//# sourceMappingURL=values.d.ts.map