UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

52 lines (51 loc) 1.34 kB
/** * A type alias for an ApiKey. * @category Secret */ export type ApiKey = string; /** * The secret key, an alias for a string. * @category Secret */ export type SecretKey = string; /** * The secret value. * @category Secret */ export type SecretValue = string | number | boolean; /** * Metadata for a secret, including its key and last updated timestamp. * @category Secret */ export interface SecretMetadata { /** The key identifying the secret. */ key: SecretKey; /** The timestamp (in milliseconds) when the secret was last updated. */ lastUpdated: number; } /** * A secret entry combining metadata with a typed value. * @category Secret */ export interface SecretEntry<T extends SecretValue = SecretValue> extends SecretMetadata { /** The value of the secret, constrained to the specified type. */ value: T; } /** * An API key entry combining metadata with a string value. * @category Secret */ export interface ApiKeyEntry extends SecretMetadata { /** The string value of the API key. */ value: string; } /** * A request structure for setting a secret with a key-value pair. * @category Secret */ export interface SetSecretRequestEntry { /** The key identifying the secret to set. */ key: SecretKey; /** The value to assign to the secret. */ value: SecretValue; }