UNPKG

@sitecore/sc-contenthub-webclient-sdk

Version:

Sitecore Content Hub WebClient SDK.

30 lines (29 loc) 1.83 kB
import { IExtendedContentHubClient } from "./extended-client"; import { CancelCallback } from "./internal-client"; import { ResponseMessage } from "./response-message"; export interface ICommandsClient { /** * Executes a Content Hub command. * @param namespace - The name of the folder containing the command * @param command - The name of the command * @param args - The arguments of the command or null/undefined if the command has no arguments * @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided * @returns The raw HTTP response. */ executeCommandRawAsync(namespace: string, command: string, args?: unknown, cancelCallback?: CancelCallback): Promise<ResponseMessage<unknown>>; /** * Executes a Content Hub command. * @param namespace - The name of the folder containing the command * @param command - The name of the command * @param args - The arguments of the command or null/undefined if the command has no arguments * @param cancelCallback - A {@link CancelCallback} that will be placed in an Axios {@link CancelToken} if provided * @returns The result of the command. If the command has no result, null is returned. */ executeCommandAsync(namespace: string, command: string, args?: unknown, cancelCallback?: CancelCallback): Promise<unknown>; } export declare class CommandsClient implements ICommandsClient { private readonly _client; constructor(client: IExtendedContentHubClient); executeCommandRawAsync(namespace: string, command: string, args?: unknown, cancelCallback?: CancelCallback): Promise<ResponseMessage<unknown>>; executeCommandAsync(namespace: string, command: string, args?: unknown, cancelCallback?: CancelCallback): Promise<unknown>; }