UNPKG

@allma/core-sdk

Version:

Core SDK with shared utilities (logging, auth, S3 utils) for building on the Allma serverless AI orchestration platform.

20 lines 1.24 kB
import type { S3OutputPointerWrapper, S3Pointer } from '@allma/core-types'; /** * Fetches the actual data from an S3 pointer. * Tries to parse the content as JSON. If parsing fails (e.g. for plain text files), * returns the raw string content. */ export declare function resolveS3Pointer(s3Pointer: S3Pointer, correlationId?: string): Promise<any>; /** * Checks the size of a payload and offloads it to S3 if it exceeds the defined threshold. * This is a generic utility for any Lambda to use for its return payload. * * @param payload The object to potentially offload. * @param bucketName The S3 bucket to upload to. * @param keyPrefix A prefix for the S3 key (e.g., 'step_outputs/flow-id/step-id'). * @param correlationId For logging. * @param thresholdBytes The size threshold to trigger offloading. Defaults to the configured environment variable. * @returns The original payload if it's small, or an S3OutputPointerWrapper if it was offloaded. */ export declare function offloadIfLarge(payload: Record<string, any> | undefined, bucketName: string, keyPrefix: string, correlationId: string, thresholdBytes?: number): Promise<Record<string, any> | S3OutputPointerWrapper | undefined>; //# sourceMappingURL=s3Utils.d.ts.map