UNPKG

@squidcloud/client

Version:

A typescript implementation of the Squid client

120 lines (119 loc) 4.23 kB
/** * Request to search the web. */ export interface WebAiSearchRequest { /** The search query. */ query: string; } /** * Represents a cited URL in the search response. */ export interface WebAiSearchCitedUrl { /** The URL of the cited resource. */ url: string; /** The title of the cited resource. */ title: string; } /** * Response from a web search. */ export interface WebAiSearchResponse { /** The search result content in Markdown format. */ markdownText: string; /** A list of cited URLs included in the search response. */ citedUrls: Array<WebAiSearchCitedUrl>; } /** * Request to fetch content from a URL. */ export interface WebGetUrlContentRequest { /** The URL to fetch content from. */ url: string; } /** * Response from fetching content from a URL. */ export interface WebGetUrlContentResponse { /** The content fetched from the URL in Markdown format. */ markdownText: string; } /** * Options for creating a shortened URL. */ export interface CreateShortUrlOptions { /** The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://). */ url: string; /** Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 1 day. */ secondsToLive?: number; /** Optional file extension to include in the shortened URL ID (e.g., 'pdf', 'html'). The extension becomes part of the ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */ fileExtension?: string; } /** * Options for creating multiple shortened URLs. */ export interface CreateShortUrlsOptions { /** The URLs to shorten. They must be valid URLs and should include the protocol (start with http:// or https://). */ urls: string[]; /** Seconds to live for all shortened URLs. If set to 0, the URLs will never expire. Defaults to 1 day. */ secondsToLive?: number; /** Optional file extension to include in all shortened URL IDs (e.g., 'pdf', 'html'). The extension becomes part of each ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */ fileExtension?: string; } /** * Request to create a shortened URL. */ export interface WebShortUrlRequest { /** The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://). */ url: string; /** Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 1 day. */ secondsToLive?: number; /** Optional file extension to include in the shortened URL ID (e.g., 'pdf', 'html'). The extension becomes part of the ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */ fileExtension?: string; } /** * Request to create shortened URLs. */ export interface WebShortUrlBulkRequest { /** The URLs to shorten. They must be valid URLs and should include the protocol (start with http:// or https://). */ urls: string[]; /** Seconds to live for all shortened URLs. If set to 0, the URLs will never expire. Defaults to 1 day. */ secondsToLive?: number; /** Optional file extension to include in all shortened URL IDs (e.g., 'pdf', 'html'). The extension becomes part of each ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */ fileExtension?: string; } /** * Response with the newly created shortened URL. */ export interface WebShortUrlResponse { /** The ID of the shortened URL. */ id: string; /** The full valid shortened URL. */ shortUrl: string; /** The time when the shortened URL will expire. */ expiry: Date | null; } /** * Response with the newly created shortened URL. */ export interface WebShortUrlBulkResponse { /** The IDs of the shortened URLs. */ ids: string[]; /** List of full valid shortened URLs. */ shortUrls: string[]; /** The time when the shortened URLs will expire. */ expiry: Date | null; } /** * Request to delete a shortened URL. */ export interface WebShortUrlDeleteRequest { /** The ID of the shortened URL to delete. */ id: string; } /** * Request to delete a shortened URL. */ export interface WebShortUrlBulkDeleteRequest { /** The IDs of the shortened URLs to delete. */ ids: string[]; }