meca
Version:
Types and utilities for working with MECA
71 lines • 2.02 kB
TypeScript
import type { GenericParent } from 'myst-common';
import type { Element, DeclarationAttributes } from 'xml-js';
import type { Logger } from 'myst-cli-utils';
export declare const TRANSFER = "transfer.xml";
export declare const TRANSFER_DTD = "transfer-1.0.dtd";
type Options = {
log?: Logger;
};
export type Contact = {
role?: string;
name?: {
surname?: string;
given?: string;
};
email?: string;
phone?: string;
};
export type ServiceProvider = {
name?: string;
contact?: Contact;
};
export type Publication = {
type?: string;
title?: string;
acronym?: string;
contact?: Contact;
};
export type Security = {
auth?: string;
};
export type Location = {
provider?: ServiceProvider;
publication?: Publication;
security?: Security;
};
export type Instruction = {
sequence?: string;
instruction?: string;
};
export type ProcessingInstructions = {
instructions?: Instruction[];
comments?: string[];
};
export type Transfer = {
source?: Location & Required<Pick<Location, 'provider'>>;
destination?: Location & Required<Pick<Location, 'provider' | 'publication'>>;
instructions?: ProcessingInstructions;
};
export declare class TransferXml {
declaration?: DeclarationAttributes;
doctype?: string;
rawXML: string;
raw: Element;
log: Logger;
tree: GenericParent;
constructor(data: string, opts?: Options);
get localDtd(): string;
validateXml(remoteDtd?: string): Promise<boolean | undefined>;
get version(): string;
get source(): Location | undefined;
get destination(): Location | undefined;
get instructions(): ProcessingInstructions | undefined;
}
type WriteOptions = {
/** Some providers want a simplified XML output that changes the names of some of the XML elements. */
simplifiedXML?: boolean;
dtdUrl?: string;
};
export declare function createTransferXml(transfer: Transfer, opts?: WriteOptions): string;
export {};
//# sourceMappingURL=transfer.d.ts.map