UNPKG

sjursen-digital-watchtower

Version:

A TypeScript Node.js SDK for Watchtower, an Intelligence as a Service (IaaS) platform that uses Google's Gemini AI model to transform traditional logging into an active intelligence system with predictive analytics and automated decision-making capabiliti

55 lines (54 loc) 2.36 kB
import { BaseEndpoint } from '../base'; import { CreateOrganizationRequest, APIKeyResponse, CreateAppRequest, AppAPIKey, CreateTenantRequest, TenantAPIKey, RollAPIKeyRequest, RolledAPIKey, CreateAPIKeyRequest } from './types'; export declare class APIKeyEndpoint extends BaseEndpoint { constructor(client: any); /** * Create an organization and get an API key * @param data - The organization creation request * @returns Promise with the API key response */ createOrganization(data: CreateOrganizationRequest): Promise<APIKeyResponse>; /** * Create an app and get an app API key * @param data - The app creation request * @returns Promise with the app API key response */ createApp(data: CreateAppRequest): Promise<AppAPIKey>; /** * Create a tenant and get a tenant API key * @param data - The tenant creation request * @returns Promise with the tenant API key response */ createTenant(data: CreateTenantRequest): Promise<TenantAPIKey>; /** * Roll an API key (organization, app, or tenant) * @param data - The roll API key request * @returns Promise with the new rolled API key */ rollAPIKey(data: RollAPIKeyRequest): Promise<RolledAPIKey>; /** * Create a new API key for an existing organization, app, or tenant * @param data - The API key creation request * @returns Promise with the new API key */ createAPIKey(data: CreateAPIKeyRequest): Promise<APIKeyResponse>; /** * Creates a new API key for an existing organization using JWT authentication * * @param organizationId - ID of the existing organization * @param jwtToken - Valid Supabase JWT token * @returns Promise<APIKeyResponse> * @throws Error if request fails */ createOrgKey(organizationId: string, jwtToken: string): Promise<APIKeyResponse>; /** * Creates a new API key for an app in the user's organization using JWT authentication * * @param appName - Name of the app * @param tenancyModel - App's tenancy model ("single" or "multi") * @param jwtToken - Valid Supabase JWT token * @returns Promise<APIKeyResponse> * @throws Error if request fails */ createAppKey(appName: string, tenancyModel: 'single' | 'multi', jwtToken: string): Promise<APIKeyResponse>; }