UNPKG

reduct-js

Version:

ReductStore Client SDK for Javascript/NodeJS/Typescript

118 lines (117 loc) 2.92 kB
/** * Token Permissions with server-side names */ export declare class OriginalTokenPermission { full_access: boolean; read?: string[]; write?: string[]; } /** * Token create request with server-side names */ export declare class OriginalTokenCreateRequest { permissions: OriginalTokenPermission; expires_at?: string; ttl?: number; ip_allowlist?: string[]; } /** * Token create request */ export declare class TokenCreateRequest { /** * Permissions for the token */ readonly permissions: TokenPermissions; /** * Expiration time as unix timestamp in milliseconds */ readonly expiresAt?: number; /** * Time to live in seconds */ readonly ttl?: number; /** * List of IP addresses and CIDR ranges allowed to use the token */ readonly ipAllowlist?: string[]; static serialize(data: TokenCreateRequest): OriginalTokenCreateRequest; } /** * Token Permissions */ export declare class TokenPermissions { /** * Full access * The token allows to create, remove and update settings of buckets, manage tokens and read and write data. */ readonly fullAccess: boolean; /** * Read access * List of buckets allowed to read */ readonly read?: string[]; /** * Write access * List of buckets allowed to write */ readonly write?: string[]; static parse(data: OriginalTokenPermission): TokenPermissions; static serialize(data: TokenPermissions): OriginalTokenPermission; } /** * Token Info with server-side names */ export declare class OriginalTokenInfo { name: string; created_at: string; last_access?: string; ttl?: number; is_expired?: boolean; expires_at?: string; ip_allowlist?: string[]; is_provisioned?: boolean | undefined; permissions?: OriginalTokenPermission; } /** * Information about an access token */ export declare class Token { /** * Name of the token */ readonly name: string; /** * Creation time of the token as unix timestamp in milliseconds */ readonly createdAt: number; /** * Last access time of the token as unix timestamp in milliseconds */ readonly lastAccess?: number; /** * Time to live in seconds */ readonly ttl?: number; /** * True if the token is expired */ readonly isExpired?: boolean; /** * Expiration time as unix timestamp in milliseconds */ readonly expiresAt?: number; /** * List of IP addresses and CIDR ranges allowed to use the token */ readonly ipAllowlist?: string[]; /** * Is the token provisioned, and you can't remove it or change it */ readonly isProvisioned?: boolean; /** * Permissions of the token */ readonly permissions?: TokenPermissions; static parse(data: OriginalTokenInfo): Token; }