import { RequestClient } from '@segment/actions-core/create-request-client'; import { EngageDestinationCache, ExecuteInput } from '@segment/actions-core/destination-kit'; import { MaybePromise } from '@segment/actions-core/destination-kit/types'; import { EngageLogger } from './EngageLogger'; import { EngageStats } from './EngageStats'; import { OperationContext } from './track'; import { RequestOptions } from '@segment/actions-core/request-client'; import { IntegrationError } from '@segment/actions-core'; import { Awaited, StatsTags } from './operationTracking'; import { ValueOrError } from './getOrCatch'; import { GetOrRetryArgs } from './getOrRetry'; export declare abstract class EngageActionPerformer { readonly requestClient: RequestClient; readonly executeInput: ExecuteInput; readonly logger: EngageLogger; readonly statsClient: EngageStats; readonly engageDestinationCache?: EngageDestinationCache; readonly currentOperation: OperationContext | undefined; readonly payload: TPayload; readonly settings: TSettings; constructor(requestClient: RequestClient, executeInput: ExecuteInput); beforePerform?(): void | Promise; perform(): Promise; abstract doPerform(): MaybePromise; abstract getIntegrationStatsName(): string; abstract getChannelType(): string; request(url: string, options?: RequestOptions): Promise>; onResponse?(args: { response?: Awaited>; error?: any; operation: OperationContext; }): void; redactPii(pii: string | undefined): string | undefined; isFeatureActive(featureName: string, getDefault?: () => boolean): boolean | undefined; logInfo(msg: string, metadata?: object): void; logError(msg: string, metadata?: object): void; logWarn(msg: string, metadata?: object): void; logOnError(logMessage: string | ((ctx: OperationContext) => string)): void; statsIncr(metric: string, value?: number, tags?: StatsTags): void; statsHistogram(metric: string, value: number, tags?: StatsTags): void; statsSet(metric: string, value: number, tags?: StatsTags): void; get logDetails(): Record; get tags(): string[]; rethrowIntegrationError(error: unknown, getWrapper: () => IntegrationError | ConstructorParameters): never; throwRetryableError(message: string, code?: string): never; createStepLogger(args: LogStepDetails): StepLogger; getOrAddCache(key: string, createValue: () => Promise, options: { cacheGroup?: string; serializer?: CacheSerializer; expiryInSeconds?: number; lockOptions?: LockOptions; saveRetry?: GetOrRetryArgs; onSaveFailed?: (error: Error) => void; }): Promise; withDistributedLock(key: string, createValue: () => Promise, options: LockOptions): Promise; isLockExpirationExtended(): boolean | undefined; isRequestTimeoutExtended(): boolean | undefined; } export type CacheSerializer = { stringify: (cacheable: ValueOrError) => string | void; parse: (cachedValue: string) => ValueOrError | void; }; export declare const DefaultSerializer: CacheSerializer; export type LockOptions = { acquireLockMaxWaitTimeMs: number; acquireLockRetryIntervalMs?: number; lockMaxTimeMs: number; cacheGroup?: string; }; export declare function isNone(cacheValue: any): cacheValue is null | undefined | void; type StepLogger = LogStepDetails & { track(stepName: string, fn: (details: LogStepDetails) => T): T; write(stepName: string, details?: Partial): void; }; type LogStepDetails = { tags: Record; logs: Record; level?: 'info' | 'warn' | 'error'; }; export {};