UNPKG

@vigilbase/cli

Version:

Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.

78 lines (77 loc) • 3.24 kB
import { z } from 'zod'; import { pageSchema } from '../../core/pagination.js'; /** * Shared pieces of One's v1 operations (phase 2 of the api.vigilbase.com * rollout; ops/research/2026-11-02-api-contract-design.md). * * Every v1 operation accepts the same three credentials, never a cookie: * - an Identity access token for `https://api.vigilbase.com/one` (or, during * migration, `https://one.vigilbase.com`) with `one:api`; * - a `vb_one_` organisation API key (read or write); * - an MCP token with `one:read` / `one:write`. * * The declarations can only narrow what the implementation enforces: One's * permission checks, tenant scoping and step-up guards still run inside each * implementation (declared-versus-enforced tests in apps/one). */ export declare const ONE_READ_AUTH: readonly [{ readonly kind: "identityBearer"; readonly resource: "one"; readonly scopes: readonly ["one:api"]; }, { readonly kind: "orgApiKey"; readonly access: "read"; }, { readonly kind: "mcpToken"; readonly scope: "one:read"; }]; export declare const ONE_WRITE_AUTH: readonly [{ readonly kind: "identityBearer"; readonly resource: "one"; readonly scopes: readonly ["one:api"]; }, { readonly kind: "orgApiKey"; readonly access: "write"; }, { readonly kind: "mcpToken"; readonly scope: "one:write"; }]; /** A read that keys may not make: it acts for the signed-in person. */ export declare const ONE_PERSON_READ_AUTH: readonly [{ readonly kind: "identityBearer"; readonly resource: "one"; readonly scopes: readonly ["one:api"]; }, { readonly kind: "mcpToken"; readonly scope: "one:read"; }]; /** A write that keys may not make: it is attributed to the signed-in person (e.g. their support contact). */ export declare const ONE_PERSON_WRITE_AUTH: readonly [{ readonly kind: "identityBearer"; readonly resource: "one"; readonly scopes: readonly ["one:api"]; }, { readonly kind: "mcpToken"; readonly scope: "one:write"; }]; export declare const READ_ERRORS: readonly ["unauthorized", "forbidden", "not_found", "validation_failed", "rate_limit_exceeded", "service_unavailable"]; export declare const LIST_ERRORS: readonly ["unauthorized", "forbidden", "not_found", "validation_failed", "rate_limit_exceeded", "service_unavailable"]; export declare const WRITE_ERRORS: readonly ["unauthorized", "forbidden", "not_found", "validation_failed", "rate_limit_exceeded", "service_unavailable", "read_only_key", "conflict", "unprocessable_entity"]; /** IDs are UUIDs throughout One. */ export declare const Id: z.ZodGUID; export declare const CustomerParams: z.ZodObject<{ customerId: z.ZodGUID; }, z.core.$strip>; /** An ISO 8601 date-time as One stores it. */ export declare const Timestamp: z.ZodString; /** Cursor query for every v1 list. */ export declare const ListQuery: z.ZodObject<{ cursor: z.ZodOptional<z.ZodString>; limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>; }, z.core.$strip>; export { pageSchema }; /** `{ items, nextCursor? }` for a named item schema. */ export declare function page<T extends z.ZodType>(item: T): z.ZodObject<{ items: z.ZodArray<T>; nextCursor: z.ZodOptional<z.ZodString>; }, z.core.$strip>;