import type { IEDVConfig, IEDVQuery, IEncryptedDocument, ISigner, IZcap } from '@interop/data-integrity-core'; import { Transport } from './Transport.js'; import type { ITransportCreateEdvOptions, ITransportFindConfigsOptions, ITransportGetChunkOptions, ITransportStoreChunkOptions, ITransportUpdateIndexOptions } from './Transport.js'; /** * A node.js `https.Agent` instance used to handle HTTPS requests. Typed * loosely because it is an environment-specific (Node-only) object. */ export type HttpsAgent = any; /** * Options for the internal `_signedHttpGet` helper. */ interface ISignedHttpGetOptions { url: string; capability?: IZcap | string; notFoundMessage?: string; } /** * Options for the internal `_signedHttpPost` helper. */ interface ISignedHttpPostOptions { url: string; json?: object; capability?: IZcap | string; capabilityAction?: string; insert?: boolean; } export declare class HttpsTransport extends Transport { capability?: IZcap | string; defaultHeaders: Record; edvId: any; httpsAgent?: HttpsAgent; invocationSigner?: ISigner; url: any; _rootZcapId?: string; /** * Creates a transport layer for an EDV client to use to perform an * operation with an EDV server over HTTPS. * * @param {object} options - The options to use. * @param {object|string} [options.capability] - The authorization capability * (zcap) to use to authorize the operation. * @param {object} [options.defaultHeaders] - Default headers to use with * HTTP requests. * @param {string} [options.edvId] - The ID of the target EDV. * @param {HttpsAgent} [options.httpsAgent] - A node.js `https.Agent` * instance to use when making requests. * @param {object} [options.invocationSigner] - An object with an * `id` property and a `sign` function for signing a capability invocation. * @param {string} [options.url] - The url to use. * * @returns {HttpsTransport} An HttpsTransport instance. */ constructor({ capability, defaultHeaders, edvId, httpsAgent, invocationSigner, url }?: { capability?: IZcap | string; defaultHeaders?: Record; edvId?: string; httpsAgent?: HttpsAgent; invocationSigner?: ISigner; url?: string; }); /** * @inheritdoc */ createEdv({ config }?: ITransportCreateEdvOptions): Promise; /** * @inheritdoc */ getConfig({ id }?: { id?: string; }): Promise; /** * @inheritdoc */ updateConfig({ config }?: { config?: IEDVConfig; }): Promise; /** * @inheritdoc */ findConfigs({ controller, referenceId, after, limit }?: ITransportFindConfigsOptions): Promise; /** * @inheritdoc */ insert({ encrypted }?: { encrypted?: IEncryptedDocument; }): Promise; /** * @inheritdoc */ update({ encrypted }?: { encrypted?: IEncryptedDocument; }): Promise; /** * @inheritdoc */ updateIndex({ docId, entry }?: ITransportUpdateIndexOptions): Promise; /** * @inheritdoc */ get({ id }?: { id?: string; }): Promise; /** * @inheritdoc */ find({ query }?: { query?: IEDVQuery; }): Promise; /** * @inheritdoc */ revokeCapability({ capabilityToRevoke }?: { capabilityToRevoke?: IZcap; }): Promise; /** * @inheritdoc */ storeChunk({ docId, chunk }?: ITransportStoreChunkOptions): Promise; /** * @inheritdoc */ getChunk({ docId, chunkIndex }?: ITransportGetChunkOptions): Promise; _signedHttpGet({ url, capability, notFoundMessage }: ISignedHttpGetOptions): Promise; _signedHttpPost({ url, json, capability, capabilityAction, insert }: ISignedHttpPostOptions): Promise; _getDocUrl(id: any, capability: any): any; static _getInvocationTarget({ capability }: { capability?: IZcap | string; }): string | null; } export {}; /** * A node.js HTTPS agent. * * @typedef {object} HttpsAgent * @see https://nodejs.org/api/https.html#https_class_https_agent */ //# sourceMappingURL=HttpsTransport.d.ts.map