///
///
import type { BinaryToTextEncoding } from "crypto";
interface Asset extends MimeTypeAction {
uri?: string;
}
interface TextAsset extends Asset, LocationUri {
content?: string;
}
interface ResourceAction extends TaskAction, WatchAction {
wbnUri?: string;
}
interface MultipartAction {
formData?: BlobValue;
}
interface BlobValue extends KeyValue {
filename?: string;
}
export interface FileAsset extends TextAsset, OutputAction, DocumentAction, MultipartAction, ResourceAction, IncrementalAction, ChecksumAction {
format?: ArrayOf;
dataView?: NodeJS.ArrayBufferView;
base64?: string;
imported?: boolean | string[];
flags?: number;
}
export interface DataSource extends DocumentAction {
source: string;
uri?: string;
index?: number;
limit?: number;
query?: T;
postQuery?: string | FunctionType;
preRender?: string | FunctionType;
whenEmpty?: string | FunctionType;
removeEmpty?: boolean;
ignoreCache?: IntBool | FirstOf;
transactionState?: number;
transactionFail?: boolean;
}
export interface DbDataSource extends DataSource {
name?: string;
table?: string;
credential?: string | W;
options?: U;
update?: V;
withCommand?: string | TupleOf;
parallel?: boolean;
flat?: number;
willAbort?: boolean;
streamRow?: Null Void)>;
usePool?: boolean | X;
}
export interface OutputAction {
moveTo?: string;
commands?: string[];
compress?: CompressFormat[];
willChange?: boolean;
}
export interface MimeTypeAction {
mimeType?: string;
}
export interface TaskAction {
tasks?: TaskCommand[];
}
export interface WatchAction {
watch?: WatchValue;
}
export interface BundleAction {
bundleId?: number | string;
bundleIndex?: number;
bundleReplace?: T;
bundleQueue?: Promise[];
trailingContent?: ArrayOf;
exported?: boolean;
}
export interface ChecksumAction {
checksum?: ChecksumValue;
checksumOutput?: ChecksumValue;
}
export interface DocumentAction {
document?: ArrayOf;
encoding?: BufferEncoding;
}
export interface AttributeAction {
attributes?: T;
}
export interface HashAction {
hash?: string;
}
export interface TextAction {
textContent?: string;
}
export interface ExcludeAction {
exclude?: boolean;
}
export interface StorageAction {
cloudStorage?: T[];
}
export interface ElementAction {
element?: T;
}
export interface MetadataAction {
metadata?: T;
}
export interface ImportAction {
imports?: T;
}
export interface IncrementalAction {
incremental?: boolean | IncrementalMatch;
}
export interface FromAction {
from?: string[];
}
export interface TaskCommand {
handler?: string;
task?: string | T;
preceding?: boolean;
}
export interface TagData {
tagName: string;
tagCount?: number;
tagIndex?: number;
}
export interface TagAppend extends TagData, TextAction {
order: number;
id?: string;
prepend?: boolean;
nextSibling?: number;
}
export interface TagLocator {
id: string;
index?: number;
count?: number;
}
export interface XmlNode extends AttributeAction {
index?: number;
outerXml?: string;
innerXml?: string;
dynamic?: string;
ignoreCase?: boolean;
}
export interface XmlTagNode extends XmlNode, TagData, TextAction {
id?: StringMap;
locator?: TagLocator;
append?: TagAppend;
removed?: boolean;
}
export interface WebSocketClient {
socketId?: string;
port?: number;
secure?: boolean;
}
export interface WebSocketConnection extends Required {
expired: number;
}
export interface LocationUri {
pathname: string;
filename: string;
}
export interface ViewEngine {
name?: string;
singleRow?: boolean;
outputEmpty?: boolean;
options?: {
compile?: PlainObject;
output?: PlainObject;
};
}
export interface CompressLevel extends MimeTypeAction {
algorithm?: string;
level?: number;
chunkSize?: number;
}
export interface CompressFormat extends CompressLevel {
format?: string;
condition?: string;
plugin?: string;
timeout?: number;
options?: PlainObject;
}
export interface WatchInterval extends TaskBase {
id?: string;
main?: boolean;
reload?: WatchReload;
assets?: T[];
}
export interface WatchReload extends WebSocketClient {
module?: boolean;
always?: boolean;
}
export interface WebSocketResponse {
event?: string;
socketId?: ArrayOf;
type?: string;
encoding?: BufferEncoding;
value?: unknown;
timeStamp?: number;
status?: LogStatus[];
errors?: string[];
}
export interface WatchResponse extends WebSocketResponse {
event: "modified" | "broadcast" | WebSocketEvent;
action?: string;
url?: {
pathname: string;
search?: string;
};
always?: boolean;
}
export interface BroadcastResponse extends WebSocketResponse {
event: "broadcast" | WebSocketEvent;
options?: unknown;
}
export interface FileInfo {
name: string;
size: number | string;
}
export interface RequestBase {
baseUrl?: string;
priority?: number;
threads?: number;
broadcastId?: ArrayOf;
log?: boolean | ArrayOf | T;
error?: { abort?: boolean | ArrayOf; fatal?: boolean };
ignoreExtensions?: boolean | ArrayOf;
}
export interface RequestData extends RequestBase, ImportAction, IncrementalAction {
assets?: FileAsset[];
dataSource?: DataSource[];
document?: string[];
task?: string[];
modules?: string[];
update?: WatchInterval;
checksum?: string | boolean | 1 | ChecksumOutput;
cache?: boolean | AnyObject;
}
export interface LogStatus {
name: string;
type: T;
value: string;
timeStamp: number;
from: string;
sessionId: string;
duration?: number;
source?: string;
}
export interface ResponseData {
success: boolean;
data?: T;
filename?: string;
downloadKey?: string;
downloadUrl?: string;
bytes?: number;
files?: FileInfo[] | string[];
status?: LogStatus[];
error?: ResponseError;
}
export interface ResponseError {
message: string;
hint?: string;
}
export interface RequestObserve extends WebSocketClient {
action?: string;
expires?: number | string;
}
export interface ChecksumBase {
algorithm?: string;
digest?: T;
}
export interface ChecksumOutput extends ChecksumBase {
filename?: string;
include?: ArrayOf;
exclude?: ArrayOf;
recursive?: boolean | 1;
}
export interface TaskBase {
interval?: number | string;
start?: number | string;
expires?: number | string;
}
export type WebSocketEvent = "close" | "error";
export type IncrementalMatch = "none" | "staging" | "etag" | "exists";
export type TextEncoding = "utf-8" | "utf-16" | "utf-16be" | "utf-16le" | "latin1";
export type AttributeMap = ObjectMap;
export type WatchValue = boolean | WatchInterval;
export type ChecksumValue = string | ChecksumBase & { value?: string };