1import { ListObjectsCommand } from "@aws-sdk/client-s3"2import * as _ from 'lodash-es'3import { getS3Client } from './getS3ClientF.mts'5export const getBucketPaths = async ({bucket_name, perPage=1000}: {bucket_name: string, perPage?: number}) => {6 const s3 = getS3Client({bucket_name})8 const command = new ListObjectsCommand({9 Bucket: bucket_name,10 MaxKeys: perPage11 })12 const resp = await s3.send(command)14 const {Contents: s3ItemsA} = resp15 return _.sortBy(s3ItemsA, 'LastModified')16}