UNPKG

@strapi/data-transfer

Version:

Data transfer capabilities for Strapi

46 lines 2.29 kB
/// <reference types="node" /> import { Readable } from 'stream'; import type { Struct, Utils } from '@strapi/types'; import { WebSocket } from 'ws'; import type { IMetadata, ISourceProvider, ISourceProviderTransferResults, MaybePromise, ProviderType, StageTotalsEstimate, TransferStage } from '../../../../types'; import type { IDiagnosticReporter } from '../../../utils/diagnostic'; import { Auth } from '../../../../types/remote/protocol'; import { ILocalStrapiSourceProviderOptions } from '../local-source'; import { createDispatcher } from '../utils'; export interface IRemoteStrapiSourceProviderOptions extends ILocalStrapiSourceProviderOptions { url: URL; auth?: Auth.ITransferTokenAuth; retryMessageOptions?: { retryMessageTimeout: number; retryMessageMaxRetries: number; }; /** Max ms without forward progress on an asset (new remote chunk accepted or chunk fully handed to the asset stream). */ streamTimeout?: number; /** Require per-asset checksum verification for transferred asset bytes. */ verifyChecksums?: boolean; } declare class RemoteStrapiSourceProvider implements ISourceProvider { #private; name: string; type: ProviderType; options: IRemoteStrapiSourceProviderOptions; ws: WebSocket | null; dispatcher: ReturnType<typeof createDispatcher> | null; defaultOptions: Partial<IRemoteStrapiSourceProviderOptions>; constructor(options: IRemoteStrapiSourceProviderOptions); results?: ISourceProviderTransferResults | undefined; createEntitiesReadStream(): MaybePromise<Readable>; createLinksReadStream(): MaybePromise<Readable>; createAssetsReadStream(): Promise<Readable>; createConfigurationReadStream(): MaybePromise<Readable>; getMetadata(): Promise<IMetadata | null>; assertValidProtocol(url: URL): void; initTransfer(): Promise<string>; bootstrap(diagnostics?: IDiagnosticReporter): Promise<void>; close(): Promise<void>; getSchemas(): Promise<Utils.String.Dict<Struct.Schema> | null>; getStageTotals(stage: TransferStage): Promise<StageTotalsEstimate | null>; } export declare const createRemoteStrapiSourceProvider: (options: IRemoteStrapiSourceProviderOptions) => RemoteStrapiSourceProvider; export {}; //# sourceMappingURL=index.d.ts.map